SWDEV-321654 - fix hipPointerGetAttribute API
Change-Id: Icafdda147eb16e08048d6c435c0c5714f3f8d143
This commit is contained in:
committed by
Julia Jiang
vanhempi
e70d7374ef
commit
dabed031a0
@@ -2711,7 +2711,7 @@ hipError_t ihipPointerGetAttributes(void** data, int* attributes,
|
||||
static_cast<char*>(memObj->getSvmPtr()) + offset;
|
||||
}
|
||||
} else {
|
||||
*reinterpret_cast<char**>(data[idx]) = nullptr;
|
||||
status = hipErrorInvalidValue;
|
||||
}
|
||||
} else { // Host Memory
|
||||
*reinterpret_cast<char**>(data[idx]) = static_cast<char*>(ptr);
|
||||
@@ -2776,8 +2776,9 @@ hipError_t ihipPointerGetAttributes(void** data, int* attributes,
|
||||
*reinterpret_cast<hipDeviceptr_t*>(data[idx]) =
|
||||
reinterpret_cast<char*>(devMem->virtualAddress());
|
||||
}
|
||||
} else { // Host Memory
|
||||
*reinterpret_cast<char**>(data[idx]) = static_cast<char*>(ptr);
|
||||
} else {
|
||||
// Input is host memory pointer, invalid for device.
|
||||
status = hipErrorInvalidValue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2801,8 +2802,8 @@ hipError_t ihipPointerGetAttributes(void** data, int* attributes,
|
||||
}
|
||||
case HIP_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE : {
|
||||
// GPUDirect RDMA API is not yet supported, hence returning 0
|
||||
LogPrintfWarning("attribute %d is not supported, defaults to 0", attributes[i]);
|
||||
*reinterpret_cast<bool*>(data[idx]) = 0;
|
||||
LogPrintfWarning("attribute %d is not supported.", attributes[i]);
|
||||
status = hipErrorNotSupported;
|
||||
break;
|
||||
}
|
||||
case HIP_POINTER_ATTRIBUTE_ACCESS_FLAGS : {
|
||||
@@ -2815,8 +2816,8 @@ hipError_t ihipPointerGetAttributes(void** data, int* attributes,
|
||||
}
|
||||
case HIP_POINTER_ATTRIBUTE_MEMPOOL_HANDLE : {
|
||||
// allocations from mempool are not yet supported, hence returning 0
|
||||
LogPrintfWarning("attribute %d is not supported, defaults to 0", attributes[i]);
|
||||
*reinterpret_cast<bool*>(data[idx]) = 0;
|
||||
LogPrintfWarning("attribute %d is not supported.", attributes[i]);
|
||||
status = hipErrorNotSupported;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
Viittaa uudesa ongelmassa
Block a user