diff --git a/hipamd/src/hip_memory.cpp b/hipamd/src/hip_memory.cpp index 46e73f96d2..1a4269c222 100644 --- a/hipamd/src/hip_memory.cpp +++ b/hipamd/src/hip_memory.cpp @@ -2200,6 +2200,8 @@ hipError_t ihipMemcpyParam3D(const HIP_MEMCPY3D* pCopy, hipStream_t stream, bool // {src/dst}Host may be unitialized. Copy over {src/dst}Device into it if we detect system memory. const_cast(pCopy)->srcHost = pCopy->srcDevice; const_cast(pCopy)->srcXInBytes += offset; + // We don't need detect memory type again for hipMemoryTypeUnified + const_cast(pCopy)->srcMemoryType = srcMemoryType; } } offset = 0; @@ -2216,6 +2218,8 @@ hipError_t ihipMemcpyParam3D(const HIP_MEMCPY3D* pCopy, hipStream_t stream, bool if (dstMemoryType == hipMemoryTypeHost) { const_cast(pCopy)->dstHost = pCopy->dstDevice; const_cast(pCopy)->dstXInBytes += offset; + // We don't need detect memory type again for hipMemoryTypeUnified + const_cast(pCopy)->dstMemoryType = dstMemoryType; } } // If {src/dst}MemoryType is hipMemoryTypeHost, check if the memory was prepinned.