Skip to content

Commit 68b68b1

Browse files
committed
Apply review feedback to remove unnecessary noise
1 parent d96bd03 commit 68b68b1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

source/adapters/hip/enqueue.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemcpy2D(
16181618
hipPointerAttribute_t srcAttribs{};
16191619
hipPointerAttribute_t dstAttribs{};
16201620

1621+
hipError_t hipRes{};
16211622
// Determine if pSrc and/or pDst are system allocated pageable host memory.
16221623
bool srcIsSystemAlloc{false};
16231624
bool dstIsSystemAlloc{false};
@@ -1630,11 +1631,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemcpy2D(
16301631
// the pointer handle as system allocated pageable host memory.
16311632
// The HIP runtime can handle the registering/unregistering of the memory
16321633
// 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)
16351636
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)
16381639
dstIsSystemAlloc = true;
16391640
#if HIP_VERSION_MAJOR >= 6
16401641
srcIsSystemAlloc |= srcAttribs.type == hipMemoryTypeUnregistered;

0 commit comments

Comments
 (0)