SWDEV-301069 - current device id saved while allocating memory

Change-Id: I57045119e7adf915074c547cbe76349a4cfd72d9
Этот коммит содержится в:
agunashe authored and Ajay GunaShekar committed 2021-09-14 12:19:44 -04:00
1 родитель 673c2deed1
Коммит 29adfcd3c0
2 files changed
+16 -13

No files matched your search

+5
Просмотреть файл
@@ -226,6 +226,11 @@ hipError_t ihipMallocManaged(void** ptr, size_t size, unsigned int align) {
// allocation in the device driver
*ptr = amd::SvmBuffer::malloc(ctx, CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_ALLOC_HOST_PTR,
size, (align == 0) ? dev.info().memBaseAddrAlign_ : align);
size_t offset = 0; //this is ignored
amd::Memory* memObj = getMemoryObject(*ptr, offset);
//saves the current device id so that it can be accessed later
memObj->getUserData().deviceId = hip::getCurrentDevice()->deviceId();
if (*ptr == nullptr) {
return hipErrorMemoryAllocation;
}