SWDEV-281062 - hipIpcOpenMemHandle should return the base ptr

hipIpcOpenMemHandle should return the device pointer which is
similar to the base ptr of the original allocation even if the offset
to the original pointer is passed to hipIpcGetMemHandle

Change-Id: I99c0553e8c67c15b5fed880b6a4c74bce39c3aee
This commit is contained in:
Satyanvesh Dittakavi
2021-04-12 06:13:04 -07:00
parent 401e346787
commit 88fca7bf9e
+2 -2
View File
@@ -2126,8 +2126,8 @@ bool Device::IpcAttach(const void* handle, size_t mem_size, size_t mem_offset,
//Make sure the mem_offset doesnt overflow the allocated memory
guarantee((mem_offset < mem_size) && "IPC mem offset greater than allocated size");
// Return offsetted device pointer and maintain offsetted_ptr to orig_dev_ptr in map
*dev_ptr = reinterpret_cast<address>(orig_dev_ptr) + mem_offset;
// Return orig_dev_ptr
*dev_ptr = reinterpret_cast<address>(orig_dev_ptr);
return true;
}