SWDEV-259566 - Adding support to retrieve handle for offsetted pointer.

Change-Id: I5da5ab6a24c6df915950637feb486b8c288e60e0
Этот коммит содержится в:
kjayapra-amd
2020-11-10 14:57:02 -05:00
коммит произвёл Karthik Jayaprakash
родитель 80255c5b26
Коммит b4492a3de3
4 изменённых файлов: 65 добавлений и 42 удалений
+5 -3
Просмотреть файл
@@ -2034,7 +2034,7 @@ hipError_t hipIpcGetMemHandle(hipIpcMemHandle_t* handle, void* dev_ptr) {
device = hip::getCurrentDevice()->devices()[0];
ihandle = reinterpret_cast<ihipIpcMemHandle_t *>(handle);
if(!device->IpcCreate(dev_ptr, &(ihandle->psize), &(ihandle->ipc_handle))) {
if(!device->IpcCreate(dev_ptr, &(ihandle->psize), &(ihandle->ipc_handle), &(ihandle->poffset))) {
LogPrintfError("IPC memory creation failed for memory: 0x%x", dev_ptr);
HIP_RETURN(hipErrorInvalidDevicePointer);
}
@@ -2061,8 +2061,10 @@ hipError_t hipIpcOpenMemHandle(void** dev_ptr, hipIpcMemHandle_t handle, unsigne
HIP_RETURN(hipErrorInvalidValue);
}
if(!device->IpcAttach(&(ihandle->ipc_handle), ihandle->psize, flags, dev_ptr)) {
LogPrintfError("cannot attach ipc_handle: with ipc_size: %u flags: %u", ihandle->psize, flags);
if(!device->IpcAttach(&(ihandle->ipc_handle), ihandle->psize,
ihandle->poffset, flags, dev_ptr)) {
LogPrintfError("Cannot attach ipc_handle: with ipc_size: %u"
"ipc_offset: %u flags: %u", ihandle->psize, flags);
HIP_RETURN(hipErrorInvalidDevicePointer);
}