P4 to Git Change 1766076 by michliao@hliao-dev-00-hip.rocm-workspace on 2019/04/04 17:35:28
SWDEV-144570 - Fix pointer attribute query.
- Device should be numbered from zero.
RB: http://ocltc.amd.com/reviews/r/17090/
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_memory.cpp#49 edit
[ROCm/hip commit: 41c75b2f8d]
This commit is contained in:
@@ -1452,14 +1452,14 @@ hipError_t hipPointerGetAttributes(hipPointerAttribute_t* attributes, const void
|
||||
attributes->devicePointer = memObj->getSvmPtr();
|
||||
attributes->isManaged = 0;
|
||||
attributes->allocationFlags = memObj->getMemFlags() >> 16;
|
||||
|
||||
|
||||
amd::Context &memObjCtx = memObj->getContext();
|
||||
for (auto& ctx : g_devices) {
|
||||
++device;
|
||||
if (*ctx == memObjCtx) {
|
||||
attributes->device = device;
|
||||
break;
|
||||
}
|
||||
++device;
|
||||
}
|
||||
} else {
|
||||
attributes->memoryType = hipMemoryTypeHost;
|
||||
|
||||
Reference in New Issue
Block a user