refactor: correct driver extension header files

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2025-09-11 15:05:47 +00:00
committed by Compute-Runtime-Automation
parent e80b84e699
commit 53fc4c1958
19 changed files with 262 additions and 82 deletions

View File

@@ -19,6 +19,7 @@
// driver experimental API headers
#include "zex_cmdlist.h"
#include "zex_context.h"
#include "zex_driver.h"
#include "zex_event.h"
#include "zex_graph.h"

View File

@@ -1,16 +1,23 @@
/*
* Copyright (C) 2022-2024 Intel Corporation
* Copyright (C) 2022-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#ifndef _ZEX_CMDLIST_H
#define _ZEX_CMDLIST_H
#if defined(__cplusplus)
#pragma once
#endif
#include <level_zero/ze_api.h>
#include "zex_common.h"
namespace L0 {
#if defined(__cplusplus)
extern "C" {
#endif
ZE_APIEXPORT ze_result_t ZE_APICALL
zexCommandListAppendWaitOnMemory(
@@ -34,4 +41,9 @@ zexCommandListAppendWriteToMemory(
zex_write_to_mem_desc_t *desc,
void *ptr,
uint64_t data);
} // namespace L0
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // _ZEX_CMDLIST_H

View File

@@ -1,18 +1,29 @@
/*
* Copyright (C) 2024 Intel Corporation
* Copyright (C) 2024-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#ifndef _ZEX_CONTEXT_H
#define _ZEX_CONTEXT_H
#if defined(__cplusplus)
#pragma once
#endif
#include <level_zero/ze_api.h>
#include "zex_common.h"
namespace L0 {
#if defined(__cplusplus)
extern "C" {
#endif
ZE_APIEXPORT ze_result_t ZE_APICALL zeIntelMediaCommunicationCreate(ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_intel_media_communication_desc_t *desc, ze_intel_media_doorbell_handle_desc_t *phDoorbell);
ZE_APIEXPORT ze_result_t ZE_APICALL zeIntelMediaCommunicationDestroy(ze_context_handle_t hContext, ze_device_handle_t hDevice, ze_intel_media_doorbell_handle_desc_t *phDoorbell);
} // namespace L0
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // _ZEX_CONTEXT_H

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2024 Intel Corporation
* Copyright (C) 2020-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -7,34 +7,39 @@
#ifndef _ZEX_DRIVER_H
#define _ZEX_DRIVER_H
#if defined(__cplusplus)
#pragma once
#endif
#include "zex_api.h"
#include <level_zero/ze_api.h>
namespace L0 {
#if defined(__cplusplus)
extern "C" {
#endif
ze_result_t ZE_APICALL
ZE_APIEXPORT ze_result_t ZE_APICALL
zexDriverImportExternalPointer(
ze_driver_handle_t hDriver, ///< [in] handle of the driver
void *ptr, ///< [in] pointer to be imported to the driver
size_t size ///< [in] size to be imported
);
ze_result_t ZE_APICALL
ZE_APIEXPORT ze_result_t ZE_APICALL
zexDriverReleaseImportedPointer(
ze_driver_handle_t hDriver, ///< [in] handle of the driver
void *ptr ///< [in] pointer to be released from the driver
);
ze_result_t ZE_APICALL
ZE_APIEXPORT ze_result_t ZE_APICALL
zexDriverGetHostPointerBaseAddress(
ze_driver_handle_t hDriver, ///< [in] handle of the driver
void *ptr, ///< [in] pointer to be checked if imported to the driver
void **baseAddress ///< [out] if not null, returns address of the base pointer of the imported pointer
);
} // namespace L0
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // _ZEX_DRIVER_H

View File

@@ -1,16 +1,23 @@
/*
* Copyright (C) 2023-2024 Intel Corporation
* Copyright (C) 2023-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#ifndef _ZEX_EVENT_H
#define _ZEX_EVENT_H
#if defined(__cplusplus)
#pragma once
#endif
#include <level_zero/ze_api.h>
#include "zex_common.h"
namespace L0 {
#if defined(__cplusplus)
extern "C" {
#endif
ZE_APIEXPORT ze_result_t ZE_APICALL
zexEventGetDeviceAddress(
@@ -41,4 +48,8 @@ ZE_APIEXPORT ze_result_t ZE_APICALL zexCounterBasedEventOpenIpcHandle(ze_context
ZE_APIEXPORT ze_result_t ZE_APICALL zexCounterBasedEventCloseIpcHandle(ze_event_handle_t hEvent);
} // namespace L0
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // _ZEX_EVENT_H

View File

@@ -5,7 +5,12 @@
*
*/
#ifndef _ZEX_GRAPH_H
#define _ZEX_GRAPH_H
#if defined(__cplusplus)
#pragma once
#endif
#include <level_zero/ze_api.h>
#include "zex_common.h"
@@ -54,3 +59,4 @@ ZE_APIEXPORT ze_result_t ZE_APICALL zeGraphDumpContentsExp(ze_graph_handle_t hGr
#endif
#endif // ZE_RECORD_REPLAY_GRAPH_EXP_NAME
#endif // _ZEX_GRAPH_H

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2024 Intel Corporation
* Copyright (C) 2020-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -11,7 +11,7 @@
#pragma once
#endif
#include "zex_api.h"
#include <level_zero/ze_api.h>
///////////////////////////////////////////////////////////////////////////////
// It indicates that the application wants the L0 driver implementation to use
@@ -34,7 +34,10 @@ typedef enum _zex_mem_ipc_handles_version_t {
} zex_mem_ipc_handles_version_t;
namespace L0 {
#if defined(__cplusplus)
extern "C" {
#endif
///////////////////////////////////////////////////////////////////////////////
/// @brief Returns an array IPC memory handles for the specified allocation
///
@@ -48,7 +51,7 @@ namespace L0 {
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// + `ptr` not known
ze_result_t ZE_APICALL
ZE_APIEXPORT ze_result_t ZE_APICALL
zexMemGetIpcHandles(
ze_context_handle_t hContext, ///< [in] handle of the context object
const void *ptr, ///< [in] pointer to the device memory allocation
@@ -74,7 +77,7 @@ zexMemGetIpcHandles(
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// + handles not known
ze_result_t ZE_APICALL
ZE_APIEXPORT ze_result_t ZE_APICALL
zexMemOpenIpcHandles(
ze_context_handle_t hContext, ///< [in] handle of the context object
ze_device_handle_t hDevice, ///< [in] handle of the device to associate with the IPC memory handle
@@ -85,6 +88,8 @@ zexMemOpenIpcHandles(
void **pptr ///< [out] pointer to device allocation in this process
);
} // namespace L0
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // _ZEX_MEMORY_H

View File

@@ -11,45 +11,51 @@
#pragma once
#endif
#include "zex_api.h"
namespace L0 {
ze_result_t ZE_APICALL
#include <level_zero/ze_api.h>
#if defined(__cplusplus)
extern "C" {
#endif
ZE_APIEXPORT ze_result_t ZE_APICALL
zexKernelGetBaseAddress(
ze_kernel_handle_t hKernel,
uint64_t *baseAddress);
ze_result_t ZE_APICALL
ZE_APIEXPORT ze_result_t ZE_APICALL
zexKernelGetArgumentSize(
ze_kernel_handle_t hKernel,
uint32_t argIndex,
uint32_t *pArgSize);
ze_result_t ZE_APICALL
ZE_APIEXPORT ze_result_t ZE_APICALL
zexKernelGetArgumentType(
ze_kernel_handle_t hKernel,
uint32_t argIndex,
uint32_t *pSize,
char *pString);
} // namespace L0
#if defined(__cplusplus)
} // extern "C"
#endif
///////////////////////////////////////////////////////////////////////////////
/// @brief General Register File descriptor.
/// Must be passed to zeDeviceGetModuleProperties via pNext member of ze_device_module_properties_t.
typedef struct _zex_device_module_register_file_exp_t {
ze_structure_type_ext_t stype = ZEX_STRUCTURE_DEVICE_MODULE_REGISTER_FILE_EXP; ///< [in] type of this structure
const void *pNext = nullptr; ///< [in, out][optional] pointer to extension-specific structure
uint32_t registerFileSizesCount; ///< [out] Size of array of supported GRF sizes
uint32_t *registerFileSizes = nullptr; ///< [in, out][optional] Array of supported GRF sizes
ze_structure_type_ext_t stype; ///< [in] type of this structure
const void *pNext; ///< [in, out][optional] pointer to extension-specific structure
uint32_t registerFileSizesCount; ///< [out] Size of array of supported GRF sizes
uint32_t *registerFileSizes; ///< [in, out][optional] Array of supported GRF sizes
} zex_device_module_register_file_exp_t;
///////////////////////////////////////////////////////////////////////////////
/// @brief Kernel register file size information
/// Must be passed to zeKernelGetProperties via pNext member of ze_kernel_properties_t
typedef struct _zex_kernel_register_file_size_exp_t {
ze_structure_type_ext_t stype = ZEX_STRUCTURE_KERNEL_REGISTER_FILE_SIZE_EXP; ///< [in] type of this structure
const void *pNext = nullptr; ///< [in, out][optional] pointer to extension-specific structure
uint32_t registerFileSize; ///< [out] Register file size used in kernel
ze_structure_type_ext_t stype; ///< [in] type of this structure
const void *pNext; ///< [in, out][optional] pointer to extension-specific structure
uint32_t registerFileSize; ///< [out] Register file size used in kernel
} zex_kernel_register_file_size_exp_t;
#endif // _ZEX_MODULE_H

View File

@@ -224,10 +224,10 @@ typedef enum _ze_intel_device_block_array_exp_flag_t {
/// @brief Device 2D block array properties
typedef struct _ze_intel_device_block_array_exp_properties_t {
ze_structure_type_ext_t stype = ZE_INTEL_DEVICE_BLOCK_ARRAY_EXP_PROPERTIES; ///< [in] type of this structure
void *pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific
///< structure (i.e. contains sType and pNext).
ze_intel_device_block_array_exp_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_intel_device_block_array_exp_flag_t
ze_structure_type_ext_t stype; ///< [in] type of this structure
void *pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific
///< structure (i.e. contains sType and pNext).
ze_intel_device_block_array_exp_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_intel_device_block_array_exp_flag_t
} ze_intel_device_block_array_exp_properties_t;
///////////////////////////////////////////////////////////////////////////////
@@ -248,7 +248,7 @@ typedef enum _ze_intel_device_block_array_exp_properties_version_t {
/// - Major.Minor.Patch+Optional per semver guidelines https://semver.org/#spec-item-10
/// @returns
/// - ::ZE_RESULT_SUCCESS
ze_result_t ZE_APICALL
ZE_APIEXPORT ze_result_t ZE_APICALL
zeIntelGetDriverVersionString(
ze_driver_handle_t hDriver, ///< [in] Driver handle whose version is being read.
char *pDriverVersion, ///< [in,out] pointer to driver version string.
@@ -279,7 +279,7 @@ typedef enum _ze_intel_kernel_get_binary_exp_version_t {
} ze_intel_kernel_get_binary_exp_version_t;
ze_result_t ZE_APICALL
ZE_APIEXPORT ze_result_t ZE_APICALL
zeIntelKernelGetBinaryExp(
ze_kernel_handle_t hKernel, ///< [in] Kernel handle
size_t *pSize, ///< [in, out] pointer to variable with size of GEN ISA binary