File tree 1 file changed +5
-4
lines changed 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1618,6 +1618,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemcpy2D(
1618
1618
hipPointerAttribute_t srcAttribs{};
1619
1619
hipPointerAttribute_t dstAttribs{};
1620
1620
1621
+ hipError_t hipRes{};
1621
1622
// Determine if pSrc and/or pDst are system allocated pageable host memory.
1622
1623
bool srcIsSystemAlloc{false };
1623
1624
bool dstIsSystemAlloc{false };
@@ -1630,11 +1631,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemcpy2D(
1630
1631
// the pointer handle as system allocated pageable host memory.
1631
1632
// The HIP runtime can handle the registering/unregistering of the memory
1632
1633
// as long as the right copy-kind (direction) is provided to hipMemcpy2D*.
1633
- hipError_t hipRet = hipPointerGetAttributes (&srcAttribs, pSrc);
1634
- if (pSrc && hipRet == hipErrorInvalidValue)
1634
+ hipRes = hipPointerGetAttributes (&srcAttribs, pSrc);
1635
+ if (hipRes == hipErrorInvalidValue && pSrc )
1635
1636
srcIsSystemAlloc = true ;
1636
- hipRet = hipPointerGetAttributes (&dstAttribs, (const void *)pDst);
1637
- if (pDst && hipRet == hipErrorInvalidValue)
1637
+ hipRes = hipPointerGetAttributes (&dstAttribs, (const void *)pDst);
1638
+ if (hipRes == hipErrorInvalidValue && pDst )
1638
1639
dstIsSystemAlloc = true ;
1639
1640
#if HIP_VERSION_MAJOR >= 6
1640
1641
srcIsSystemAlloc |= srcAttribs.type == hipMemoryTypeUnregistered;
You can’t perform that action at this time.
0 commit comments