SWDEV-348820 - Fix hipPointerAttribute_t incompatibility
- Use hipPointerAttribute_t.type instead of hipPointerAttribute_t.memoryType
Change-Id: I3bf1c0758bdae987213ba7de62247dd420ef4cc9
[ROCm/clr commit: cbc3a0a652]
This commit is contained in:
@@ -2227,13 +2227,13 @@ inline static hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attribut
|
||||
#endif
|
||||
switch (memType) {
|
||||
case cudaMemoryTypeDevice:
|
||||
attributes->memoryType = hipMemoryTypeDevice;
|
||||
attributes->type = hipMemoryTypeDevice;
|
||||
break;
|
||||
case cudaMemoryTypeHost:
|
||||
attributes->memoryType = hipMemoryTypeHost;
|
||||
attributes->type = hipMemoryTypeHost;
|
||||
break;
|
||||
case cudaMemoryTypeManaged:
|
||||
attributes->memoryType = hipMemoryTypeManaged;
|
||||
attributes->type = hipMemoryTypeManaged;
|
||||
break;
|
||||
default:
|
||||
return hipErrorInvalidValue;
|
||||
|
||||
@@ -3003,9 +3003,9 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void
|
||||
memset(attributes, 0, sizeof(hipPointerAttribute_t));
|
||||
|
||||
if (memObj != nullptr) {
|
||||
attributes->memoryType = ((CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_USE_HOST_PTR) &
|
||||
attributes->type = ((CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_USE_HOST_PTR) &
|
||||
memObj->getMemFlags())? hipMemoryTypeHost : hipMemoryTypeDevice;
|
||||
if (attributes->memoryType == hipMemoryTypeHost) {
|
||||
if (attributes->type == hipMemoryTypeHost) {
|
||||
if (memObj->getHostMem() != nullptr) {
|
||||
attributes->hostPointer = static_cast<char*>(memObj->getHostMem()) + offset;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user