Return hipMemoryTypeHost as memory type for hipHostRegistered pointer
Fixes SWDEV-253741 Change-Id: I42c2c9df00862157314d5767b6f175a0d2f28b47
This commit is contained in:
@@ -2038,7 +2038,7 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void
|
|||||||
memset(attributes, 0, sizeof(hipPointerAttribute_t));
|
memset(attributes, 0, sizeof(hipPointerAttribute_t));
|
||||||
|
|
||||||
if (memObj != nullptr) {
|
if (memObj != nullptr) {
|
||||||
attributes->memoryType = (CL_MEM_SVM_FINE_GRAIN_BUFFER & memObj->getMemFlags())? hipMemoryTypeHost : hipMemoryTypeDevice;
|
attributes->memoryType = ((CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_USE_HOST_PTR) & memObj->getMemFlags())? hipMemoryTypeHost : hipMemoryTypeDevice;
|
||||||
if (attributes->memoryType == hipMemoryTypeHost) {
|
if (attributes->memoryType == hipMemoryTypeHost) {
|
||||||
attributes->hostPointer = static_cast<char*>(memObj->getSvmPtr()) + offset;
|
attributes->hostPointer = static_cast<char*>(memObj->getSvmPtr()) + offset;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user