mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Do not copy ze_ipc_event_pool_handle_t in internal functions of NEO
The size of this type is at least 64 bytes due to ZE_MAX_IPC_HANDLE_SIZE. This change introduces usage of const reference instead of copying. Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
5e36b1fcbf
commit
90597995d2
@ -144,7 +144,7 @@ struct Context : _ze_context_handle_t {
|
||||
size_t size,
|
||||
ze_memory_access_attribute_t *access,
|
||||
size_t *outSize) = 0;
|
||||
virtual ze_result_t openEventPoolIpcHandle(ze_ipc_event_pool_handle_t hIpc,
|
||||
virtual ze_result_t openEventPoolIpcHandle(const ze_ipc_event_pool_handle_t &hIpc,
|
||||
ze_event_pool_handle_t *phEventPool) = 0;
|
||||
virtual ze_result_t createEventPool(const ze_event_pool_desc_t *desc,
|
||||
uint32_t numDevices,
|
||||
|
@ -556,7 +556,7 @@ ze_result_t EventPoolImp::getIpcHandle(ze_ipc_event_pool_handle_t *pIpcHandle) {
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
ze_result_t ContextImp::openEventPoolIpcHandle(ze_ipc_event_pool_handle_t hIpc,
|
||||
ze_result_t ContextImp::openEventPoolIpcHandle(const ze_ipc_event_pool_handle_t &hIpc,
|
||||
ze_event_pool_handle_t *phEventPool) {
|
||||
uint64_t handle = 0u;
|
||||
memcpy_s(&handle, sizeof(int), hIpc.data, sizeof(int));
|
||||
|
@ -126,7 +126,7 @@ struct ContextImp : Context {
|
||||
size_t size,
|
||||
ze_memory_access_attribute_t *access,
|
||||
size_t *outSize) override;
|
||||
ze_result_t openEventPoolIpcHandle(ze_ipc_event_pool_handle_t hIpc,
|
||||
ze_result_t openEventPoolIpcHandle(const ze_ipc_event_pool_handle_t &hIpc,
|
||||
ze_event_pool_handle_t *phEventPool) override;
|
||||
ze_result_t createEventPool(const ze_event_pool_desc_t *desc,
|
||||
uint32_t numDevices,
|
||||
|
@ -56,7 +56,7 @@ struct Mock<Context> : public Context {
|
||||
ADDMETHOD_NOBASE(unMapVirtualMem, ze_result_t, ZE_RESULT_SUCCESS, (const void *ptr, size_t size));
|
||||
ADDMETHOD_NOBASE(setVirtualMemAccessAttribute, ze_result_t, ZE_RESULT_SUCCESS, (const void *ptr, size_t size, ze_memory_access_attribute_t access));
|
||||
ADDMETHOD_NOBASE(getVirtualMemAccessAttribute, ze_result_t, ZE_RESULT_SUCCESS, (const void *ptr, size_t size, ze_memory_access_attribute_t *access, size_t *outSize));
|
||||
ADDMETHOD_NOBASE(openEventPoolIpcHandle, ze_result_t, ZE_RESULT_SUCCESS, (ze_ipc_event_pool_handle_t hIpc, ze_event_pool_handle_t *phEventPool));
|
||||
ADDMETHOD_NOBASE(openEventPoolIpcHandle, ze_result_t, ZE_RESULT_SUCCESS, (const ze_ipc_event_pool_handle_t &hIpc, ze_event_pool_handle_t *phEventPool));
|
||||
ADDMETHOD_NOBASE(createEventPool, ze_result_t, ZE_RESULT_SUCCESS, (const ze_event_pool_desc_t *desc, uint32_t numDevices, ze_device_handle_t *phDevices, ze_event_pool_handle_t *phEventPool));
|
||||
ADDMETHOD_NOBASE(createImage, ze_result_t, ZE_RESULT_SUCCESS, (ze_device_handle_t hDevice, const ze_image_desc_t *desc, ze_image_handle_t *phImage));
|
||||
};
|
||||
|
Reference in New Issue
Block a user