mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
refactor: Set external semaphore version in L0
Related-To: NEO-14295 Signed-off-by: Raiyan Latif <raiyan.latif@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
570e05774d
commit
80168b194f
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
* Copyright (C) 2020-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -275,104 +275,6 @@ zeIntelKernelGetBinaryExp(
|
||||
char *pKernelBinary ///< [in,out] pointer to storage area for GEN ISA binary function
|
||||
);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef ZE_INTEL_EXTERNAL_SEMAPHORE_EXP_NAME
|
||||
/// @brief External semaphore extension name
|
||||
#define ZE_INTEL_EXTERNAL_SEMAPHORE_EXP_NAME "ZE_intel_experimental_external_semaphore"
|
||||
#endif // ZE_INTEL_EXTERNAL_SEMAPHORE_EXP_NAME
|
||||
|
||||
typedef enum _ze_intel_external_semaphore_exp_version_t {
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_VERSION_1_0 = ZE_MAKE_VERSION(1, 0), ///< version 1.0
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_VERSION_CURRENT = ZE_MAKE_VERSION(1, 0), ///< latest known version
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_VERSION_FORCE_UINT32 = 0x7fffffff
|
||||
} ze_intel_external_semaphore_exp_version_t;
|
||||
|
||||
typedef enum _ze_intel_external_semaphore_exp_flags_t {
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_FLAGS_OPAQUE_FD,
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_FLAGS_OPAQUE_WIN32,
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_FLAGS_OPAQUE_WIN32_KMT,
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_FLAGS_D3D12_FENCE,
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_FLAGS_D3D11_FENCE,
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_FLAGS_KEYED_MUTEX,
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_FLAGS_KEYED_MUTEX_KMT,
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_FLAGS_TIMELINE_SEMAPHORE_FD,
|
||||
ZE_EXTERNAL_SEMAPHORE_EXP_FLAGS_TIMELINE_SEMAPHORE_WIN32
|
||||
} ze_intel_external_semaphore_exp_flags_t;
|
||||
|
||||
typedef struct _ze_intel_external_semaphore_exp_desc_t {
|
||||
ze_structure_type_t stype; ///< [in] type of this structure
|
||||
const void *pNext; ///< [in] must be null or a pointer to an extension-specific
|
||||
///< structure (i.e. contains stype and pNext). When importing
|
||||
///< a semaphore, this can be a pointer to either ze_intel_external_semaphore_win32_exp_desc_t
|
||||
///< or ze_intel_external_semaphore_fd_exp_desc_t.
|
||||
ze_intel_external_semaphore_exp_flags_t flags; ///< [in] External semaphore flags. Must be 0 or a valid combination of ::ze_intel_external_semaphore_exp_flags_t
|
||||
} ze_intel_external_semaphore_exp_desc_t;
|
||||
|
||||
typedef struct _ze_intel_external_semaphore_win32_exp_desc_t {
|
||||
ze_structure_type_t stype; ///< [in] type of this structure
|
||||
const void *pNext; ///< [in] must be null or a pointer to an extension-specific
|
||||
///< structure (i.e. contains stype and pNext).
|
||||
void *handle; ///< [in] Win32 HANDLE for semaphore
|
||||
const char *name; ///< [in] Name of the semaphore. Must be valid NULL terminated string.
|
||||
} ze_intel_external_semaphore_win32_exp_desc_t;
|
||||
|
||||
typedef struct _ze_intel_external_semaphore_fd_exp_desc_t {
|
||||
ze_structure_type_t stype; ///< [in] type of this structure
|
||||
const void *pNext; ///< [in] must be null or a pointer to an extension-specific
|
||||
///< structure (i.e. contains stype and pNext).
|
||||
int fd; ///< [in] File descriptor for semaphore. Must be valid file descriptor.
|
||||
} ze_intel_external_semaphore_desc_fd_exp_desc_t;
|
||||
|
||||
typedef struct _ze_intel_external_semaphore_signal_params_exp_t {
|
||||
ze_structure_type_t stype; ///< [in] type of this structure
|
||||
const void *pNext; ///< [in] must be null or a pointer to an extension-specific
|
||||
///< structure (i.e. contains stype and pNext).
|
||||
uint64_t value; /// [in] [optional] Value to signal the semaphore with
|
||||
} ze_intel_external_semaphore_signal_params_exp_t;
|
||||
|
||||
typedef struct _ze_intel_external_semaphore_wait_params_exp_t {
|
||||
ze_structure_type_t stype; ///< [in] type of this structure
|
||||
const void *pNext; ///< [in] must be null or a pointer to an extension-specific
|
||||
///< structure (i.e. contains stype and pNext).
|
||||
uint64_t value; /// [in] [optional] Value to wait on the semaphore for
|
||||
} ze_intel_external_semaphore_wait_params_exp_t;
|
||||
|
||||
typedef struct _ze_intel_external_semaphore_exp_handle_t *ze_intel_external_semaphore_exp_handle_t;
|
||||
|
||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||
zeIntelDeviceImportExternalSemaphoreExp(
|
||||
ze_device_handle_t device, ///< [in] handle of the device
|
||||
const ze_intel_external_semaphore_exp_desc_t *semaphoreDesc, ///< [in] pointer to external semaphore descriptor
|
||||
ze_intel_external_semaphore_exp_handle_t *phSemaphore ///< [out] pointer to handle of the external semaphore
|
||||
);
|
||||
|
||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||
zeIntelCommandListAppendWaitExternalSemaphoresExp(
|
||||
ze_command_list_handle_t hCmdList, ///< [in] handle of the command list
|
||||
unsigned int numExternalSemaphores, ///< [in] number of external semaphores
|
||||
const ze_intel_external_semaphore_exp_handle_t *phSemaphores, ///< [in] pointer to array of external semaphore handles
|
||||
const ze_intel_external_semaphore_wait_params_exp_t *params, ///< [in] pointer to array of wait parameters
|
||||
ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion
|
||||
uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before continuing
|
||||
ze_event_handle_t *phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handles of the events to wait on before continuing
|
||||
);
|
||||
|
||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||
zeIntelCommandListAppendSignalExternalSemaphoresExp(
|
||||
ze_command_list_handle_t hCmdList, ///< [in] handle of the command list
|
||||
size_t numExternalSemaphores, ///< [in] number of external semaphores
|
||||
const ze_intel_external_semaphore_exp_handle_t *phSemaphores, ///< [in] pointer to array of external semaphore handles
|
||||
const ze_intel_external_semaphore_signal_params_exp_t *params, ///< [in] pointer to array of signal parameters
|
||||
ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion
|
||||
uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before continuing
|
||||
ze_event_handle_t *phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handles of the events to wait on before continuing
|
||||
);
|
||||
|
||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||
zeIntelDeviceReleaseExternalSemaphoreExp(
|
||||
ze_intel_external_semaphore_exp_handle_t hSemaphore ///< [in] handle of the external semaphore
|
||||
);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
@@ -29,11 +29,6 @@
|
||||
#define ZE_STRUCTURE_INTEL_DEVICE_MEMORY_CXL_EXP_PROPERTIES (ze_structure_type_t)0x00030019
|
||||
#define ZEX_STRUCTURE_COUNTER_BASED_EVENT_DESC (ze_structure_type_t)0x0003001C
|
||||
#define ZEX_STRUCTURE_COUNTER_BASED_EVENT_EXTERNAL_SYNC_ALLOC_PROPERTIES (ze_structure_type_t)0x0003001D
|
||||
#define ZE_INTEL_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_EXP_DESC (ze_structure_type_t)0x0003001E
|
||||
#define ZE_INTEL_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_WIN32_EXP_DESC (ze_structure_type_t)0x0003001F
|
||||
#define ZE_INTEL_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_FD_EXP_DESC (ze_structure_type_t)0x00030023
|
||||
#define ZE_INTEL_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_EXP (ze_structure_type_t)0x00030024
|
||||
#define ZE_INTEL_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_WAIT_PARAMS_EXP (ze_structure_type_t)0x00030025
|
||||
#define ZEX_STRUCTURE_COUNTER_BASED_EVENT_EXTERNAL_STORAGE_ALLOC_PROPERTIES (ze_structure_type_t)0x00030027
|
||||
|
||||
// Metric structure types
|
||||
|
||||
Reference in New Issue
Block a user