SWDEV-437817 - Fix hipMemCpy2D case that erroneously fails with invalid argument error
When an offset is applied to the source or destination pointers plus the kind is set to hipMemcpyDefault and the source or destination is allocated with hipMallocManaged hipMemCpy2D erroneously fails with hipErrorInvalidValue. Change-Id: I0db4c17514f743652d8f9a2691da6601a2abb2a1
This commit is contained in:
1 parent
4a7291ded8
commit
d3bfb55d7a
1 file changed
+2
-2
@@ -2149,13 +2149,13 @@ void ihipCopyMemParamSet(const HIP_MEMCPY3D* pCopy, hipMemoryType& srcMemType,
|
||||
memObj->getMemFlags()) ? hipMemoryTypeHost : hipMemoryTypeDevice;
|
||||
} else {
|
||||
srcMemoryType = hipMemoryTypeHost;
|
||||
const_cast<HIP_MEMCPY3D*>(pCopy)->srcXInBytes += offset;
|
||||
}
|
||||
|
||||
if (srcMemoryType == hipMemoryTypeHost) {
|
||||
// {src/dst}Host may be unitialized. Copy over {src/dst}Device into it if we
|
||||
// detect system memory.
|
||||
const_cast<HIP_MEMCPY3D*>(pCopy)->srcHost = pCopy->srcDevice;
|
||||
const_cast<HIP_MEMCPY3D*>(pCopy)->srcXInBytes += offset;
|
||||
// We don't need detect memory type again for hipMemoryTypeUnified
|
||||
const_cast<HIP_MEMCPY3D*>(pCopy)->srcMemoryType = srcMemoryType;
|
||||
}
|
||||
@@ -2169,11 +2169,11 @@ void ihipCopyMemParamSet(const HIP_MEMCPY3D* pCopy, hipMemoryType& srcMemType,
|
||||
memObj->getMemFlags()) ? hipMemoryTypeHost : hipMemoryTypeDevice;
|
||||
} else {
|
||||
dstMemoryType = hipMemoryTypeHost;
|
||||
const_cast<HIP_MEMCPY3D*>(pCopy)->dstXInBytes += offset;
|
||||
}
|
||||
|
||||
if (dstMemoryType == hipMemoryTypeHost) {
|
||||
const_cast<HIP_MEMCPY3D*>(pCopy)->dstHost = pCopy->dstDevice;
|
||||
const_cast<HIP_MEMCPY3D*>(pCopy)->dstXInBytes += offset;
|
||||
// We don't need detect memory type again for hipMemoryTypeUnified
|
||||
const_cast<HIP_MEMCPY3D*>(pCopy)->dstMemoryType = dstMemoryType;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user