mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-01 12:33:12 +08:00
When using implicit scaling, device allocations may have more than one internal allocation created internally. In that case, a separate dma-buf handle per internal allocation needs to be exported. So introduced two driver experimental extensions to export and import more than one IPC handle: - zexMemGetIpcHandles - zexMemOpenIpcHandles Related-To: LOCI-2919 Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
29 lines
846 B
C++
29 lines
846 B
C++
/*
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
|
#include "level_zero/core/source/context/context.h"
|
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
zexMemGetIpcHandles(
|
|
ze_context_handle_t hContext,
|
|
const void *ptr,
|
|
uint32_t *numIpcHandles,
|
|
ze_ipc_mem_handle_t *pIpcHandles) {
|
|
return L0::Context::fromHandle(hContext)->getIpcMemHandles(ptr, numIpcHandles, pIpcHandles);
|
|
}
|
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
zexMemOpenIpcHandles(
|
|
ze_context_handle_t hContext,
|
|
ze_device_handle_t hDevice,
|
|
uint32_t numIpcHandles,
|
|
ze_ipc_mem_handle_t *pIpcHandles,
|
|
ze_ipc_memory_flags_t flags,
|
|
void **pptr) {
|
|
return L0::Context::fromHandle(hContext)->openIpcMemHandles(hDevice, numIpcHandles, pIpcHandles, flags, pptr);
|
|
} |