Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions unified-runtime/include/ur_api.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion unified-runtime/include/ur_ddi.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions unified-runtime/include/ur_print.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ params:
- type: void *
name: pMem
desc: "[in] pointer to device USM memory"
- type: void*
name: pIPCMemHandleData
- type: void**
name: ppIPCMemHandleData
desc: "[out][optional] a pointer to the IPC memory handle data"
- type: size_t*
name: pIPCMemHandleDataSizeRet
Expand All @@ -47,7 +47,7 @@ returns:
- $X_RESULT_ERROR_INVALID_NULL_HANDLE:
- "`NULL == hContext`"
- $X_RESULT_ERROR_INVALID_NULL_POINTER:
- "`NULL == pIPCMemHandleData`"
- "`NULL == ppIPCMemHandleData`"
- "`NULL == pIPCMemHandleDataSizeRet`"
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
- $X_RESULT_ERROR_OUT_OF_RESOURCES
Expand Down
13 changes: 5 additions & 8 deletions unified-runtime/source/adapters/cuda/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,28 +592,25 @@ CUsurfObject SurfaceMem::getSurface(const ur_device_handle_t Device) {
}

UR_APIEXPORT ur_result_t UR_APICALL
urIPCGetMemHandleExp(ur_context_handle_t, void *pMem, void *pIPCMemHandleData,
urIPCGetMemHandleExp(ur_context_handle_t, void *pMem, void **ppIPCMemHandleData,
size_t *pIPCMemHandleDataSizeRet) {
umf_memory_pool_handle_t umfPool;
auto urRet = umf::umf2urResult(umfPoolByPtr(pMem, &umfPool));
if (urRet)
return urRet;

// Fast path for returning the size of the handle only.
if (!pIPCMemHandleData)
if (!ppIPCMemHandleData)
return umf::umf2urResult(
umfPoolGetIPCHandleSize(umfPool, pIPCMemHandleDataSizeRet));

size_t fallbackUMFHandleSize = 0;
size_t *umfHandleSize = pIPCMemHandleDataSizeRet != nullptr
? pIPCMemHandleDataSizeRet
: &fallbackUMFHandleSize;
umf_ipc_handle_t umfHandle;
urRet = umf::umf2urResult(umfGetIPCHandle(pMem, &umfHandle, umfHandleSize));
if (urRet)
return urRet;
std::memcpy(pIPCMemHandleData, umfHandle, *umfHandleSize);
return UR_RESULT_SUCCESS;
return umf::umf2urResult(umfGetIPCHandle(
pMem, reinterpret_cast<umf_ipc_handle_t *>(ppIPCMemHandleData),
umfHandleSize));
}

UR_APIEXPORT ur_result_t UR_APICALL
Expand Down
2 changes: 1 addition & 1 deletion unified-runtime/source/adapters/hip/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ hipSurfaceObject_t SurfaceMem::getSurface(const ur_device_handle_t Device) {
}

UR_APIEXPORT ur_result_t UR_APICALL urIPCGetMemHandleExp(ur_context_handle_t,
void *, void *,
void *, void **,
size_t *) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
Expand Down
13 changes: 5 additions & 8 deletions unified-runtime/source/adapters/level_zero/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1953,28 +1953,25 @@ ur_result_t urEnqueueWriteHostPipe(
}

ur_result_t urIPCGetMemHandleExp(ur_context_handle_t, void *pMem,
void *pIPCMemHandleData,
void **ppIPCMemHandleData,
size_t *pIPCMemHandleDataSizeRet) {
umf_memory_pool_handle_t umfPool;
auto urRet = umf::umf2urResult(umfPoolByPtr(pMem, &umfPool));
if (urRet)
return urRet;

// Fast path for returning the size of the handle only.
if (!pIPCMemHandleData)
if (!ppIPCMemHandleData)
return umf::umf2urResult(
umfPoolGetIPCHandleSize(umfPool, pIPCMemHandleDataSizeRet));

size_t fallbackUMFHandleSize = 0;
size_t *umfHandleSize = pIPCMemHandleDataSizeRet != nullptr
? pIPCMemHandleDataSizeRet
: &fallbackUMFHandleSize;
umf_ipc_handle_t umfHandle;
urRet = umf::umf2urResult(umfGetIPCHandle(pMem, &umfHandle, umfHandleSize));
if (urRet)
return urRet;
std::memcpy(pIPCMemHandleData, umfHandle, *umfHandleSize);
return UR_RESULT_SUCCESS;
return umf::umf2urResult(umfGetIPCHandle(
pMem, reinterpret_cast<umf_ipc_handle_t *>(ppIPCMemHandleData),
umfHandleSize));
}

ur_result_t urIPCPutMemHandleExp(ur_context_handle_t, void *pIPCMemHandleData) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions unified-runtime/source/adapters/level_zero/v2/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,28 +782,25 @@ ur_result_t urMemImageGetInfo(ur_mem_handle_t /*hMemory*/,
}

ur_result_t urIPCGetMemHandleExp(ur_context_handle_t, void *pMem,
void *pIPCMemHandleData,
void **ppIPCMemHandleData,
size_t *pIPCMemHandleDataSizeRet) {
umf_memory_pool_handle_t umfPool;
auto urRet = umf::umf2urResult(umfPoolByPtr(pMem, &umfPool));
if (urRet)
return urRet;

// Fast path for returning the size of the handle only.
if (!pIPCMemHandleData)
if (!ppIPCMemHandleData)
return umf::umf2urResult(
umfPoolGetIPCHandleSize(umfPool, pIPCMemHandleDataSizeRet));

size_t fallbackUMFHandleSize = 0;
size_t *umfHandleSize = pIPCMemHandleDataSizeRet != nullptr
? pIPCMemHandleDataSizeRet
: &fallbackUMFHandleSize;
umf_ipc_handle_t umfHandle;
urRet = umf::umf2urResult(umfGetIPCHandle(pMem, &umfHandle, umfHandleSize));
if (urRet)
return urRet;
std::memcpy(pIPCMemHandleData, umfHandle, *umfHandleSize);
return UR_RESULT_SUCCESS;
return umf::umf2urResult(umfGetIPCHandle(
pMem, reinterpret_cast<umf_ipc_handle_t *>(ppIPCMemHandleData),
umfHandleSize));
}

ur_result_t urIPCPutMemHandleExp(ur_context_handle_t, void *pIPCMemHandleData) {
Expand Down
4 changes: 2 additions & 2 deletions unified-runtime/source/adapters/mock/ur_mockddi.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion unified-runtime/source/adapters/native_cpu/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(
}

UR_APIEXPORT ur_result_t UR_APICALL urIPCGetMemHandleExp(ur_context_handle_t,
void *, void *,
void *, void **,
size_t *) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
Expand Down
2 changes: 1 addition & 1 deletion unified-runtime/source/adapters/offload/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(ur_mem_handle_t,
}

UR_APIEXPORT ur_result_t UR_APICALL urIPCGetMemHandleExp(ur_context_handle_t,
void *, void *,
void *, void **,
size_t *) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
Expand Down
2 changes: 1 addition & 1 deletion unified-runtime/source/adapters/opencl/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemRelease(ur_mem_handle_t hMem) {
}

UR_APIEXPORT ur_result_t UR_APICALL urIPCGetMemHandleExp(ur_context_handle_t,
void *, void *,
void *, void **,
size_t *) {
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
Expand Down
6 changes: 3 additions & 3 deletions unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions unified-runtime/source/loader/ur_ldrddi.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions unified-runtime/source/loader/ur_libapi.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions unified-runtime/source/ur_api.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading