feature: new API to create and export counter-based Event

Related-To: NEO-8145

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-12-14 11:29:10 +00:00
committed by Compute-Runtime-Automation
parent ba0db2488a
commit b18acc26b7
5 changed files with 60 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2020-2023 Intel Corporation
# Copyright (C) 2020-2024 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -13,6 +13,8 @@ target_sources(${L0_STATIC_LIB_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/zex_common.h
${CMAKE_CURRENT_SOURCE_DIR}/zex_driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/zex_driver.h
${CMAKE_CURRENT_SOURCE_DIR}/zex_event.cpp
${CMAKE_CURRENT_SOURCE_DIR}/zex_event.h
${CMAKE_CURRENT_SOURCE_DIR}/zex_memory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/zex_memory.h
${CMAKE_CURRENT_SOURCE_DIR}/zex_module.cpp

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2023 Intel Corporation
* Copyright (C) 2022-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -20,6 +20,7 @@
#include "level_zero/api/driver_experimental/public/zex_cmdlist.h"
#include "zex_driver.h"
#include "zex_event.h"
#include "zex_memory.h"
#include "zex_module.h"

View File

@@ -0,0 +1,22 @@
/*
* Copyright (C) 2023-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "level_zero/api/driver_experimental/public/zex_event.h"
namespace L0 {
ZE_APIEXPORT ze_result_t ZE_APICALL
zexEventGetDeviceAddress(ze_event_handle_t event, uint64_t *completionValue, uint64_t *address) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
ZE_APIEXPORT ze_result_t ZE_APICALL
zexCounterBasedEventCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice, uint64_t *deviceAddress, uint64_t *hostAddress, uint64_t completionValue, const ze_event_desc_t *desc, ze_event_handle_t *phEvent) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
} // namespace L0

View File

@@ -0,0 +1,30 @@
/*
* Copyright (C) 2023-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "level_zero/api/driver_experimental/public/zex_common.h"
#include <level_zero/ze_api.h>
namespace L0 {
ZE_APIEXPORT ze_result_t ZE_APICALL
zexEventGetDeviceAddress(
ze_event_handle_t event,
uint64_t *completionValue,
uint64_t *address);
ZE_APIEXPORT ze_result_t ZE_APICALL
zexCounterBasedEventCreate(
ze_context_handle_t hContext,
ze_device_handle_t hDevice,
uint64_t *deviceAddress,
uint64_t *hostAddress,
uint64_t completionValue,
const ze_event_desc_t *desc,
ze_event_handle_t *phEvent);
} // namespace L0

View File

@@ -26,6 +26,9 @@ std::unordered_map<std::string, void *> getExtensionFunctionsLookupMap() {
addToMap(lookupMap, zexCommandListAppendWaitOnMemory);
addToMap(lookupMap, zexCommandListAppendWaitOnMemory64);
addToMap(lookupMap, zexCommandListAppendWriteToMemory);
addToMap(lookupMap, zexCounterBasedEventCreate);
addToMap(lookupMap, zexEventGetDeviceAddress);
#undef addToMap
return lookupMap;