From 88fca7bf9e85cbef6a6fbc198b1c562b27bd7403 Mon Sep 17 00:00:00 2001 From: Satyanvesh Dittakavi Date: Mon, 12 Apr 2021 06:13:04 -0700 Subject: [PATCH] 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 --- rocclr/device/rocm/rocdevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rocclr/device/rocm/rocdevice.cpp b/rocclr/device/rocm/rocdevice.cpp index ac634d4d23..0cca8ab908 100644 --- a/rocclr/device/rocm/rocdevice.cpp +++ b/rocclr/device/rocm/rocdevice.cpp @@ -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
(orig_dev_ptr) + mem_offset; + // Return orig_dev_ptr + *dev_ptr = reinterpret_cast
(orig_dev_ptr); return true; }