Fix hipPointerGetAttributes
Modified hipPointerGetAttributes to support hipHostRegister ptrs and mapped device ptrs from hipHostRegister
Change-Id: I2f4cf12e09578768308f644123d6d4bdccbd77a8
[ROCm/hip commit: a7b5347c90]
Este cometimento está contido em:
1 ascendente
07aa78a19b
cometimento
390615cc60
2 ficheiros modificados
+346
-2
Não existem ficheiros que correspondam à sua pesquisa
@@ -2083,9 +2083,14 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void
|
||||
attributes->memoryType = ((CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_USE_HOST_PTR) &
|
||||
memObj->getMemFlags())? hipMemoryTypeHost : hipMemoryTypeDevice;
|
||||
if (attributes->memoryType == hipMemoryTypeHost) {
|
||||
attributes->hostPointer = static_cast<char*>(memObj->getSvmPtr()) + offset;
|
||||
if (memObj->getHostMem() != nullptr) {
|
||||
attributes->hostPointer = static_cast<char*>(memObj->getHostMem()) + offset;
|
||||
}
|
||||
else {
|
||||
attributes->hostPointer = static_cast<char*>(memObj->getSvmPtr()) + offset;
|
||||
}
|
||||
}
|
||||
attributes->devicePointer = static_cast<char*>(memObj->getSvmPtr()) + offset;
|
||||
attributes->devicePointer = reinterpret_cast<char*>(memObj->getDeviceMemory(*hip::getCurrentDevice()->devices()[0])->virtualAddress() + offset);
|
||||
constexpr uint32_t kManagedAlloc = (CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_ALLOC_HOST_PTR);
|
||||
attributes->isManaged =
|
||||
((memObj->getMemFlags() & kManagedAlloc) == kManagedAlloc) ? true : false;
|
||||
|
||||
Criar uma nova questão referindo esta
Bloquear um utilizador