2020-03-06 11:09:57 +01:00
|
|
|
/*
|
2021-05-16 20:51:16 +02:00
|
|
|
* Copyright (C) 2020-2021 Intel Corporation
|
2020-03-06 11:09:57 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-03-18 22:21:57 -07:00
|
|
|
#include "level_zero/core/source/event/event.h"
|
2020-03-06 11:09:57 +01:00
|
|
|
#include <level_zero/ze_api.h>
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeEventPoolCreate(
|
2020-07-29 02:45:54 -07:00
|
|
|
ze_context_handle_t hContext,
|
2020-03-06 11:09:57 +01:00
|
|
|
const ze_event_pool_desc_t *desc,
|
|
|
|
|
uint32_t numDevices,
|
|
|
|
|
ze_device_handle_t *phDevices,
|
|
|
|
|
ze_event_pool_handle_t *phEventPool) {
|
2020-07-29 02:45:54 -07:00
|
|
|
return L0::Context::fromHandle(hContext)->createEventPool(desc, numDevices, phDevices, phEventPool);
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeEventPoolDestroy(
|
|
|
|
|
ze_event_pool_handle_t hEventPool) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::EventPool::fromHandle(hEventPool)->destroy();
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeEventCreate(
|
|
|
|
|
ze_event_pool_handle_t hEventPool,
|
|
|
|
|
const ze_event_desc_t *desc,
|
|
|
|
|
ze_event_handle_t *phEvent) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::EventPool::fromHandle(hEventPool)->createEvent(desc, phEvent);
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeEventDestroy(
|
|
|
|
|
ze_event_handle_t hEvent) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::Event::fromHandle(hEvent)->destroy();
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeEventPoolGetIpcHandle(
|
|
|
|
|
ze_event_pool_handle_t hEventPool,
|
|
|
|
|
ze_ipc_event_pool_handle_t *phIpc) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::EventPool::fromHandle(hEventPool)->getIpcHandle(phIpc);
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeEventPoolOpenIpcHandle(
|
2020-07-29 02:45:54 -07:00
|
|
|
ze_context_handle_t hContext,
|
2020-03-06 11:09:57 +01:00
|
|
|
ze_ipc_event_pool_handle_t hIpc,
|
|
|
|
|
ze_event_pool_handle_t *phEventPool) {
|
2020-07-29 02:45:54 -07:00
|
|
|
return L0::Context::fromHandle(hContext)->openEventPoolIpcHandle(hIpc, phEventPool);
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeEventPoolCloseIpcHandle(
|
|
|
|
|
ze_event_pool_handle_t hEventPool) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::EventPool::fromHandle(hEventPool)->closeIpcHandle();
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeCommandListAppendSignalEvent(
|
|
|
|
|
ze_command_list_handle_t hCommandList,
|
|
|
|
|
ze_event_handle_t hEvent) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::CommandList::fromHandle(hCommandList)->appendSignalEvent(hEvent);
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeCommandListAppendWaitOnEvents(
|
|
|
|
|
ze_command_list_handle_t hCommandList,
|
|
|
|
|
uint32_t numEvents,
|
|
|
|
|
ze_event_handle_t *phEvents) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::CommandList::fromHandle(hCommandList)->appendWaitOnEvents(numEvents, phEvents);
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeEventHostSignal(
|
|
|
|
|
ze_event_handle_t hEvent) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::Event::fromHandle(hEvent)->hostSignal();
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeEventHostSynchronize(
|
|
|
|
|
ze_event_handle_t hEvent,
|
2020-07-29 02:45:54 -07:00
|
|
|
uint64_t timeout) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::Event::fromHandle(hEvent)->hostSynchronize(timeout);
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeEventQueryStatus(
|
|
|
|
|
ze_event_handle_t hEvent) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::Event::fromHandle(hEvent)->queryStatus();
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeCommandListAppendEventReset(
|
|
|
|
|
ze_command_list_handle_t hCommandList,
|
|
|
|
|
ze_event_handle_t hEvent) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::CommandList::fromHandle(hCommandList)->appendEventReset(hEvent);
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-03-06 11:09:57 +01:00
|
|
|
zeEventHostReset(
|
|
|
|
|
ze_event_handle_t hEvent) {
|
2020-03-10 23:19:06 -07:00
|
|
|
return L0::Event::fromHandle(hEvent)->reset();
|
2020-03-06 11:09:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 18:03:32 -07:00
|
|
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
2020-07-29 02:45:54 -07:00
|
|
|
zeEventQueryKernelTimestamp(
|
2020-07-29 14:25:20 +02:00
|
|
|
ze_event_handle_t hEvent,
|
2020-07-29 02:45:54 -07:00
|
|
|
ze_kernel_timestamp_result_t *timestampType) {
|
|
|
|
|
return L0::Event::fromHandle(hEvent)->queryKernelTimestamp(timestampType);
|
2021-08-05 06:50:38 +00:00
|
|
|
}
|