1 /* 2 * 3 * Copyright (C) 2019-2021 Intel Corporation 4 * 5 * SPDX-License-Identifier: MIT 6 * 7 * @file ze_api.h 8 * @version v1.3-r1.3.7 9 * 10 */ 11 #ifndef _ZE_API_H 12 #define _ZE_API_H 13 #if defined(__cplusplus) 14 #pragma once 15 #endif 16 17 // standard headers 18 #include <stdint.h> 19 #include <stddef.h> 20 21 #if defined(__cplusplus) 22 extern "C" { 23 #endif 24 25 // Intel 'oneAPI' Level-Zero API common types 26 #if !defined(__GNUC__) 27 #pragma region common 28 #endif 29 /////////////////////////////////////////////////////////////////////////////// 30 #ifndef ZE_MAKE_VERSION 31 /// @brief Generates generic 'oneAPI' API versions 32 #define ZE_MAKE_VERSION( _major, _minor ) (( _major << 16 )|( _minor & 0x0000ffff)) 33 #endif // ZE_MAKE_VERSION 34 35 /////////////////////////////////////////////////////////////////////////////// 36 #ifndef ZE_MAJOR_VERSION 37 /// @brief Extracts 'oneAPI' API major version 38 #define ZE_MAJOR_VERSION( _ver ) ( _ver >> 16 ) 39 #endif // ZE_MAJOR_VERSION 40 41 /////////////////////////////////////////////////////////////////////////////// 42 #ifndef ZE_MINOR_VERSION 43 /// @brief Extracts 'oneAPI' API minor version 44 #define ZE_MINOR_VERSION( _ver ) ( _ver & 0x0000ffff ) 45 #endif // ZE_MINOR_VERSION 46 47 /////////////////////////////////////////////////////////////////////////////// 48 #ifndef ZE_APICALL 49 #if defined(_WIN32) 50 /// @brief Calling convention for all API functions 51 #define ZE_APICALL __cdecl 52 #else 53 #define ZE_APICALL 54 #endif // defined(_WIN32) 55 #endif // ZE_APICALL 56 57 /////////////////////////////////////////////////////////////////////////////// 58 #ifndef ZE_APIEXPORT 59 #if defined(_WIN32) 60 /// @brief Microsoft-specific dllexport storage-class attribute 61 #define ZE_APIEXPORT __declspec(dllexport) 62 #endif // defined(_WIN32) 63 #endif // ZE_APIEXPORT 64 65 /////////////////////////////////////////////////////////////////////////////// 66 #ifndef ZE_APIEXPORT 67 #if __GNUC__ >= 4 68 /// @brief GCC-specific dllexport storage-class attribute 69 #define ZE_APIEXPORT __attribute__ ((visibility ("default"))) 70 #else 71 #define ZE_APIEXPORT 72 #endif // __GNUC__ >= 4 73 #endif // ZE_APIEXPORT 74 75 /////////////////////////////////////////////////////////////////////////////// 76 #ifndef ZE_DLLEXPORT 77 #if defined(_WIN32) 78 /// @brief Microsoft-specific dllexport storage-class attribute 79 #define ZE_DLLEXPORT __declspec(dllexport) 80 #endif // defined(_WIN32) 81 #endif // ZE_DLLEXPORT 82 83 /////////////////////////////////////////////////////////////////////////////// 84 #ifndef ZE_DLLEXPORT 85 #if __GNUC__ >= 4 86 /// @brief GCC-specific dllexport storage-class attribute 87 #define ZE_DLLEXPORT __attribute__ ((visibility ("default"))) 88 #else 89 #define ZE_DLLEXPORT 90 #endif // __GNUC__ >= 4 91 #endif // ZE_DLLEXPORT 92 93 /////////////////////////////////////////////////////////////////////////////// 94 /// @brief compiler-independent type 95 typedef uint8_t ze_bool_t; 96 97 /////////////////////////////////////////////////////////////////////////////// 98 /// @brief Handle of a driver instance 99 typedef struct _ze_driver_handle_t *ze_driver_handle_t; 100 101 /////////////////////////////////////////////////////////////////////////////// 102 /// @brief Handle of driver's device object 103 typedef struct _ze_device_handle_t *ze_device_handle_t; 104 105 /////////////////////////////////////////////////////////////////////////////// 106 /// @brief Handle of driver's context object 107 typedef struct _ze_context_handle_t *ze_context_handle_t; 108 109 /////////////////////////////////////////////////////////////////////////////// 110 /// @brief Handle of driver's command queue object 111 typedef struct _ze_command_queue_handle_t *ze_command_queue_handle_t; 112 113 /////////////////////////////////////////////////////////////////////////////// 114 /// @brief Handle of driver's command list object 115 typedef struct _ze_command_list_handle_t *ze_command_list_handle_t; 116 117 /////////////////////////////////////////////////////////////////////////////// 118 /// @brief Handle of driver's fence object 119 typedef struct _ze_fence_handle_t *ze_fence_handle_t; 120 121 /////////////////////////////////////////////////////////////////////////////// 122 /// @brief Handle of driver's event pool object 123 typedef struct _ze_event_pool_handle_t *ze_event_pool_handle_t; 124 125 /////////////////////////////////////////////////////////////////////////////// 126 /// @brief Handle of driver's event object 127 typedef struct _ze_event_handle_t *ze_event_handle_t; 128 129 /////////////////////////////////////////////////////////////////////////////// 130 /// @brief Handle of driver's image object 131 typedef struct _ze_image_handle_t *ze_image_handle_t; 132 133 /////////////////////////////////////////////////////////////////////////////// 134 /// @brief Handle of driver's module object 135 typedef struct _ze_module_handle_t *ze_module_handle_t; 136 137 /////////////////////////////////////////////////////////////////////////////// 138 /// @brief Handle of module's build log object 139 typedef struct _ze_module_build_log_handle_t *ze_module_build_log_handle_t; 140 141 /////////////////////////////////////////////////////////////////////////////// 142 /// @brief Handle of driver's kernel object 143 typedef struct _ze_kernel_handle_t *ze_kernel_handle_t; 144 145 /////////////////////////////////////////////////////////////////////////////// 146 /// @brief Handle of driver's sampler object 147 typedef struct _ze_sampler_handle_t *ze_sampler_handle_t; 148 149 /////////////////////////////////////////////////////////////////////////////// 150 /// @brief Handle of physical memory object 151 typedef struct _ze_physical_mem_handle_t *ze_physical_mem_handle_t; 152 153 /////////////////////////////////////////////////////////////////////////////// 154 #ifndef ZE_MAX_IPC_HANDLE_SIZE 155 /// @brief Maximum IPC handle size 156 #define ZE_MAX_IPC_HANDLE_SIZE 64 157 #endif // ZE_MAX_IPC_HANDLE_SIZE 158 159 /////////////////////////////////////////////////////////////////////////////// 160 /// @brief IPC handle to a memory allocation 161 typedef struct _ze_ipc_mem_handle_t 162 { 163 char data[ZE_MAX_IPC_HANDLE_SIZE]; ///< [out] Opaque data representing an IPC handle 164 165 } ze_ipc_mem_handle_t; 166 167 /////////////////////////////////////////////////////////////////////////////// 168 /// @brief IPC handle to a event pool allocation 169 typedef struct _ze_ipc_event_pool_handle_t 170 { 171 char data[ZE_MAX_IPC_HANDLE_SIZE]; ///< [out] Opaque data representing an IPC handle 172 173 } ze_ipc_event_pool_handle_t; 174 175 /////////////////////////////////////////////////////////////////////////////// 176 #ifndef ZE_BIT 177 /// @brief Generic macro for enumerator bit masks 178 #define ZE_BIT( _i ) ( 1 << _i ) 179 #endif // ZE_BIT 180 181 /////////////////////////////////////////////////////////////////////////////// 182 /// @brief Defines Return/Error codes 183 typedef enum _ze_result_t 184 { 185 ZE_RESULT_SUCCESS = 0, ///< [Core] success 186 ZE_RESULT_NOT_READY = 1, ///< [Core] synchronization primitive not signaled 187 ZE_RESULT_ERROR_DEVICE_LOST = 0x70000001, ///< [Core] device hung, reset, was removed, or driver update occurred 188 ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY = 0x70000002,///< [Core] insufficient host memory to satisfy call 189 ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY = 0x70000003, ///< [Core] insufficient device memory to satisfy call 190 ZE_RESULT_ERROR_MODULE_BUILD_FAILURE = 0x70000004, ///< [Core] error occurred when building module, see build log for details 191 ZE_RESULT_ERROR_MODULE_LINK_FAILURE = 0x70000005, ///< [Core] error occurred when linking modules, see build log for details 192 ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET = 0x70000006, ///< [Core] device requires a reset 193 ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE = 0x70000007, ///< [Core] device currently in low power state 194 ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS = 0x70010000, ///< [Sysman] access denied due to permission level 195 ZE_RESULT_ERROR_NOT_AVAILABLE = 0x70010001, ///< [Sysman] resource already in use and simultaneous access not allowed 196 ///< or resource was removed 197 ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE = 0x70020000,///< [Tools] external required dependency is unavailable or missing 198 ZE_RESULT_ERROR_UNINITIALIZED = 0x78000001, ///< [Validation] driver is not initialized 199 ZE_RESULT_ERROR_UNSUPPORTED_VERSION = 0x78000002, ///< [Validation] generic error code for unsupported versions 200 ZE_RESULT_ERROR_UNSUPPORTED_FEATURE = 0x78000003, ///< [Validation] generic error code for unsupported features 201 ZE_RESULT_ERROR_INVALID_ARGUMENT = 0x78000004, ///< [Validation] generic error code for invalid arguments 202 ZE_RESULT_ERROR_INVALID_NULL_HANDLE = 0x78000005, ///< [Validation] handle argument is not valid 203 ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE = 0x78000006, ///< [Validation] object pointed to by handle still in-use by device 204 ZE_RESULT_ERROR_INVALID_NULL_POINTER = 0x78000007, ///< [Validation] pointer argument may not be nullptr 205 ZE_RESULT_ERROR_INVALID_SIZE = 0x78000008, ///< [Validation] size argument is invalid (e.g., must not be zero) 206 ZE_RESULT_ERROR_UNSUPPORTED_SIZE = 0x78000009, ///< [Validation] size argument is not supported by the device (e.g., too 207 ///< large) 208 ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT = 0x7800000a, ///< [Validation] alignment argument is not supported by the device (e.g., 209 ///< too small) 210 ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT = 0x7800000b,///< [Validation] synchronization object in invalid state 211 ZE_RESULT_ERROR_INVALID_ENUMERATION = 0x7800000c, ///< [Validation] enumerator argument is not valid 212 ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION = 0x7800000d, ///< [Validation] enumerator argument is not supported by the device 213 ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT = 0x7800000e, ///< [Validation] image format is not supported by the device 214 ZE_RESULT_ERROR_INVALID_NATIVE_BINARY = 0x7800000f, ///< [Validation] native binary is not supported by the device 215 ZE_RESULT_ERROR_INVALID_GLOBAL_NAME = 0x78000010, ///< [Validation] global variable is not found in the module 216 ZE_RESULT_ERROR_INVALID_KERNEL_NAME = 0x78000011, ///< [Validation] kernel name is not found in the module 217 ZE_RESULT_ERROR_INVALID_FUNCTION_NAME = 0x78000012, ///< [Validation] function name is not found in the module 218 ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION = 0x78000013, ///< [Validation] group size dimension is not valid for the kernel or 219 ///< device 220 ZE_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION = 0x78000014,///< [Validation] global width dimension is not valid for the kernel or 221 ///< device 222 ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX = 0x78000015, ///< [Validation] kernel argument index is not valid for kernel 223 ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE = 0x78000016, ///< [Validation] kernel argument size does not match kernel 224 ZE_RESULT_ERROR_INVALID_KERNEL_ATTRIBUTE_VALUE = 0x78000017,///< [Validation] value of kernel attribute is not valid for the kernel or 225 ///< device 226 ZE_RESULT_ERROR_INVALID_MODULE_UNLINKED = 0x78000018, ///< [Validation] module with imports needs to be linked before kernels can 227 ///< be created from it. 228 ZE_RESULT_ERROR_INVALID_COMMAND_LIST_TYPE = 0x78000019, ///< [Validation] command list type does not match command queue type 229 ZE_RESULT_ERROR_OVERLAPPING_REGIONS = 0x7800001a, ///< [Validation] copy operations do not support overlapping regions of 230 ///< memory 231 ZE_RESULT_ERROR_UNKNOWN = 0x7ffffffe, ///< [Core] unknown or internal error 232 ZE_RESULT_FORCE_UINT32 = 0x7fffffff 233 234 } ze_result_t; 235 236 /////////////////////////////////////////////////////////////////////////////// 237 /// @brief Defines structure types 238 typedef enum _ze_structure_type_t 239 { 240 ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES = 0x1, ///< ::ze_driver_properties_t 241 ZE_STRUCTURE_TYPE_DRIVER_IPC_PROPERTIES = 0x2, ///< ::ze_driver_ipc_properties_t 242 ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES = 0x3, ///< ::ze_device_properties_t 243 ZE_STRUCTURE_TYPE_DEVICE_COMPUTE_PROPERTIES = 0x4, ///< ::ze_device_compute_properties_t 244 ZE_STRUCTURE_TYPE_DEVICE_MODULE_PROPERTIES = 0x5, ///< ::ze_device_module_properties_t 245 ZE_STRUCTURE_TYPE_COMMAND_QUEUE_GROUP_PROPERTIES = 0x6, ///< ::ze_command_queue_group_properties_t 246 ZE_STRUCTURE_TYPE_DEVICE_MEMORY_PROPERTIES = 0x7, ///< ::ze_device_memory_properties_t 247 ZE_STRUCTURE_TYPE_DEVICE_MEMORY_ACCESS_PROPERTIES = 0x8,///< ::ze_device_memory_access_properties_t 248 ZE_STRUCTURE_TYPE_DEVICE_CACHE_PROPERTIES = 0x9,///< ::ze_device_cache_properties_t 249 ZE_STRUCTURE_TYPE_DEVICE_IMAGE_PROPERTIES = 0xa,///< ::ze_device_image_properties_t 250 ZE_STRUCTURE_TYPE_DEVICE_P2P_PROPERTIES = 0xb, ///< ::ze_device_p2p_properties_t 251 ZE_STRUCTURE_TYPE_DEVICE_EXTERNAL_MEMORY_PROPERTIES = 0xc, ///< ::ze_device_external_memory_properties_t 252 ZE_STRUCTURE_TYPE_CONTEXT_DESC = 0xd, ///< ::ze_context_desc_t 253 ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC = 0xe, ///< ::ze_command_queue_desc_t 254 ZE_STRUCTURE_TYPE_COMMAND_LIST_DESC = 0xf, ///< ::ze_command_list_desc_t 255 ZE_STRUCTURE_TYPE_EVENT_POOL_DESC = 0x10, ///< ::ze_event_pool_desc_t 256 ZE_STRUCTURE_TYPE_EVENT_DESC = 0x11, ///< ::ze_event_desc_t 257 ZE_STRUCTURE_TYPE_FENCE_DESC = 0x12, ///< ::ze_fence_desc_t 258 ZE_STRUCTURE_TYPE_IMAGE_DESC = 0x13, ///< ::ze_image_desc_t 259 ZE_STRUCTURE_TYPE_IMAGE_PROPERTIES = 0x14, ///< ::ze_image_properties_t 260 ZE_STRUCTURE_TYPE_DEVICE_MEM_ALLOC_DESC = 0x15, ///< ::ze_device_mem_alloc_desc_t 261 ZE_STRUCTURE_TYPE_HOST_MEM_ALLOC_DESC = 0x16, ///< ::ze_host_mem_alloc_desc_t 262 ZE_STRUCTURE_TYPE_MEMORY_ALLOCATION_PROPERTIES = 0x17, ///< ::ze_memory_allocation_properties_t 263 ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_EXPORT_DESC = 0x18, ///< ::ze_external_memory_export_desc_t 264 ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMPORT_FD = 0x19, ///< ::ze_external_memory_import_fd_t 265 ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_EXPORT_FD = 0x1a, ///< ::ze_external_memory_export_fd_t 266 ZE_STRUCTURE_TYPE_MODULE_DESC = 0x1b, ///< ::ze_module_desc_t 267 ZE_STRUCTURE_TYPE_MODULE_PROPERTIES = 0x1c, ///< ::ze_module_properties_t 268 ZE_STRUCTURE_TYPE_KERNEL_DESC = 0x1d, ///< ::ze_kernel_desc_t 269 ZE_STRUCTURE_TYPE_KERNEL_PROPERTIES = 0x1e, ///< ::ze_kernel_properties_t 270 ZE_STRUCTURE_TYPE_SAMPLER_DESC = 0x1f, ///< ::ze_sampler_desc_t 271 ZE_STRUCTURE_TYPE_PHYSICAL_MEM_DESC = 0x20, ///< ::ze_physical_mem_desc_t 272 ZE_STRUCTURE_TYPE_KERNEL_PREFERRED_GROUP_SIZE_PROPERTIES = 0x21,///< ::ze_kernel_preferred_group_size_properties_t 273 ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMPORT_WIN32 = 0x22, ///< ::ze_external_memory_import_win32_handle_t 274 ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_EXPORT_WIN32 = 0x23, ///< ::ze_external_memory_export_win32_handle_t 275 ZE_STRUCTURE_TYPE_DEVICE_RAYTRACING_EXT_PROPERTIES = 0x00010001,///< ::ze_device_raytracing_ext_properties_t 276 ZE_STRUCTURE_TYPE_RAYTRACING_MEM_ALLOC_EXT_DESC = 0x10002, ///< ::ze_raytracing_mem_alloc_ext_desc_t 277 ZE_STRUCTURE_TYPE_FLOAT_ATOMIC_EXT_PROPERTIES = 0x10003,///< ::ze_float_atomic_ext_properties_t 278 ZE_STRUCTURE_TYPE_CACHE_RESERVATION_EXT_DESC = 0x10004, ///< ::ze_cache_reservation_ext_desc_t 279 ZE_STRUCTURE_TYPE_EU_COUNT_EXT = 0x10005, ///< ::ze_eu_count_ext_t 280 ZE_STRUCTURE_TYPE_SRGB_EXT_DESC = 0x10006, ///< ::ze_srgb_ext_desc_t 281 ZE_STRUCTURE_TYPE_LINKAGE_INSPECTION_EXT_DESC = 0x10007,///< ::ze_linkage_inspection_ext_desc_t 282 ZE_STRUCTURE_TYPE_PCI_EXT_PROPERTIES = 0x10008, ///< ::ze_pci_ext_properties_t 283 ZE_STRUCTURE_TYPE_DRIVER_MEMORY_FREE_EXT_PROPERTIES = 0x10009, ///< ::ze_driver_memory_free_ext_properties_t 284 ZE_STRUCTURE_TYPE_MEMORY_FREE_EXT_DESC = 0x1000a, ///< ::ze_memory_free_ext_desc_t 285 ZE_STRUCTURE_TYPE_MEMORY_COMPRESSION_HINTS_EXT_DESC = 0x1000b, ///< ::ze_memory_compression_hints_ext_desc_t 286 ZE_STRUCTURE_TYPE_IMAGE_ALLOCATION_EXT_PROPERTIES = 0x1000c,///< ::ze_image_allocation_ext_properties_t 287 ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC = 0x00020001, ///< ::ze_relaxed_allocation_limits_exp_desc_t 288 ZE_STRUCTURE_TYPE_MODULE_PROGRAM_EXP_DESC = 0x00020002, ///< ::ze_module_program_exp_desc_t 289 ZE_STRUCTURE_TYPE_SCHEDULING_HINT_EXP_PROPERTIES = 0x00020003, ///< ::ze_scheduling_hint_exp_properties_t 290 ZE_STRUCTURE_TYPE_SCHEDULING_HINT_EXP_DESC = 0x00020004,///< ::ze_scheduling_hint_exp_desc_t 291 ZE_STRUCTURE_TYPE_IMAGE_VIEW_PLANAR_EXP_DESC = 0x00020005, ///< ::ze_image_view_planar_exp_desc_t 292 ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2 = 0x00020006, ///< ::ze_device_properties_t 293 ZE_STRUCTURE_TYPE_IMAGE_MEMORY_EXP_PROPERTIES = 0x00020007, ///< ::ze_image_memory_properties_exp_t 294 ZE_STRUCTURE_TYPE_POWER_SAVING_HINT_EXP_DESC = 0x00020008, ///< ::ze_context_power_saving_hint_exp_desc_t 295 ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff 296 297 } ze_structure_type_t; 298 299 /////////////////////////////////////////////////////////////////////////////// 300 /// @brief External memory type flags 301 typedef uint32_t ze_external_memory_type_flags_t; 302 typedef enum _ze_external_memory_type_flag_t 303 { 304 ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_FD = ZE_BIT(0), ///< an opaque POSIX file descriptor handle 305 ZE_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF = ZE_BIT(1), ///< a file descriptor handle for a Linux dma_buf 306 ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32 = ZE_BIT(2), ///< an NT handle 307 ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32_KMT = ZE_BIT(3), ///< a global share (KMT) handle 308 ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE = ZE_BIT(4), ///< an NT handle referring to a Direct3D 10 or 11 texture resource 309 ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D11_TEXTURE_KMT = ZE_BIT(5), ///< a global share (KMT) handle referring to a Direct3D 10 or 11 texture 310 ///< resource 311 ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_HEAP = ZE_BIT(6),///< an NT handle referring to a Direct3D 12 heap resource 312 ZE_EXTERNAL_MEMORY_TYPE_FLAG_D3D12_RESOURCE = ZE_BIT(7),///< an NT handle referring to a Direct3D 12 committed resource 313 ZE_EXTERNAL_MEMORY_TYPE_FLAG_FORCE_UINT32 = 0x7fffffff 314 315 } ze_external_memory_type_flag_t; 316 317 /////////////////////////////////////////////////////////////////////////////// 318 /// @brief Base for all properties types 319 typedef struct _ze_base_properties_t 320 { 321 ze_structure_type_t stype; ///< [in] type of this structure 322 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 323 ///< structure (i.e. contains sType and pNext). 324 325 } ze_base_properties_t; 326 327 /////////////////////////////////////////////////////////////////////////////// 328 /// @brief Base for all descriptor types 329 typedef struct _ze_base_desc_t 330 { 331 ze_structure_type_t stype; ///< [in] type of this structure 332 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 333 ///< structure (i.e. contains sType and pNext). 334 335 } ze_base_desc_t; 336 337 /////////////////////////////////////////////////////////////////////////////// 338 /// @brief Forces driver to only report devices (and sub-devices) as specified by 339 /// values 340 341 /////////////////////////////////////////////////////////////////////////////// 342 /// @brief Forces driver to report devices from lowest to highest PCI bus ID 343 344 /////////////////////////////////////////////////////////////////////////////// 345 /// @brief Forces all shared allocations into device memory 346 347 /////////////////////////////////////////////////////////////////////////////// 348 /// @brief Forward-declare ze_ipc_mem_handle_t 349 typedef struct _ze_ipc_mem_handle_t ze_ipc_mem_handle_t; 350 351 /////////////////////////////////////////////////////////////////////////////// 352 /// @brief Forward-declare ze_ipc_event_pool_handle_t 353 typedef struct _ze_ipc_event_pool_handle_t ze_ipc_event_pool_handle_t; 354 355 /////////////////////////////////////////////////////////////////////////////// 356 /// @brief Forward-declare ze_base_properties_t 357 typedef struct _ze_base_properties_t ze_base_properties_t; 358 359 /////////////////////////////////////////////////////////////////////////////// 360 /// @brief Forward-declare ze_base_desc_t 361 typedef struct _ze_base_desc_t ze_base_desc_t; 362 363 /////////////////////////////////////////////////////////////////////////////// 364 /// @brief Forward-declare ze_driver_uuid_t 365 typedef struct _ze_driver_uuid_t ze_driver_uuid_t; 366 367 /////////////////////////////////////////////////////////////////////////////// 368 /// @brief Forward-declare ze_driver_properties_t 369 typedef struct _ze_driver_properties_t ze_driver_properties_t; 370 371 /////////////////////////////////////////////////////////////////////////////// 372 /// @brief Forward-declare ze_driver_ipc_properties_t 373 typedef struct _ze_driver_ipc_properties_t ze_driver_ipc_properties_t; 374 375 /////////////////////////////////////////////////////////////////////////////// 376 /// @brief Forward-declare ze_driver_extension_properties_t 377 typedef struct _ze_driver_extension_properties_t ze_driver_extension_properties_t; 378 379 /////////////////////////////////////////////////////////////////////////////// 380 /// @brief Forward-declare ze_device_uuid_t 381 typedef struct _ze_device_uuid_t ze_device_uuid_t; 382 383 /////////////////////////////////////////////////////////////////////////////// 384 /// @brief Forward-declare ze_device_properties_t 385 typedef struct _ze_device_properties_t ze_device_properties_t; 386 387 /////////////////////////////////////////////////////////////////////////////// 388 /// @brief Forward-declare ze_device_thread_t 389 typedef struct _ze_device_thread_t ze_device_thread_t; 390 391 /////////////////////////////////////////////////////////////////////////////// 392 /// @brief Forward-declare ze_device_compute_properties_t 393 typedef struct _ze_device_compute_properties_t ze_device_compute_properties_t; 394 395 /////////////////////////////////////////////////////////////////////////////// 396 /// @brief Forward-declare ze_native_kernel_uuid_t 397 typedef struct _ze_native_kernel_uuid_t ze_native_kernel_uuid_t; 398 399 /////////////////////////////////////////////////////////////////////////////// 400 /// @brief Forward-declare ze_device_module_properties_t 401 typedef struct _ze_device_module_properties_t ze_device_module_properties_t; 402 403 /////////////////////////////////////////////////////////////////////////////// 404 /// @brief Forward-declare ze_command_queue_group_properties_t 405 typedef struct _ze_command_queue_group_properties_t ze_command_queue_group_properties_t; 406 407 /////////////////////////////////////////////////////////////////////////////// 408 /// @brief Forward-declare ze_device_memory_properties_t 409 typedef struct _ze_device_memory_properties_t ze_device_memory_properties_t; 410 411 /////////////////////////////////////////////////////////////////////////////// 412 /// @brief Forward-declare ze_device_memory_access_properties_t 413 typedef struct _ze_device_memory_access_properties_t ze_device_memory_access_properties_t; 414 415 /////////////////////////////////////////////////////////////////////////////// 416 /// @brief Forward-declare ze_device_cache_properties_t 417 typedef struct _ze_device_cache_properties_t ze_device_cache_properties_t; 418 419 /////////////////////////////////////////////////////////////////////////////// 420 /// @brief Forward-declare ze_device_image_properties_t 421 typedef struct _ze_device_image_properties_t ze_device_image_properties_t; 422 423 /////////////////////////////////////////////////////////////////////////////// 424 /// @brief Forward-declare ze_device_external_memory_properties_t 425 typedef struct _ze_device_external_memory_properties_t ze_device_external_memory_properties_t; 426 427 /////////////////////////////////////////////////////////////////////////////// 428 /// @brief Forward-declare ze_device_p2p_properties_t 429 typedef struct _ze_device_p2p_properties_t ze_device_p2p_properties_t; 430 431 /////////////////////////////////////////////////////////////////////////////// 432 /// @brief Forward-declare ze_context_desc_t 433 typedef struct _ze_context_desc_t ze_context_desc_t; 434 435 /////////////////////////////////////////////////////////////////////////////// 436 /// @brief Forward-declare ze_command_queue_desc_t 437 typedef struct _ze_command_queue_desc_t ze_command_queue_desc_t; 438 439 /////////////////////////////////////////////////////////////////////////////// 440 /// @brief Forward-declare ze_command_list_desc_t 441 typedef struct _ze_command_list_desc_t ze_command_list_desc_t; 442 443 /////////////////////////////////////////////////////////////////////////////// 444 /// @brief Forward-declare ze_copy_region_t 445 typedef struct _ze_copy_region_t ze_copy_region_t; 446 447 /////////////////////////////////////////////////////////////////////////////// 448 /// @brief Forward-declare ze_image_region_t 449 typedef struct _ze_image_region_t ze_image_region_t; 450 451 /////////////////////////////////////////////////////////////////////////////// 452 /// @brief Forward-declare ze_event_pool_desc_t 453 typedef struct _ze_event_pool_desc_t ze_event_pool_desc_t; 454 455 /////////////////////////////////////////////////////////////////////////////// 456 /// @brief Forward-declare ze_event_desc_t 457 typedef struct _ze_event_desc_t ze_event_desc_t; 458 459 /////////////////////////////////////////////////////////////////////////////// 460 /// @brief Forward-declare ze_kernel_timestamp_data_t 461 typedef struct _ze_kernel_timestamp_data_t ze_kernel_timestamp_data_t; 462 463 /////////////////////////////////////////////////////////////////////////////// 464 /// @brief Forward-declare ze_kernel_timestamp_result_t 465 typedef struct _ze_kernel_timestamp_result_t ze_kernel_timestamp_result_t; 466 467 /////////////////////////////////////////////////////////////////////////////// 468 /// @brief Forward-declare ze_fence_desc_t 469 typedef struct _ze_fence_desc_t ze_fence_desc_t; 470 471 /////////////////////////////////////////////////////////////////////////////// 472 /// @brief Forward-declare ze_image_format_t 473 typedef struct _ze_image_format_t ze_image_format_t; 474 475 /////////////////////////////////////////////////////////////////////////////// 476 /// @brief Forward-declare ze_image_desc_t 477 typedef struct _ze_image_desc_t ze_image_desc_t; 478 479 /////////////////////////////////////////////////////////////////////////////// 480 /// @brief Forward-declare ze_image_properties_t 481 typedef struct _ze_image_properties_t ze_image_properties_t; 482 483 /////////////////////////////////////////////////////////////////////////////// 484 /// @brief Forward-declare ze_device_mem_alloc_desc_t 485 typedef struct _ze_device_mem_alloc_desc_t ze_device_mem_alloc_desc_t; 486 487 /////////////////////////////////////////////////////////////////////////////// 488 /// @brief Forward-declare ze_host_mem_alloc_desc_t 489 typedef struct _ze_host_mem_alloc_desc_t ze_host_mem_alloc_desc_t; 490 491 /////////////////////////////////////////////////////////////////////////////// 492 /// @brief Forward-declare ze_memory_allocation_properties_t 493 typedef struct _ze_memory_allocation_properties_t ze_memory_allocation_properties_t; 494 495 /////////////////////////////////////////////////////////////////////////////// 496 /// @brief Forward-declare ze_external_memory_export_desc_t 497 typedef struct _ze_external_memory_export_desc_t ze_external_memory_export_desc_t; 498 499 /////////////////////////////////////////////////////////////////////////////// 500 /// @brief Forward-declare ze_external_memory_import_fd_t 501 typedef struct _ze_external_memory_import_fd_t ze_external_memory_import_fd_t; 502 503 /////////////////////////////////////////////////////////////////////////////// 504 /// @brief Forward-declare ze_external_memory_export_fd_t 505 typedef struct _ze_external_memory_export_fd_t ze_external_memory_export_fd_t; 506 507 /////////////////////////////////////////////////////////////////////////////// 508 /// @brief Forward-declare ze_external_memory_import_win32_handle_t 509 typedef struct _ze_external_memory_import_win32_handle_t ze_external_memory_import_win32_handle_t; 510 511 /////////////////////////////////////////////////////////////////////////////// 512 /// @brief Forward-declare ze_external_memory_export_win32_handle_t 513 typedef struct _ze_external_memory_export_win32_handle_t ze_external_memory_export_win32_handle_t; 514 515 /////////////////////////////////////////////////////////////////////////////// 516 /// @brief Forward-declare ze_module_constants_t 517 typedef struct _ze_module_constants_t ze_module_constants_t; 518 519 /////////////////////////////////////////////////////////////////////////////// 520 /// @brief Forward-declare ze_module_desc_t 521 typedef struct _ze_module_desc_t ze_module_desc_t; 522 523 /////////////////////////////////////////////////////////////////////////////// 524 /// @brief Forward-declare ze_module_properties_t 525 typedef struct _ze_module_properties_t ze_module_properties_t; 526 527 /////////////////////////////////////////////////////////////////////////////// 528 /// @brief Forward-declare ze_kernel_desc_t 529 typedef struct _ze_kernel_desc_t ze_kernel_desc_t; 530 531 /////////////////////////////////////////////////////////////////////////////// 532 /// @brief Forward-declare ze_kernel_uuid_t 533 typedef struct _ze_kernel_uuid_t ze_kernel_uuid_t; 534 535 /////////////////////////////////////////////////////////////////////////////// 536 /// @brief Forward-declare ze_kernel_properties_t 537 typedef struct _ze_kernel_properties_t ze_kernel_properties_t; 538 539 /////////////////////////////////////////////////////////////////////////////// 540 /// @brief Forward-declare ze_kernel_preferred_group_size_properties_t 541 typedef struct _ze_kernel_preferred_group_size_properties_t ze_kernel_preferred_group_size_properties_t; 542 543 /////////////////////////////////////////////////////////////////////////////// 544 /// @brief Forward-declare ze_group_count_t 545 typedef struct _ze_group_count_t ze_group_count_t; 546 547 /////////////////////////////////////////////////////////////////////////////// 548 /// @brief Forward-declare ze_module_program_exp_desc_t 549 typedef struct _ze_module_program_exp_desc_t ze_module_program_exp_desc_t; 550 551 /////////////////////////////////////////////////////////////////////////////// 552 /// @brief Forward-declare ze_device_raytracing_ext_properties_t 553 typedef struct _ze_device_raytracing_ext_properties_t ze_device_raytracing_ext_properties_t; 554 555 /////////////////////////////////////////////////////////////////////////////// 556 /// @brief Forward-declare ze_raytracing_mem_alloc_ext_desc_t 557 typedef struct _ze_raytracing_mem_alloc_ext_desc_t ze_raytracing_mem_alloc_ext_desc_t; 558 559 /////////////////////////////////////////////////////////////////////////////// 560 /// @brief Forward-declare ze_sampler_desc_t 561 typedef struct _ze_sampler_desc_t ze_sampler_desc_t; 562 563 /////////////////////////////////////////////////////////////////////////////// 564 /// @brief Forward-declare ze_physical_mem_desc_t 565 typedef struct _ze_physical_mem_desc_t ze_physical_mem_desc_t; 566 567 /////////////////////////////////////////////////////////////////////////////// 568 /// @brief Forward-declare ze_float_atomic_ext_properties_t 569 typedef struct _ze_float_atomic_ext_properties_t ze_float_atomic_ext_properties_t; 570 571 /////////////////////////////////////////////////////////////////////////////// 572 /// @brief Forward-declare ze_relaxed_allocation_limits_exp_desc_t 573 typedef struct _ze_relaxed_allocation_limits_exp_desc_t ze_relaxed_allocation_limits_exp_desc_t; 574 575 /////////////////////////////////////////////////////////////////////////////// 576 /// @brief Forward-declare ze_cache_reservation_ext_desc_t 577 typedef struct _ze_cache_reservation_ext_desc_t ze_cache_reservation_ext_desc_t; 578 579 /////////////////////////////////////////////////////////////////////////////// 580 /// @brief Forward-declare ze_image_memory_properties_exp_t 581 typedef struct _ze_image_memory_properties_exp_t ze_image_memory_properties_exp_t; 582 583 /////////////////////////////////////////////////////////////////////////////// 584 /// @brief Forward-declare ze_image_view_planar_exp_desc_t 585 typedef struct _ze_image_view_planar_exp_desc_t ze_image_view_planar_exp_desc_t; 586 587 /////////////////////////////////////////////////////////////////////////////// 588 /// @brief Forward-declare ze_scheduling_hint_exp_properties_t 589 typedef struct _ze_scheduling_hint_exp_properties_t ze_scheduling_hint_exp_properties_t; 590 591 /////////////////////////////////////////////////////////////////////////////// 592 /// @brief Forward-declare ze_scheduling_hint_exp_desc_t 593 typedef struct _ze_scheduling_hint_exp_desc_t ze_scheduling_hint_exp_desc_t; 594 595 /////////////////////////////////////////////////////////////////////////////// 596 /// @brief Forward-declare ze_context_power_saving_hint_exp_desc_t 597 typedef struct _ze_context_power_saving_hint_exp_desc_t ze_context_power_saving_hint_exp_desc_t; 598 599 /////////////////////////////////////////////////////////////////////////////// 600 /// @brief Forward-declare ze_eu_count_ext_t 601 typedef struct _ze_eu_count_ext_t ze_eu_count_ext_t; 602 603 /////////////////////////////////////////////////////////////////////////////// 604 /// @brief Forward-declare ze_pci_address_ext_t 605 typedef struct _ze_pci_address_ext_t ze_pci_address_ext_t; 606 607 /////////////////////////////////////////////////////////////////////////////// 608 /// @brief Forward-declare ze_pci_speed_ext_t 609 typedef struct _ze_pci_speed_ext_t ze_pci_speed_ext_t; 610 611 /////////////////////////////////////////////////////////////////////////////// 612 /// @brief Forward-declare ze_pci_ext_properties_t 613 typedef struct _ze_pci_ext_properties_t ze_pci_ext_properties_t; 614 615 /////////////////////////////////////////////////////////////////////////////// 616 /// @brief Forward-declare ze_srgb_ext_desc_t 617 typedef struct _ze_srgb_ext_desc_t ze_srgb_ext_desc_t; 618 619 /////////////////////////////////////////////////////////////////////////////// 620 /// @brief Forward-declare ze_image_allocation_ext_properties_t 621 typedef struct _ze_image_allocation_ext_properties_t ze_image_allocation_ext_properties_t; 622 623 /////////////////////////////////////////////////////////////////////////////// 624 /// @brief Forward-declare ze_linkage_inspection_ext_desc_t 625 typedef struct _ze_linkage_inspection_ext_desc_t ze_linkage_inspection_ext_desc_t; 626 627 /////////////////////////////////////////////////////////////////////////////// 628 /// @brief Forward-declare ze_memory_compression_hints_ext_desc_t 629 typedef struct _ze_memory_compression_hints_ext_desc_t ze_memory_compression_hints_ext_desc_t; 630 631 /////////////////////////////////////////////////////////////////////////////// 632 /// @brief Forward-declare ze_driver_memory_free_ext_properties_t 633 typedef struct _ze_driver_memory_free_ext_properties_t ze_driver_memory_free_ext_properties_t; 634 635 /////////////////////////////////////////////////////////////////////////////// 636 /// @brief Forward-declare ze_memory_free_ext_desc_t 637 typedef struct _ze_memory_free_ext_desc_t ze_memory_free_ext_desc_t; 638 639 640 #if !defined(__GNUC__) 641 #pragma endregion 642 #endif 643 // Intel 'oneAPI' Level-Zero APIs 644 #if !defined(__GNUC__) 645 #pragma region driver 646 #endif 647 /////////////////////////////////////////////////////////////////////////////// 648 /// @brief Supported initialization flags 649 typedef uint32_t ze_init_flags_t; 650 typedef enum _ze_init_flag_t 651 { 652 ZE_INIT_FLAG_GPU_ONLY = ZE_BIT(0), ///< only initialize GPU drivers 653 ZE_INIT_FLAG_VPU_ONLY = ZE_BIT(1), ///< only initialize VPU drivers 654 ZE_INIT_FLAG_FORCE_UINT32 = 0x7fffffff 655 656 } ze_init_flag_t; 657 658 /////////////////////////////////////////////////////////////////////////////// 659 /// @brief Initialize the 'oneAPI' driver(s) 660 /// 661 /// @details 662 /// - The application must call this function before calling any other 663 /// function. 664 /// - If this function is not called then all other functions will return 665 /// ::ZE_RESULT_ERROR_UNINITIALIZED. 666 /// - Only one instance of each driver will be initialized per process. 667 /// - The application may call this function multiple times with different 668 /// flags or environment variables enabled. 669 /// - The application must call this function after forking new processes. 670 /// Each forked process must call this function. 671 /// - The application may call this function from simultaneous threads. 672 /// - The implementation of this function must be thread-safe for scenarios 673 /// where multiple libraries may initialize the driver(s) simultaneously. 674 /// 675 /// @returns 676 /// - ::ZE_RESULT_SUCCESS 677 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 678 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 679 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 680 /// + `0x3 < flags` 681 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 682 ZE_APIEXPORT ze_result_t ZE_APICALL 683 zeInit( 684 ze_init_flags_t flags ///< [in] initialization flags. 685 ///< must be 0 (default) or a combination of ::ze_init_flag_t. 686 ); 687 688 /////////////////////////////////////////////////////////////////////////////// 689 /// @brief Retrieves driver instances 690 /// 691 /// @details 692 /// - A driver represents a collection of physical devices. 693 /// - Multiple calls to this function will return identical driver handles, 694 /// in the same order. 695 /// - The application may pass nullptr for pDrivers when only querying the 696 /// number of drivers. 697 /// - The application may call this function from simultaneous threads. 698 /// - The implementation of this function should be lock-free. 699 /// 700 /// @remarks 701 /// _Analogues_ 702 /// - clGetPlatformIDs 703 /// 704 /// @returns 705 /// - ::ZE_RESULT_SUCCESS 706 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 707 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 708 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 709 /// + `nullptr == pCount` 710 ZE_APIEXPORT ze_result_t ZE_APICALL 711 zeDriverGet( 712 uint32_t* pCount, ///< [in,out] pointer to the number of driver instances. 713 ///< if count is zero, then the loader shall update the value with the 714 ///< total number of drivers available. 715 ///< if count is greater than the number of drivers available, then the 716 ///< loader shall update the value with the correct number of drivers available. 717 ze_driver_handle_t* phDrivers ///< [in,out][optional][range(0, *pCount)] array of driver instance handles. 718 ///< if count is less than the number of drivers available, then the loader 719 ///< shall only retrieve that number of drivers. 720 ); 721 722 /////////////////////////////////////////////////////////////////////////////// 723 /// @brief Supported API versions 724 /// 725 /// @details 726 /// - API versions contain major and minor attributes, use 727 /// ::ZE_MAJOR_VERSION and ::ZE_MINOR_VERSION 728 typedef enum _ze_api_version_t 729 { 730 ZE_API_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 731 ZE_API_VERSION_1_1 = ZE_MAKE_VERSION( 1, 1 ), ///< version 1.1 732 ZE_API_VERSION_1_2 = ZE_MAKE_VERSION( 1, 2 ), ///< version 1.2 733 ZE_API_VERSION_1_3 = ZE_MAKE_VERSION( 1, 3 ), ///< version 1.3 734 ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 3 ), ///< latest known version 735 ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff 736 737 } ze_api_version_t; 738 739 /////////////////////////////////////////////////////////////////////////////// 740 /// @brief Returns the API version supported by the specified driver 741 /// 742 /// @details 743 /// - The application may call this function from simultaneous threads. 744 /// - The implementation of this function should be lock-free. 745 /// 746 /// @returns 747 /// - ::ZE_RESULT_SUCCESS 748 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 749 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 750 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 751 /// + `nullptr == hDriver` 752 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 753 /// + `nullptr == version` 754 ZE_APIEXPORT ze_result_t ZE_APICALL 755 zeDriverGetApiVersion( 756 ze_driver_handle_t hDriver, ///< [in] handle of the driver instance 757 ze_api_version_t* version ///< [out] api version 758 ); 759 760 /////////////////////////////////////////////////////////////////////////////// 761 #ifndef ZE_MAX_DRIVER_UUID_SIZE 762 /// @brief Maximum driver universal unique id (UUID) size in bytes 763 #define ZE_MAX_DRIVER_UUID_SIZE 16 764 #endif // ZE_MAX_DRIVER_UUID_SIZE 765 766 /////////////////////////////////////////////////////////////////////////////// 767 /// @brief Driver universal unique id (UUID) 768 typedef struct _ze_driver_uuid_t 769 { 770 uint8_t id[ZE_MAX_DRIVER_UUID_SIZE]; ///< [out] opaque data representing a driver UUID 771 772 } ze_driver_uuid_t; 773 774 /////////////////////////////////////////////////////////////////////////////// 775 /// @brief Driver properties queried using ::zeDriverGetProperties 776 typedef struct _ze_driver_properties_t 777 { 778 ze_structure_type_t stype; ///< [in] type of this structure 779 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 780 ///< structure (i.e. contains sType and pNext). 781 ze_driver_uuid_t uuid; ///< [out] universal unique identifier. 782 uint32_t driverVersion; ///< [out] driver version 783 ///< The driver version is a non-zero, monotonically increasing value where 784 ///< higher values always indicate a more recent version. 785 786 } ze_driver_properties_t; 787 788 /////////////////////////////////////////////////////////////////////////////// 789 /// @brief Retrieves properties of the driver. 790 /// 791 /// @details 792 /// - The application may call this function from simultaneous threads. 793 /// - The implementation of this function should be lock-free. 794 /// 795 /// @remarks 796 /// _Analogues_ 797 /// - **clGetPlatformInfo** 798 /// 799 /// @returns 800 /// - ::ZE_RESULT_SUCCESS 801 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 802 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 803 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 804 /// + `nullptr == hDriver` 805 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 806 /// + `nullptr == pDriverProperties` 807 ZE_APIEXPORT ze_result_t ZE_APICALL 808 zeDriverGetProperties( 809 ze_driver_handle_t hDriver, ///< [in] handle of the driver instance 810 ze_driver_properties_t* pDriverProperties ///< [in,out] query result for driver properties 811 ); 812 813 /////////////////////////////////////////////////////////////////////////////// 814 /// @brief Supported IPC property flags 815 typedef uint32_t ze_ipc_property_flags_t; 816 typedef enum _ze_ipc_property_flag_t 817 { 818 ZE_IPC_PROPERTY_FLAG_MEMORY = ZE_BIT(0), ///< Supports passing memory allocations between processes. See 819 ///< ::zeMemGetIpcHandle. 820 ZE_IPC_PROPERTY_FLAG_EVENT_POOL = ZE_BIT(1), ///< Supports passing event pools between processes. See 821 ///< ::zeEventPoolGetIpcHandle. 822 ZE_IPC_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff 823 824 } ze_ipc_property_flag_t; 825 826 /////////////////////////////////////////////////////////////////////////////// 827 /// @brief IPC properties queried using ::zeDriverGetIpcProperties 828 typedef struct _ze_driver_ipc_properties_t 829 { 830 ze_structure_type_t stype; ///< [in] type of this structure 831 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 832 ///< structure (i.e. contains sType and pNext). 833 ze_ipc_property_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_ipc_property_flag_t 834 835 } ze_driver_ipc_properties_t; 836 837 /////////////////////////////////////////////////////////////////////////////// 838 /// @brief Retrieves IPC attributes of the driver 839 /// 840 /// @details 841 /// - The application may call this function from simultaneous threads. 842 /// - The implementation of this function should be lock-free. 843 /// 844 /// @returns 845 /// - ::ZE_RESULT_SUCCESS 846 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 847 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 848 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 849 /// + `nullptr == hDriver` 850 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 851 /// + `nullptr == pIpcProperties` 852 ZE_APIEXPORT ze_result_t ZE_APICALL 853 zeDriverGetIpcProperties( 854 ze_driver_handle_t hDriver, ///< [in] handle of the driver instance 855 ze_driver_ipc_properties_t* pIpcProperties ///< [in,out] query result for IPC properties 856 ); 857 858 /////////////////////////////////////////////////////////////////////////////// 859 #ifndef ZE_MAX_EXTENSION_NAME 860 /// @brief Maximum extension name string size 861 #define ZE_MAX_EXTENSION_NAME 256 862 #endif // ZE_MAX_EXTENSION_NAME 863 864 /////////////////////////////////////////////////////////////////////////////// 865 /// @brief Extension properties queried using ::zeDriverGetExtensionProperties 866 typedef struct _ze_driver_extension_properties_t 867 { 868 char name[ZE_MAX_EXTENSION_NAME]; ///< [out] extension name 869 uint32_t version; ///< [out] extension version using ::ZE_MAKE_VERSION 870 871 } ze_driver_extension_properties_t; 872 873 /////////////////////////////////////////////////////////////////////////////// 874 /// @brief Retrieves extension properties 875 /// 876 /// @details 877 /// - The application may call this function from simultaneous threads. 878 /// - The implementation of this function should be lock-free. 879 /// 880 /// @remarks 881 /// _Analogues_ 882 /// - **vkEnumerateInstanceExtensionProperties** 883 /// 884 /// @returns 885 /// - ::ZE_RESULT_SUCCESS 886 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 887 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 888 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 889 /// + `nullptr == hDriver` 890 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 891 /// + `nullptr == pCount` 892 ZE_APIEXPORT ze_result_t ZE_APICALL 893 zeDriverGetExtensionProperties( 894 ze_driver_handle_t hDriver, ///< [in] handle of the driver instance 895 uint32_t* pCount, ///< [in,out] pointer to the number of extension properties. 896 ///< if count is zero, then the driver shall update the value with the 897 ///< total number of extension properties available. 898 ///< if count is greater than the number of extension properties available, 899 ///< then the driver shall update the value with the correct number of 900 ///< extension properties available. 901 ze_driver_extension_properties_t* pExtensionProperties ///< [in,out][optional][range(0, *pCount)] array of query results for 902 ///< extension properties. 903 ///< if count is less than the number of extension properties available, 904 ///< then driver shall only retrieve that number of extension properties. 905 ); 906 907 /////////////////////////////////////////////////////////////////////////////// 908 /// @brief Retrieves function pointer for vendor-specific or experimental 909 /// extensions 910 /// 911 /// @details 912 /// - The application may call this function from simultaneous threads. 913 /// - The implementation of this function should be lock-free. 914 /// 915 /// @returns 916 /// - ::ZE_RESULT_SUCCESS 917 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 918 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 919 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 920 /// + `nullptr == hDriver` 921 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 922 /// + `nullptr == name` 923 /// + `nullptr == ppFunctionAddress` 924 ZE_APIEXPORT ze_result_t ZE_APICALL 925 zeDriverGetExtensionFunctionAddress( 926 ze_driver_handle_t hDriver, ///< [in] handle of the driver instance 927 const char* name, ///< [in] extension function name 928 void** ppFunctionAddress ///< [out] pointer to function pointer 929 ); 930 931 #if !defined(__GNUC__) 932 #pragma endregion 933 #endif 934 // Intel 'oneAPI' Level-Zero APIs for Device 935 #if !defined(__GNUC__) 936 #pragma region device 937 #endif 938 /////////////////////////////////////////////////////////////////////////////// 939 /// @brief Retrieves devices within a driver 940 /// 941 /// @details 942 /// - Multiple calls to this function will return identical device handles, 943 /// in the same order. 944 /// - The number and order of handles returned from this function is 945 /// affected by the ::ZE_AFFINITY_MASK and ::ZE_ENABLE_PCI_ID_DEVICE_ORDER 946 /// environment variables. 947 /// - The application may call this function from simultaneous threads. 948 /// - The implementation of this function should be lock-free. 949 /// 950 /// @returns 951 /// - ::ZE_RESULT_SUCCESS 952 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 953 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 954 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 955 /// + `nullptr == hDriver` 956 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 957 /// + `nullptr == pCount` 958 ZE_APIEXPORT ze_result_t ZE_APICALL 959 zeDeviceGet( 960 ze_driver_handle_t hDriver, ///< [in] handle of the driver instance 961 uint32_t* pCount, ///< [in,out] pointer to the number of devices. 962 ///< if count is zero, then the driver shall update the value with the 963 ///< total number of devices available. 964 ///< if count is greater than the number of devices available, then the 965 ///< driver shall update the value with the correct number of devices available. 966 ze_device_handle_t* phDevices ///< [in,out][optional][range(0, *pCount)] array of handle of devices. 967 ///< if count is less than the number of devices available, then driver 968 ///< shall only retrieve that number of devices. 969 ); 970 971 /////////////////////////////////////////////////////////////////////////////// 972 /// @brief Retrieves a sub-device from a device 973 /// 974 /// @details 975 /// - Multiple calls to this function will return identical device handles, 976 /// in the same order. 977 /// - The number of handles returned from this function is affected by the 978 /// ::ZE_AFFINITY_MASK environment variable. 979 /// - The application may call this function from simultaneous threads. 980 /// - The implementation of this function should be lock-free. 981 /// 982 /// @remarks 983 /// _Analogues_ 984 /// - clCreateSubDevices 985 /// 986 /// @returns 987 /// - ::ZE_RESULT_SUCCESS 988 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 989 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 990 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 991 /// + `nullptr == hDevice` 992 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 993 /// + `nullptr == pCount` 994 ZE_APIEXPORT ze_result_t ZE_APICALL 995 zeDeviceGetSubDevices( 996 ze_device_handle_t hDevice, ///< [in] handle of the device object 997 uint32_t* pCount, ///< [in,out] pointer to the number of sub-devices. 998 ///< if count is zero, then the driver shall update the value with the 999 ///< total number of sub-devices available. 1000 ///< if count is greater than the number of sub-devices available, then the 1001 ///< driver shall update the value with the correct number of sub-devices available. 1002 ze_device_handle_t* phSubdevices ///< [in,out][optional][range(0, *pCount)] array of handle of sub-devices. 1003 ///< if count is less than the number of sub-devices available, then driver 1004 ///< shall only retrieve that number of sub-devices. 1005 ); 1006 1007 /////////////////////////////////////////////////////////////////////////////// 1008 /// @brief Supported device types 1009 typedef enum _ze_device_type_t 1010 { 1011 ZE_DEVICE_TYPE_GPU = 1, ///< Graphics Processing Unit 1012 ZE_DEVICE_TYPE_CPU = 2, ///< Central Processing Unit 1013 ZE_DEVICE_TYPE_FPGA = 3, ///< Field Programmable Gate Array 1014 ZE_DEVICE_TYPE_MCA = 4, ///< Memory Copy Accelerator 1015 ZE_DEVICE_TYPE_VPU = 5, ///< Vision Processing Unit 1016 ZE_DEVICE_TYPE_FORCE_UINT32 = 0x7fffffff 1017 1018 } ze_device_type_t; 1019 1020 /////////////////////////////////////////////////////////////////////////////// 1021 #ifndef ZE_MAX_DEVICE_UUID_SIZE 1022 /// @brief Maximum device universal unique id (UUID) size in bytes 1023 #define ZE_MAX_DEVICE_UUID_SIZE 16 1024 #endif // ZE_MAX_DEVICE_UUID_SIZE 1025 1026 /////////////////////////////////////////////////////////////////////////////// 1027 /// @brief Device universal unique id (UUID) 1028 typedef struct _ze_device_uuid_t 1029 { 1030 uint8_t id[ZE_MAX_DEVICE_UUID_SIZE]; ///< [out] opaque data representing a device UUID 1031 1032 } ze_device_uuid_t; 1033 1034 /////////////////////////////////////////////////////////////////////////////// 1035 #ifndef ZE_MAX_DEVICE_NAME 1036 /// @brief Maximum device name string size 1037 #define ZE_MAX_DEVICE_NAME 256 1038 #endif // ZE_MAX_DEVICE_NAME 1039 1040 /////////////////////////////////////////////////////////////////////////////// 1041 /// @brief Supported device property flags 1042 typedef uint32_t ze_device_property_flags_t; 1043 typedef enum _ze_device_property_flag_t 1044 { 1045 ZE_DEVICE_PROPERTY_FLAG_INTEGRATED = ZE_BIT(0), ///< Device is integrated with the Host. 1046 ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE = ZE_BIT(1), ///< Device handle used for query represents a sub-device. 1047 ZE_DEVICE_PROPERTY_FLAG_ECC = ZE_BIT(2), ///< Device supports error correction memory access. 1048 ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING = ZE_BIT(3), ///< Device supports on-demand page-faulting. 1049 ZE_DEVICE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff 1050 1051 } ze_device_property_flag_t; 1052 1053 /////////////////////////////////////////////////////////////////////////////// 1054 /// @brief Device properties queried using ::zeDeviceGetProperties 1055 typedef struct _ze_device_properties_t 1056 { 1057 ze_structure_type_t stype; ///< [in] type of this structure 1058 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 1059 ///< structure (i.e. contains sType and pNext). 1060 ze_device_type_t type; ///< [out] generic device type 1061 uint32_t vendorId; ///< [out] vendor id from PCI configuration 1062 uint32_t deviceId; ///< [out] device id from PCI configuration 1063 ze_device_property_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_device_property_flag_t 1064 uint32_t subdeviceId; ///< [out] sub-device id. Only valid if ::ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE 1065 ///< is set. 1066 uint32_t coreClockRate; ///< [out] Clock rate for device core. 1067 uint64_t maxMemAllocSize; ///< [out] Maximum memory allocation size. 1068 uint32_t maxHardwareContexts; ///< [out] Maximum number of logical hardware contexts. 1069 uint32_t maxCommandQueuePriority; ///< [out] Maximum priority for command queues. Higher value is higher 1070 ///< priority. 1071 uint32_t numThreadsPerEU; ///< [out] Maximum number of threads per EU. 1072 uint32_t physicalEUSimdWidth; ///< [out] The physical EU simd width. 1073 uint32_t numEUsPerSubslice; ///< [out] Maximum number of EUs per sub-slice. 1074 uint32_t numSubslicesPerSlice; ///< [out] Maximum number of sub-slices per slice. 1075 uint32_t numSlices; ///< [out] Maximum number of slices. 1076 uint64_t timerResolution; ///< [out] Returns the resolution of device timer used for profiling, 1077 ///< timestamps, etc. When stype==::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES the 1078 ///< units are in nanoseconds. When 1079 ///< stype==::ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES_1_2 units are in 1080 ///< cycles/sec 1081 uint32_t timestampValidBits; ///< [out] Returns the number of valid bits in the timestamp value. 1082 uint32_t kernelTimestampValidBits; ///< [out] Returns the number of valid bits in the kernel timestamp values 1083 ze_device_uuid_t uuid; ///< [out] universal unique identifier. Note: Subdevices will have their 1084 ///< own uuid. 1085 char name[ZE_MAX_DEVICE_NAME]; ///< [out] Device name 1086 1087 } ze_device_properties_t; 1088 1089 /////////////////////////////////////////////////////////////////////////////// 1090 /// @brief Device thread identifier. 1091 typedef struct _ze_device_thread_t 1092 { 1093 uint32_t slice; ///< [in,out] the slice number. 1094 ///< Must be UINT32_MAX (all) or less than ::ze_device_properties_t.numSlices. 1095 uint32_t subslice; ///< [in,out] the sub-slice number within its slice. 1096 ///< Must be UINT32_MAX (all) or less than ::ze_device_properties_t.numSubslicesPerSlice. 1097 uint32_t eu; ///< [in,out] the EU number within its sub-slice. 1098 ///< Must be UINT32_MAX (all) or less than ::ze_device_properties_t.numEUsPerSubslice. 1099 uint32_t thread; ///< [in,out] the thread number within its EU. 1100 ///< Must be UINT32_MAX (all) or less than ::ze_device_properties_t.numThreadsPerEU. 1101 1102 } ze_device_thread_t; 1103 1104 /////////////////////////////////////////////////////////////////////////////// 1105 /// @brief Retrieves properties of the device. 1106 /// 1107 /// @details 1108 /// - The application may call this function from simultaneous threads. 1109 /// - The implementation of this function should be lock-free. 1110 /// 1111 /// @remarks 1112 /// _Analogues_ 1113 /// - clGetDeviceInfo 1114 /// 1115 /// @returns 1116 /// - ::ZE_RESULT_SUCCESS 1117 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1118 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1119 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1120 /// + `nullptr == hDevice` 1121 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1122 /// + `nullptr == pDeviceProperties` 1123 ZE_APIEXPORT ze_result_t ZE_APICALL 1124 zeDeviceGetProperties( 1125 ze_device_handle_t hDevice, ///< [in] handle of the device 1126 ze_device_properties_t* pDeviceProperties ///< [in,out] query result for device properties 1127 ); 1128 1129 /////////////////////////////////////////////////////////////////////////////// 1130 #ifndef ZE_SUBGROUPSIZE_COUNT 1131 /// @brief Maximum number of subgroup sizes supported. 1132 #define ZE_SUBGROUPSIZE_COUNT 8 1133 #endif // ZE_SUBGROUPSIZE_COUNT 1134 1135 /////////////////////////////////////////////////////////////////////////////// 1136 /// @brief Device compute properties queried using ::zeDeviceGetComputeProperties 1137 typedef struct _ze_device_compute_properties_t 1138 { 1139 ze_structure_type_t stype; ///< [in] type of this structure 1140 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 1141 ///< structure (i.e. contains sType and pNext). 1142 uint32_t maxTotalGroupSize; ///< [out] Maximum items per compute group. (groupSizeX * groupSizeY * 1143 ///< groupSizeZ) <= maxTotalGroupSize 1144 uint32_t maxGroupSizeX; ///< [out] Maximum items for X dimension in group 1145 uint32_t maxGroupSizeY; ///< [out] Maximum items for Y dimension in group 1146 uint32_t maxGroupSizeZ; ///< [out] Maximum items for Z dimension in group 1147 uint32_t maxGroupCountX; ///< [out] Maximum groups that can be launched for x dimension 1148 uint32_t maxGroupCountY; ///< [out] Maximum groups that can be launched for y dimension 1149 uint32_t maxGroupCountZ; ///< [out] Maximum groups that can be launched for z dimension 1150 uint32_t maxSharedLocalMemory; ///< [out] Maximum shared local memory per group. 1151 uint32_t numSubGroupSizes; ///< [out] Number of subgroup sizes supported. This indicates number of 1152 ///< entries in subGroupSizes. 1153 uint32_t subGroupSizes[ZE_SUBGROUPSIZE_COUNT]; ///< [out] Size group sizes supported. 1154 1155 } ze_device_compute_properties_t; 1156 1157 /////////////////////////////////////////////////////////////////////////////// 1158 /// @brief Retrieves compute properties of the device. 1159 /// 1160 /// @details 1161 /// - The application may call this function from simultaneous threads. 1162 /// - The implementation of this function should be lock-free. 1163 /// 1164 /// @remarks 1165 /// _Analogues_ 1166 /// - clGetDeviceInfo 1167 /// 1168 /// @returns 1169 /// - ::ZE_RESULT_SUCCESS 1170 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1171 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1172 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1173 /// + `nullptr == hDevice` 1174 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1175 /// + `nullptr == pComputeProperties` 1176 ZE_APIEXPORT ze_result_t ZE_APICALL 1177 zeDeviceGetComputeProperties( 1178 ze_device_handle_t hDevice, ///< [in] handle of the device 1179 ze_device_compute_properties_t* pComputeProperties ///< [in,out] query result for compute properties 1180 ); 1181 1182 /////////////////////////////////////////////////////////////////////////////// 1183 #ifndef ZE_MAX_NATIVE_KERNEL_UUID_SIZE 1184 /// @brief Maximum native kernel universal unique id (UUID) size in bytes 1185 #define ZE_MAX_NATIVE_KERNEL_UUID_SIZE 16 1186 #endif // ZE_MAX_NATIVE_KERNEL_UUID_SIZE 1187 1188 /////////////////////////////////////////////////////////////////////////////// 1189 /// @brief Native kernel universal unique id (UUID) 1190 typedef struct _ze_native_kernel_uuid_t 1191 { 1192 uint8_t id[ZE_MAX_NATIVE_KERNEL_UUID_SIZE]; ///< [out] opaque data representing a native kernel UUID 1193 1194 } ze_native_kernel_uuid_t; 1195 1196 /////////////////////////////////////////////////////////////////////////////// 1197 /// @brief Supported device module flags 1198 typedef uint32_t ze_device_module_flags_t; 1199 typedef enum _ze_device_module_flag_t 1200 { 1201 ZE_DEVICE_MODULE_FLAG_FP16 = ZE_BIT(0), ///< Device supports 16-bit floating-point operations 1202 ZE_DEVICE_MODULE_FLAG_FP64 = ZE_BIT(1), ///< Device supports 64-bit floating-point operations 1203 ZE_DEVICE_MODULE_FLAG_INT64_ATOMICS = ZE_BIT(2),///< Device supports 64-bit atomic operations 1204 ZE_DEVICE_MODULE_FLAG_DP4A = ZE_BIT(3), ///< Device supports four component dot product and accumulate operations 1205 ZE_DEVICE_MODULE_FLAG_FORCE_UINT32 = 0x7fffffff 1206 1207 } ze_device_module_flag_t; 1208 1209 /////////////////////////////////////////////////////////////////////////////// 1210 /// @brief Supported floating-Point capability flags 1211 typedef uint32_t ze_device_fp_flags_t; 1212 typedef enum _ze_device_fp_flag_t 1213 { 1214 ZE_DEVICE_FP_FLAG_DENORM = ZE_BIT(0), ///< Supports denorms 1215 ZE_DEVICE_FP_FLAG_INF_NAN = ZE_BIT(1), ///< Supports INF and quiet NaNs 1216 ZE_DEVICE_FP_FLAG_ROUND_TO_NEAREST = ZE_BIT(2), ///< Supports rounding to nearest even rounding mode 1217 ZE_DEVICE_FP_FLAG_ROUND_TO_ZERO = ZE_BIT(3), ///< Supports rounding to zero. 1218 ZE_DEVICE_FP_FLAG_ROUND_TO_INF = ZE_BIT(4), ///< Supports rounding to both positive and negative INF. 1219 ZE_DEVICE_FP_FLAG_FMA = ZE_BIT(5), ///< Supports IEEE754-2008 fused multiply-add. 1220 ZE_DEVICE_FP_FLAG_ROUNDED_DIVIDE_SQRT = ZE_BIT(6), ///< Supports rounding as defined by IEEE754 for divide and sqrt 1221 ///< operations. 1222 ZE_DEVICE_FP_FLAG_SOFT_FLOAT = ZE_BIT(7), ///< Uses software implementation for basic floating-point operations. 1223 ZE_DEVICE_FP_FLAG_FORCE_UINT32 = 0x7fffffff 1224 1225 } ze_device_fp_flag_t; 1226 1227 /////////////////////////////////////////////////////////////////////////////// 1228 /// @brief Device module properties queried using ::zeDeviceGetModuleProperties 1229 typedef struct _ze_device_module_properties_t 1230 { 1231 ze_structure_type_t stype; ///< [in] type of this structure 1232 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 1233 ///< structure (i.e. contains sType and pNext). 1234 uint32_t spirvVersionSupported; ///< [out] Maximum supported SPIR-V version. 1235 ///< Returns zero if SPIR-V is not supported. 1236 ///< Contains major and minor attributes, use ::ZE_MAJOR_VERSION and ::ZE_MINOR_VERSION. 1237 ze_device_module_flags_t flags; ///< [out] 0 or a valid combination of ::ze_device_module_flag_t 1238 ze_device_fp_flags_t fp16flags; ///< [out] Capabilities for half-precision floating-point operations. 1239 ///< returns 0 (if ::ZE_DEVICE_MODULE_FLAG_FP16 is not set) or a 1240 ///< combination of ::ze_device_fp_flag_t. 1241 ze_device_fp_flags_t fp32flags; ///< [out] Capabilities for single-precision floating-point operations. 1242 ///< returns a combination of ::ze_device_fp_flag_t. 1243 ze_device_fp_flags_t fp64flags; ///< [out] Capabilities for double-precision floating-point operations. 1244 ///< returns 0 (if ::ZE_DEVICE_MODULE_FLAG_FP64 is not set) or a 1245 ///< combination of ::ze_device_fp_flag_t. 1246 uint32_t maxArgumentsSize; ///< [out] Maximum kernel argument size that is supported. 1247 uint32_t printfBufferSize; ///< [out] Maximum size of internal buffer that holds output of printf 1248 ///< calls from kernel. 1249 ze_native_kernel_uuid_t nativeKernelSupported; ///< [out] Compatibility UUID of supported native kernel. 1250 ///< UUID may or may not be the same across driver release, devices, or 1251 ///< operating systems. 1252 ///< Application is responsible for ensuring UUID matches before creating 1253 ///< module using 1254 ///< previously created native kernel. 1255 1256 } ze_device_module_properties_t; 1257 1258 /////////////////////////////////////////////////////////////////////////////// 1259 /// @brief Retrieves module properties of the device 1260 /// 1261 /// @details 1262 /// - The application may call this function from simultaneous threads. 1263 /// - The implementation of this function should be lock-free. 1264 /// 1265 /// @returns 1266 /// - ::ZE_RESULT_SUCCESS 1267 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1268 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1269 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1270 /// + `nullptr == hDevice` 1271 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1272 /// + `nullptr == pModuleProperties` 1273 ZE_APIEXPORT ze_result_t ZE_APICALL 1274 zeDeviceGetModuleProperties( 1275 ze_device_handle_t hDevice, ///< [in] handle of the device 1276 ze_device_module_properties_t* pModuleProperties///< [in,out] query result for module properties 1277 ); 1278 1279 /////////////////////////////////////////////////////////////////////////////// 1280 /// @brief Supported command queue group property flags 1281 typedef uint32_t ze_command_queue_group_property_flags_t; 1282 typedef enum _ze_command_queue_group_property_flag_t 1283 { 1284 ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE = ZE_BIT(0), ///< Command queue group supports enqueing compute commands. 1285 ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY = ZE_BIT(1), ///< Command queue group supports enqueing copy commands. 1286 ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS = ZE_BIT(2), ///< Command queue group supports cooperative kernels. 1287 ///< See ::zeCommandListAppendLaunchCooperativeKernel for more details. 1288 ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS = ZE_BIT(3), ///< Command queue groups supports metric queries. 1289 ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff 1290 1291 } ze_command_queue_group_property_flag_t; 1292 1293 /////////////////////////////////////////////////////////////////////////////// 1294 /// @brief Command queue group properties queried using 1295 /// ::zeDeviceGetCommandQueueGroupProperties 1296 typedef struct _ze_command_queue_group_properties_t 1297 { 1298 ze_structure_type_t stype; ///< [in] type of this structure 1299 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 1300 ///< structure (i.e. contains sType and pNext). 1301 ze_command_queue_group_property_flags_t flags; ///< [out] 0 (none) or a valid combination of 1302 ///< ::ze_command_queue_group_property_flag_t 1303 size_t maxMemoryFillPatternSize; ///< [out] maximum `pattern_size` supported by command queue group. 1304 ///< See ::zeCommandListAppendMemoryFill for more details. 1305 uint32_t numQueues; ///< [out] the number of physical engines within the group. 1306 1307 } ze_command_queue_group_properties_t; 1308 1309 /////////////////////////////////////////////////////////////////////////////// 1310 /// @brief Retrieves command queue group properties of the device. 1311 /// 1312 /// @details 1313 /// - Properties are reported for each physical command queue type supported 1314 /// by the device. 1315 /// - Multiple calls to this function will return properties in the same 1316 /// order. 1317 /// - The order in which the properties are returned defines the command 1318 /// queue group's ordinal. 1319 /// - The application may call this function from simultaneous threads. 1320 /// - The implementation of this function should be lock-free. 1321 /// 1322 /// @remarks 1323 /// _Analogues_ 1324 /// - **vkGetPhysicalDeviceQueueFamilyProperties** 1325 /// 1326 /// @returns 1327 /// - ::ZE_RESULT_SUCCESS 1328 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1329 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1330 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1331 /// + `nullptr == hDevice` 1332 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1333 /// + `nullptr == pCount` 1334 ZE_APIEXPORT ze_result_t ZE_APICALL 1335 zeDeviceGetCommandQueueGroupProperties( 1336 ze_device_handle_t hDevice, ///< [in] handle of the device 1337 uint32_t* pCount, ///< [in,out] pointer to the number of command queue group properties. 1338 ///< if count is zero, then the driver shall update the value with the 1339 ///< total number of command queue group properties available. 1340 ///< if count is greater than the number of command queue group properties 1341 ///< available, then the driver shall update the value with the correct 1342 ///< number of command queue group properties available. 1343 ze_command_queue_group_properties_t* pCommandQueueGroupProperties ///< [in,out][optional][range(0, *pCount)] array of query results for 1344 ///< command queue group properties. 1345 ///< if count is less than the number of command queue group properties 1346 ///< available, then driver shall only retrieve that number of command 1347 ///< queue group properties. 1348 ); 1349 1350 /////////////////////////////////////////////////////////////////////////////// 1351 /// @brief Supported device memory property flags 1352 typedef uint32_t ze_device_memory_property_flags_t; 1353 typedef enum _ze_device_memory_property_flag_t 1354 { 1355 ZE_DEVICE_MEMORY_PROPERTY_FLAG_TBD = ZE_BIT(0), ///< reserved for future use 1356 ZE_DEVICE_MEMORY_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff 1357 1358 } ze_device_memory_property_flag_t; 1359 1360 /////////////////////////////////////////////////////////////////////////////// 1361 /// @brief Device local memory properties queried using 1362 /// ::zeDeviceGetMemoryProperties 1363 typedef struct _ze_device_memory_properties_t 1364 { 1365 ze_structure_type_t stype; ///< [in] type of this structure 1366 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 1367 ///< structure (i.e. contains sType and pNext). 1368 ze_device_memory_property_flags_t flags; ///< [out] 0 (none) or a valid combination of 1369 ///< ::ze_device_memory_property_flag_t 1370 uint32_t maxClockRate; ///< [out] Maximum clock rate for device memory. 1371 uint32_t maxBusWidth; ///< [out] Maximum bus width between device and memory. 1372 uint64_t totalSize; ///< [out] Total memory size in bytes that is available to the device. 1373 char name[ZE_MAX_DEVICE_NAME]; ///< [out] Memory name 1374 1375 } ze_device_memory_properties_t; 1376 1377 /////////////////////////////////////////////////////////////////////////////// 1378 /// @brief Retrieves local memory properties of the device. 1379 /// 1380 /// @details 1381 /// - Properties are reported for each physical memory type supported by the 1382 /// device. 1383 /// - Multiple calls to this function will return properties in the same 1384 /// order. 1385 /// - The order in which the properties are returned defines the device's 1386 /// local memory ordinal. 1387 /// - The application may call this function from simultaneous threads. 1388 /// - The implementation of this function should be lock-free. 1389 /// 1390 /// @remarks 1391 /// _Analogues_ 1392 /// - clGetDeviceInfo 1393 /// 1394 /// @returns 1395 /// - ::ZE_RESULT_SUCCESS 1396 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1397 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1398 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1399 /// + `nullptr == hDevice` 1400 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1401 /// + `nullptr == pCount` 1402 ZE_APIEXPORT ze_result_t ZE_APICALL 1403 zeDeviceGetMemoryProperties( 1404 ze_device_handle_t hDevice, ///< [in] handle of the device 1405 uint32_t* pCount, ///< [in,out] pointer to the number of memory properties. 1406 ///< if count is zero, then the driver shall update the value with the 1407 ///< total number of memory properties available. 1408 ///< if count is greater than the number of memory properties available, 1409 ///< then the driver shall update the value with the correct number of 1410 ///< memory properties available. 1411 ze_device_memory_properties_t* pMemProperties ///< [in,out][optional][range(0, *pCount)] array of query results for 1412 ///< memory properties. 1413 ///< if count is less than the number of memory properties available, then 1414 ///< driver shall only retrieve that number of memory properties. 1415 ); 1416 1417 /////////////////////////////////////////////////////////////////////////////// 1418 /// @brief Memory access capability flags 1419 /// 1420 /// @details 1421 /// - Supported access capabilities for different types of memory 1422 /// allocations 1423 typedef uint32_t ze_memory_access_cap_flags_t; 1424 typedef enum _ze_memory_access_cap_flag_t 1425 { 1426 ZE_MEMORY_ACCESS_CAP_FLAG_RW = ZE_BIT(0), ///< Supports load/store access 1427 ZE_MEMORY_ACCESS_CAP_FLAG_ATOMIC = ZE_BIT(1), ///< Supports atomic access 1428 ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT = ZE_BIT(2), ///< Supports concurrent access 1429 ZE_MEMORY_ACCESS_CAP_FLAG_CONCURRENT_ATOMIC = ZE_BIT(3),///< Supports concurrent atomic access 1430 ZE_MEMORY_ACCESS_CAP_FLAG_FORCE_UINT32 = 0x7fffffff 1431 1432 } ze_memory_access_cap_flag_t; 1433 1434 /////////////////////////////////////////////////////////////////////////////// 1435 /// @brief Device memory access properties queried using 1436 /// ::zeDeviceGetMemoryAccessProperties 1437 typedef struct _ze_device_memory_access_properties_t 1438 { 1439 ze_structure_type_t stype; ///< [in] type of this structure 1440 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 1441 ///< structure (i.e. contains sType and pNext). 1442 ze_memory_access_cap_flags_t hostAllocCapabilities; ///< [out] host memory capabilities. 1443 ///< returns 0 (unsupported) or a combination of ::ze_memory_access_cap_flag_t. 1444 ze_memory_access_cap_flags_t deviceAllocCapabilities; ///< [out] device memory capabilities. 1445 ///< returns 0 (unsupported) or a combination of ::ze_memory_access_cap_flag_t. 1446 ze_memory_access_cap_flags_t sharedSingleDeviceAllocCapabilities; ///< [out] shared, single-device memory capabilities. 1447 ///< returns 0 (unsupported) or a combination of ::ze_memory_access_cap_flag_t. 1448 ze_memory_access_cap_flags_t sharedCrossDeviceAllocCapabilities;///< [out] shared, cross-device memory capabilities. 1449 ///< returns 0 (unsupported) or a combination of ::ze_memory_access_cap_flag_t. 1450 ze_memory_access_cap_flags_t sharedSystemAllocCapabilities; ///< [out] shared, system memory capabilities. 1451 ///< returns 0 (unsupported) or a combination of ::ze_memory_access_cap_flag_t. 1452 1453 } ze_device_memory_access_properties_t; 1454 1455 /////////////////////////////////////////////////////////////////////////////// 1456 /// @brief Retrieves memory access properties of the device. 1457 /// 1458 /// @details 1459 /// - The application may call this function from simultaneous threads. 1460 /// - The implementation of this function should be lock-free. 1461 /// 1462 /// @remarks 1463 /// _Analogues_ 1464 /// - clGetDeviceInfo 1465 /// 1466 /// @returns 1467 /// - ::ZE_RESULT_SUCCESS 1468 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1469 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1470 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1471 /// + `nullptr == hDevice` 1472 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1473 /// + `nullptr == pMemAccessProperties` 1474 ZE_APIEXPORT ze_result_t ZE_APICALL 1475 zeDeviceGetMemoryAccessProperties( 1476 ze_device_handle_t hDevice, ///< [in] handle of the device 1477 ze_device_memory_access_properties_t* pMemAccessProperties ///< [in,out] query result for memory access properties 1478 ); 1479 1480 /////////////////////////////////////////////////////////////////////////////// 1481 /// @brief Supported cache control property flags 1482 typedef uint32_t ze_device_cache_property_flags_t; 1483 typedef enum _ze_device_cache_property_flag_t 1484 { 1485 ZE_DEVICE_CACHE_PROPERTY_FLAG_USER_CONTROL = ZE_BIT(0), ///< Device support User Cache Control (i.e. SLM section vs Generic Cache) 1486 ZE_DEVICE_CACHE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff 1487 1488 } ze_device_cache_property_flag_t; 1489 1490 /////////////////////////////////////////////////////////////////////////////// 1491 /// @brief Device cache properties queried using ::zeDeviceGetCacheProperties 1492 typedef struct _ze_device_cache_properties_t 1493 { 1494 ze_structure_type_t stype; ///< [in] type of this structure 1495 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 1496 ///< structure (i.e. contains sType and pNext). 1497 ze_device_cache_property_flags_t flags; ///< [out] 0 (none) or a valid combination of 1498 ///< ::ze_device_cache_property_flag_t 1499 size_t cacheSize; ///< [out] Per-cache size, in bytes 1500 1501 } ze_device_cache_properties_t; 1502 1503 /////////////////////////////////////////////////////////////////////////////// 1504 /// @brief Retrieves cache properties of the device 1505 /// 1506 /// @details 1507 /// - The application may call this function from simultaneous threads. 1508 /// - The implementation of this function should be lock-free. 1509 /// 1510 /// @remarks 1511 /// _Analogues_ 1512 /// - clGetDeviceInfo 1513 /// 1514 /// @returns 1515 /// - ::ZE_RESULT_SUCCESS 1516 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1517 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1518 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1519 /// + `nullptr == hDevice` 1520 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1521 /// + `nullptr == pCount` 1522 ZE_APIEXPORT ze_result_t ZE_APICALL 1523 zeDeviceGetCacheProperties( 1524 ze_device_handle_t hDevice, ///< [in] handle of the device 1525 uint32_t* pCount, ///< [in,out] pointer to the number of cache properties. 1526 ///< if count is zero, then the driver shall update the value with the 1527 ///< total number of cache properties available. 1528 ///< if count is greater than the number of cache properties available, 1529 ///< then the driver shall update the value with the correct number of 1530 ///< cache properties available. 1531 ze_device_cache_properties_t* pCacheProperties ///< [in,out][optional][range(0, *pCount)] array of query results for cache properties. 1532 ///< if count is less than the number of cache properties available, then 1533 ///< driver shall only retrieve that number of cache properties. 1534 ); 1535 1536 /////////////////////////////////////////////////////////////////////////////// 1537 /// @brief Device image properties queried using ::zeDeviceGetImageProperties 1538 typedef struct _ze_device_image_properties_t 1539 { 1540 ze_structure_type_t stype; ///< [in] type of this structure 1541 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 1542 ///< structure (i.e. contains sType and pNext). 1543 uint32_t maxImageDims1D; ///< [out] Maximum image dimensions for 1D resources. if 0, then 1D images 1544 ///< are unsupported. 1545 uint32_t maxImageDims2D; ///< [out] Maximum image dimensions for 2D resources. if 0, then 2D images 1546 ///< are unsupported. 1547 uint32_t maxImageDims3D; ///< [out] Maximum image dimensions for 3D resources. if 0, then 3D images 1548 ///< are unsupported. 1549 uint64_t maxImageBufferSize; ///< [out] Maximum image buffer size in bytes. if 0, then buffer images are 1550 ///< unsupported. 1551 uint32_t maxImageArraySlices; ///< [out] Maximum image array slices. if 0, then image arrays are 1552 ///< unsupported. 1553 uint32_t maxSamplers; ///< [out] Max samplers that can be used in kernel. if 0, then sampling is 1554 ///< unsupported. 1555 uint32_t maxReadImageArgs; ///< [out] Returns the maximum number of simultaneous image objects that 1556 ///< can be read from by a kernel. if 0, then reading images is 1557 ///< unsupported. 1558 uint32_t maxWriteImageArgs; ///< [out] Returns the maximum number of simultaneous image objects that 1559 ///< can be written to by a kernel. if 0, then writing images is 1560 ///< unsupported. 1561 1562 } ze_device_image_properties_t; 1563 1564 /////////////////////////////////////////////////////////////////////////////// 1565 /// @brief Retrieves image properties of the device 1566 /// 1567 /// @details 1568 /// - See ::zeImageGetProperties for format-specific capabilities. 1569 /// - The application may call this function from simultaneous threads. 1570 /// - The implementation of this function should be lock-free. 1571 /// 1572 /// @returns 1573 /// - ::ZE_RESULT_SUCCESS 1574 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1575 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1576 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1577 /// + `nullptr == hDevice` 1578 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1579 /// + `nullptr == pImageProperties` 1580 ZE_APIEXPORT ze_result_t ZE_APICALL 1581 zeDeviceGetImageProperties( 1582 ze_device_handle_t hDevice, ///< [in] handle of the device 1583 ze_device_image_properties_t* pImageProperties ///< [in,out] query result for image properties 1584 ); 1585 1586 /////////////////////////////////////////////////////////////////////////////// 1587 /// @brief Device external memory import and export properties 1588 typedef struct _ze_device_external_memory_properties_t 1589 { 1590 ze_structure_type_t stype; ///< [in] type of this structure 1591 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 1592 ///< structure (i.e. contains sType and pNext). 1593 ze_external_memory_type_flags_t memoryAllocationImportTypes;///< [out] Supported external memory import types for memory allocations. 1594 ze_external_memory_type_flags_t memoryAllocationExportTypes;///< [out] Supported external memory export types for memory allocations. 1595 ze_external_memory_type_flags_t imageImportTypes; ///< [out] Supported external memory import types for images. 1596 ze_external_memory_type_flags_t imageExportTypes; ///< [out] Supported external memory export types for images. 1597 1598 } ze_device_external_memory_properties_t; 1599 1600 /////////////////////////////////////////////////////////////////////////////// 1601 /// @brief Retrieves external memory import and export of the device 1602 /// 1603 /// @details 1604 /// - The application may call this function from simultaneous threads. 1605 /// - The implementation of this function should be lock-free. 1606 /// 1607 /// @returns 1608 /// - ::ZE_RESULT_SUCCESS 1609 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1610 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1611 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1612 /// + `nullptr == hDevice` 1613 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1614 /// + `nullptr == pExternalMemoryProperties` 1615 ZE_APIEXPORT ze_result_t ZE_APICALL 1616 zeDeviceGetExternalMemoryProperties( 1617 ze_device_handle_t hDevice, ///< [in] handle of the device 1618 ze_device_external_memory_properties_t* pExternalMemoryProperties ///< [in,out] query result for external memory properties 1619 ); 1620 1621 /////////////////////////////////////////////////////////////////////////////// 1622 /// @brief Supported device peer-to-peer property flags 1623 typedef uint32_t ze_device_p2p_property_flags_t; 1624 typedef enum _ze_device_p2p_property_flag_t 1625 { 1626 ZE_DEVICE_P2P_PROPERTY_FLAG_ACCESS = ZE_BIT(0), ///< Device supports access between peer devices. 1627 ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS = ZE_BIT(1),///< Device supports atomics between peer devices. 1628 ZE_DEVICE_P2P_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff 1629 1630 } ze_device_p2p_property_flag_t; 1631 1632 /////////////////////////////////////////////////////////////////////////////// 1633 /// @brief Device peer-to-peer properties queried using 1634 /// ::zeDeviceGetP2PProperties 1635 typedef struct _ze_device_p2p_properties_t 1636 { 1637 ze_structure_type_t stype; ///< [in] type of this structure 1638 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 1639 ///< structure (i.e. contains sType and pNext). 1640 ze_device_p2p_property_flags_t flags; ///< [out] 0 (none) or a valid combination of 1641 ///< ::ze_device_p2p_property_flag_t 1642 1643 } ze_device_p2p_properties_t; 1644 1645 /////////////////////////////////////////////////////////////////////////////// 1646 /// @brief Retrieves peer-to-peer properties between one device and a peer 1647 /// devices 1648 /// 1649 /// @details 1650 /// - The application may call this function from simultaneous threads. 1651 /// - The implementation of this function should be lock-free. 1652 /// 1653 /// @returns 1654 /// - ::ZE_RESULT_SUCCESS 1655 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1656 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1657 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1658 /// + `nullptr == hDevice` 1659 /// + `nullptr == hPeerDevice` 1660 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1661 /// + `nullptr == pP2PProperties` 1662 ZE_APIEXPORT ze_result_t ZE_APICALL 1663 zeDeviceGetP2PProperties( 1664 ze_device_handle_t hDevice, ///< [in] handle of the device performing the access 1665 ze_device_handle_t hPeerDevice, ///< [in] handle of the peer device with the allocation 1666 ze_device_p2p_properties_t* pP2PProperties ///< [in,out] Peer-to-Peer properties between source and peer device 1667 ); 1668 1669 /////////////////////////////////////////////////////////////////////////////// 1670 /// @brief Queries if one device can directly access peer device allocations 1671 /// 1672 /// @details 1673 /// - Any device can access any other device within a node through a 1674 /// scale-up fabric. 1675 /// - The following are conditions for CanAccessPeer query. 1676 /// + If both device and peer device are the same then return true. 1677 /// + If both sub-device and peer sub-device are the same then return 1678 /// true. 1679 /// + If both are sub-devices and share the same parent device then 1680 /// return true. 1681 /// + If both device and remote device are connected by a direct or 1682 /// indirect scale-up fabric or over PCIe (same root complex or shared 1683 /// PCIe switch) then true. 1684 /// + If both sub-device and remote parent device (and vice-versa) are 1685 /// connected by a direct or indirect scale-up fabric or over PCIe 1686 /// (same root complex or shared PCIe switch) then true. 1687 /// - The application may call this function from simultaneous threads. 1688 /// - The implementation of this function should be lock-free. 1689 /// 1690 /// @returns 1691 /// - ::ZE_RESULT_SUCCESS 1692 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1693 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1694 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1695 /// + `nullptr == hDevice` 1696 /// + `nullptr == hPeerDevice` 1697 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1698 /// + `nullptr == value` 1699 ZE_APIEXPORT ze_result_t ZE_APICALL 1700 zeDeviceCanAccessPeer( 1701 ze_device_handle_t hDevice, ///< [in] handle of the device performing the access 1702 ze_device_handle_t hPeerDevice, ///< [in] handle of the peer device with the allocation 1703 ze_bool_t* value ///< [out] returned access capability 1704 ); 1705 1706 /////////////////////////////////////////////////////////////////////////////// 1707 /// @brief Returns current status of the device. 1708 /// 1709 /// @details 1710 /// - Once a device is reset, this call will update the OS handle attached 1711 /// to the device handle. 1712 /// - The application may call this function from simultaneous threads with 1713 /// the same device handle. 1714 /// - The implementation of this function must be thread-safe. 1715 /// 1716 /// @returns 1717 /// - ::ZE_RESULT_SUCCESS 1718 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1719 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1720 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1721 /// + `nullptr == hDevice` 1722 /// - ::ZE_RESULT_SUCCESS 1723 /// + Device is available for use. 1724 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1725 /// + Device is lost; must be reset for use. 1726 ZE_APIEXPORT ze_result_t ZE_APICALL 1727 zeDeviceGetStatus( 1728 ze_device_handle_t hDevice ///< [in] handle of the device 1729 ); 1730 1731 /////////////////////////////////////////////////////////////////////////////// 1732 /// @brief Returns synchronized Host and device global timestamps. 1733 /// 1734 /// @details 1735 /// - The application may call this function from simultaneous threads with 1736 /// the same device handle. 1737 /// - The implementation of this function must be thread-safe. 1738 /// 1739 /// @returns 1740 /// - ::ZE_RESULT_SUCCESS 1741 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1742 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1743 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1744 /// + `nullptr == hDevice` 1745 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1746 /// + `nullptr == hostTimestamp` 1747 /// + `nullptr == deviceTimestamp` 1748 ZE_APIEXPORT ze_result_t ZE_APICALL 1749 zeDeviceGetGlobalTimestamps( 1750 ze_device_handle_t hDevice, ///< [in] handle of the device 1751 uint64_t* hostTimestamp, ///< [out] value of the Host's global timestamp that correlates with the 1752 ///< Device's global timestamp value 1753 uint64_t* deviceTimestamp ///< [out] value of the Device's global timestamp that correlates with the 1754 ///< Host's global timestamp value 1755 ); 1756 1757 #if !defined(__GNUC__) 1758 #pragma endregion 1759 #endif 1760 // Intel 'oneAPI' Level-Zero APIs for Context 1761 #if !defined(__GNUC__) 1762 #pragma region context 1763 #endif 1764 /////////////////////////////////////////////////////////////////////////////// 1765 /// @brief Supported context creation flags 1766 typedef uint32_t ze_context_flags_t; 1767 typedef enum _ze_context_flag_t 1768 { 1769 ZE_CONTEXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use 1770 ZE_CONTEXT_FLAG_FORCE_UINT32 = 0x7fffffff 1771 1772 } ze_context_flag_t; 1773 1774 /////////////////////////////////////////////////////////////////////////////// 1775 /// @brief Context descriptor 1776 typedef struct _ze_context_desc_t 1777 { 1778 ze_structure_type_t stype; ///< [in] type of this structure 1779 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 1780 ///< structure (i.e. contains sType and pNext). 1781 ze_context_flags_t flags; ///< [in] creation flags. 1782 ///< must be 0 (default) or a valid combination of ::ze_context_flag_t; 1783 ///< default behavior may use implicit driver-based heuristics. 1784 1785 } ze_context_desc_t; 1786 1787 /////////////////////////////////////////////////////////////////////////////// 1788 /// @brief Creates a context for the driver. 1789 /// 1790 /// @details 1791 /// - The application must only use the context for the driver which was 1792 /// provided during creation. 1793 /// - The application may call this function from simultaneous threads. 1794 /// - The implementation of this function must be thread-safe. 1795 /// 1796 /// @returns 1797 /// - ::ZE_RESULT_SUCCESS 1798 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1799 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1800 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1801 /// + `nullptr == hDriver` 1802 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1803 /// + `nullptr == desc` 1804 /// + `nullptr == phContext` 1805 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 1806 /// + `0x1 < desc->flags` 1807 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 1808 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 1809 ZE_APIEXPORT ze_result_t ZE_APICALL 1810 zeContextCreate( 1811 ze_driver_handle_t hDriver, ///< [in] handle of the driver object 1812 const ze_context_desc_t* desc, ///< [in] pointer to context descriptor 1813 ze_context_handle_t* phContext ///< [out] pointer to handle of context object created 1814 ); 1815 1816 /////////////////////////////////////////////////////////////////////////////// 1817 /// @brief Creates a context for the driver. 1818 /// 1819 /// @details 1820 /// - The application must only use the context for the driver which was 1821 /// provided during creation. 1822 /// - The application may call this function from simultaneous threads. 1823 /// - The implementation of this function must be thread-safe. 1824 /// 1825 /// @returns 1826 /// - ::ZE_RESULT_SUCCESS 1827 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1828 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1829 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1830 /// + `nullptr == hDriver` 1831 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1832 /// + `nullptr == desc` 1833 /// + `nullptr == phContext` 1834 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 1835 /// + `0x1 < desc->flags` 1836 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 1837 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 1838 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 1839 /// + `(nullptr == phDevices) && (0 < numDevices)` 1840 ZE_APIEXPORT ze_result_t ZE_APICALL 1841 zeContextCreateEx( 1842 ze_driver_handle_t hDriver, ///< [in] handle of the driver object 1843 const ze_context_desc_t* desc, ///< [in] pointer to context descriptor 1844 uint32_t numDevices, ///< [in][optional] number of device handles; must be 0 if `nullptr == 1845 ///< phDevices` 1846 ze_device_handle_t* phDevices, ///< [in][optional][range(0, numDevices)] array of device handles which 1847 ///< context has visibility. 1848 ///< if nullptr, then all devices supported by the driver instance are 1849 ///< visible to the context. 1850 ///< otherwise, context only has visibility to devices in this array. 1851 ze_context_handle_t* phContext ///< [out] pointer to handle of context object created 1852 ); 1853 1854 /////////////////////////////////////////////////////////////////////////////// 1855 /// @brief Destroys a context. 1856 /// 1857 /// @details 1858 /// - The application must ensure the device is not currently referencing 1859 /// the context before it is deleted. 1860 /// - The implementation of this function may immediately free all Host and 1861 /// Device allocations associated with this context. 1862 /// - The application must **not** call this function from simultaneous 1863 /// threads with the same context handle. 1864 /// - The implementation of this function must be thread-safe. 1865 /// 1866 /// @returns 1867 /// - ::ZE_RESULT_SUCCESS 1868 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1869 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1870 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1871 /// + `nullptr == hContext` 1872 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 1873 ZE_APIEXPORT ze_result_t ZE_APICALL 1874 zeContextDestroy( 1875 ze_context_handle_t hContext ///< [in][release] handle of context object to destroy 1876 ); 1877 1878 /////////////////////////////////////////////////////////////////////////////// 1879 /// @brief Returns current status of the context. 1880 /// 1881 /// @details 1882 /// - The application may call this function from simultaneous threads with 1883 /// the same context handle. 1884 /// - The implementation of this function should be lock-free. 1885 /// 1886 /// @returns 1887 /// - ::ZE_RESULT_SUCCESS 1888 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1889 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1890 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1891 /// + `nullptr == hContext` 1892 /// - ::ZE_RESULT_SUCCESS 1893 /// + Context is available for use. 1894 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1895 /// + Context is invalid; due to device lost or reset. 1896 ZE_APIEXPORT ze_result_t ZE_APICALL 1897 zeContextGetStatus( 1898 ze_context_handle_t hContext ///< [in] handle of context object 1899 ); 1900 1901 #if !defined(__GNUC__) 1902 #pragma endregion 1903 #endif 1904 // Intel 'oneAPI' Level-Zero APIs for Command Queue 1905 #if !defined(__GNUC__) 1906 #pragma region cmdqueue 1907 #endif 1908 /////////////////////////////////////////////////////////////////////////////// 1909 /// @brief Supported command queue flags 1910 typedef uint32_t ze_command_queue_flags_t; 1911 typedef enum _ze_command_queue_flag_t 1912 { 1913 ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY = ZE_BIT(0),///< command queue should be optimized for submission to a single device engine. 1914 ///< driver **must** disable any implicit optimizations for distributing 1915 ///< work across multiple engines. 1916 ///< this flag should be used when applications want full control over 1917 ///< multi-engine submission and scheduling. 1918 ZE_COMMAND_QUEUE_FLAG_FORCE_UINT32 = 0x7fffffff 1919 1920 } ze_command_queue_flag_t; 1921 1922 /////////////////////////////////////////////////////////////////////////////// 1923 /// @brief Supported command queue modes 1924 typedef enum _ze_command_queue_mode_t 1925 { 1926 ZE_COMMAND_QUEUE_MODE_DEFAULT = 0, ///< implicit default behavior; uses driver-based heuristics 1927 ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS = 1, ///< Device execution always completes immediately on execute; 1928 ///< Host thread is blocked using wait on implicit synchronization object 1929 ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS = 2, ///< Device execution is scheduled and will complete in future; 1930 ///< explicit synchronization object must be used to determine completeness 1931 ZE_COMMAND_QUEUE_MODE_FORCE_UINT32 = 0x7fffffff 1932 1933 } ze_command_queue_mode_t; 1934 1935 /////////////////////////////////////////////////////////////////////////////// 1936 /// @brief Supported command queue priorities 1937 typedef enum _ze_command_queue_priority_t 1938 { 1939 ZE_COMMAND_QUEUE_PRIORITY_NORMAL = 0, ///< [default] normal priority 1940 ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW = 1, ///< lower priority than normal 1941 ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH = 2, ///< higher priority than normal 1942 ZE_COMMAND_QUEUE_PRIORITY_FORCE_UINT32 = 0x7fffffff 1943 1944 } ze_command_queue_priority_t; 1945 1946 /////////////////////////////////////////////////////////////////////////////// 1947 /// @brief Command Queue descriptor 1948 typedef struct _ze_command_queue_desc_t 1949 { 1950 ze_structure_type_t stype; ///< [in] type of this structure 1951 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 1952 ///< structure (i.e. contains sType and pNext). 1953 uint32_t ordinal; ///< [in] command queue group ordinal 1954 uint32_t index; ///< [in] command queue index within the group; 1955 ///< must be zero if ::ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY is not set 1956 ze_command_queue_flags_t flags; ///< [in] usage flags. 1957 ///< must be 0 (default) or a valid combination of ::ze_command_queue_flag_t; 1958 ///< default behavior may use implicit driver-based heuristics to balance 1959 ///< latency and throughput. 1960 ze_command_queue_mode_t mode; ///< [in] operation mode 1961 ze_command_queue_priority_t priority; ///< [in] priority 1962 1963 } ze_command_queue_desc_t; 1964 1965 /////////////////////////////////////////////////////////////////////////////// 1966 /// @brief Creates a command queue on the context. 1967 /// 1968 /// @details 1969 /// - A command queue represents a logical input stream to the device, tied 1970 /// to a physical input stream. 1971 /// - The application must only use the command queue for the device, or its 1972 /// sub-devices, which was provided during creation. 1973 /// - The application may call this function from simultaneous threads. 1974 /// - The implementation of this function must be thread-safe. 1975 /// 1976 /// @remarks 1977 /// _Analogues_ 1978 /// - **clCreateCommandQueue** 1979 /// 1980 /// @returns 1981 /// - ::ZE_RESULT_SUCCESS 1982 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 1983 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 1984 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 1985 /// + `nullptr == hContext` 1986 /// + `nullptr == hDevice` 1987 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 1988 /// + `nullptr == desc` 1989 /// + `nullptr == phCommandQueue` 1990 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 1991 /// + `0x1 < desc->flags` 1992 /// + `::ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < desc->mode` 1993 /// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < desc->priority` 1994 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 1995 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 1996 ZE_APIEXPORT ze_result_t ZE_APICALL 1997 zeCommandQueueCreate( 1998 ze_context_handle_t hContext, ///< [in] handle of the context object 1999 ze_device_handle_t hDevice, ///< [in] handle of the device object 2000 const ze_command_queue_desc_t* desc, ///< [in] pointer to command queue descriptor 2001 ze_command_queue_handle_t* phCommandQueue ///< [out] pointer to handle of command queue object created 2002 ); 2003 2004 /////////////////////////////////////////////////////////////////////////////// 2005 /// @brief Destroys a command queue. 2006 /// 2007 /// @details 2008 /// - The application must destroy all fence handles created from the 2009 /// command queue before destroying the command queue itself 2010 /// - The application must ensure the device is not currently referencing 2011 /// the command queue before it is deleted 2012 /// - The implementation of this function may immediately free all Host and 2013 /// Device allocations associated with this command queue 2014 /// - The application must **not** call this function from simultaneous 2015 /// threads with the same command queue handle. 2016 /// - The implementation of this function must be thread-safe. 2017 /// 2018 /// @remarks 2019 /// _Analogues_ 2020 /// - **clReleaseCommandQueue** 2021 /// 2022 /// @returns 2023 /// - ::ZE_RESULT_SUCCESS 2024 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2025 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2026 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2027 /// + `nullptr == hCommandQueue` 2028 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 2029 ZE_APIEXPORT ze_result_t ZE_APICALL 2030 zeCommandQueueDestroy( 2031 ze_command_queue_handle_t hCommandQueue ///< [in][release] handle of command queue object to destroy 2032 ); 2033 2034 /////////////////////////////////////////////////////////////////////////////// 2035 /// @brief Executes a command list in a command queue. 2036 /// 2037 /// @details 2038 /// - The command lists are submitted to the device in the order they are 2039 /// received, whether from multiple calls (on the same or different 2040 /// threads) or a single call with multiple command lists. 2041 /// - The application must ensure the command lists are accessible by the 2042 /// device on which the command queue was created. 2043 /// - The application must ensure the device is not currently referencing 2044 /// the command list since the implementation is allowed to modify the 2045 /// contents of the command list for submission. 2046 /// - The application must only execute command lists created with an 2047 /// identical command queue group ordinal to the command queue. 2048 /// - The application must use a fence created using the same command queue. 2049 /// - The application must ensure the command queue, command list and fence 2050 /// were created on the same context. 2051 /// - The application may call this function from simultaneous threads. 2052 /// - The implementation of this function should be lock-free. 2053 /// 2054 /// @remarks 2055 /// _Analogues_ 2056 /// - vkQueueSubmit 2057 /// 2058 /// @returns 2059 /// - ::ZE_RESULT_SUCCESS 2060 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2061 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2062 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2063 /// + `nullptr == hCommandQueue` 2064 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2065 /// + `nullptr == phCommandLists` 2066 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2067 /// + `0 == numCommandLists` 2068 /// - ::ZE_RESULT_ERROR_INVALID_COMMAND_LIST_TYPE 2069 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2070 ZE_APIEXPORT ze_result_t ZE_APICALL 2071 zeCommandQueueExecuteCommandLists( 2072 ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue 2073 uint32_t numCommandLists, ///< [in] number of command lists to execute 2074 ze_command_list_handle_t* phCommandLists, ///< [in][range(0, numCommandLists)] list of handles of the command lists 2075 ///< to execute 2076 ze_fence_handle_t hFence ///< [in][optional] handle of the fence to signal on completion 2077 ); 2078 2079 /////////////////////////////////////////////////////////////////////////////// 2080 /// @brief Synchronizes a command queue by waiting on the host. 2081 /// 2082 /// @details 2083 /// - The application may call this function from simultaneous threads. 2084 /// - The implementation of this function should be lock-free. 2085 /// 2086 /// @returns 2087 /// - ::ZE_RESULT_SUCCESS 2088 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2089 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2090 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2091 /// + `nullptr == hCommandQueue` 2092 /// - ::ZE_RESULT_NOT_READY 2093 /// + timeout expired 2094 ZE_APIEXPORT ze_result_t ZE_APICALL 2095 zeCommandQueueSynchronize( 2096 ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue 2097 uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to 2098 ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; 2099 ///< if zero, then immediately returns the status of the command queue; 2100 ///< if UINT64_MAX, then function will not return until complete or device 2101 ///< is lost. 2102 ///< Due to external dependencies, timeout may be rounded to the closest 2103 ///< value allowed by the accuracy of those dependencies. 2104 ); 2105 2106 #if !defined(__GNUC__) 2107 #pragma endregion 2108 #endif 2109 // Intel 'oneAPI' Level-Zero APIs for Command List 2110 #if !defined(__GNUC__) 2111 #pragma region cmdlist 2112 #endif 2113 /////////////////////////////////////////////////////////////////////////////// 2114 /// @brief Supported command list creation flags 2115 typedef uint32_t ze_command_list_flags_t; 2116 typedef enum _ze_command_list_flag_t 2117 { 2118 ZE_COMMAND_LIST_FLAG_RELAXED_ORDERING = ZE_BIT(0), ///< driver may reorder commands (e.g., kernels, copies) between barriers 2119 ///< and synchronization primitives. 2120 ///< using this flag may increase Host overhead of ::zeCommandListClose. 2121 ///< therefore, this flag should **not** be set for low-latency usage-models. 2122 ZE_COMMAND_LIST_FLAG_MAXIMIZE_THROUGHPUT = ZE_BIT(1), ///< driver may perform additional optimizations that increase execution 2123 ///< throughput. 2124 ///< using this flag may increase Host overhead of ::zeCommandListClose and ::zeCommandQueueExecuteCommandLists. 2125 ///< therefore, this flag should **not** be set for low-latency usage-models. 2126 ZE_COMMAND_LIST_FLAG_EXPLICIT_ONLY = ZE_BIT(2), ///< command list should be optimized for submission to a single command 2127 ///< queue and device engine. 2128 ///< driver **must** disable any implicit optimizations for distributing 2129 ///< work across multiple engines. 2130 ///< this flag should be used when applications want full control over 2131 ///< multi-engine submission and scheduling. 2132 ZE_COMMAND_LIST_FLAG_FORCE_UINT32 = 0x7fffffff 2133 2134 } ze_command_list_flag_t; 2135 2136 /////////////////////////////////////////////////////////////////////////////// 2137 /// @brief Command List descriptor 2138 typedef struct _ze_command_list_desc_t 2139 { 2140 ze_structure_type_t stype; ///< [in] type of this structure 2141 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 2142 ///< structure (i.e. contains sType and pNext). 2143 uint32_t commandQueueGroupOrdinal; ///< [in] command queue group ordinal to which this command list will be 2144 ///< submitted 2145 ze_command_list_flags_t flags; ///< [in] usage flags. 2146 ///< must be 0 (default) or a valid combination of ::ze_command_list_flag_t; 2147 ///< default behavior may use implicit driver-based heuristics to balance 2148 ///< latency and throughput. 2149 2150 } ze_command_list_desc_t; 2151 2152 /////////////////////////////////////////////////////////////////////////////// 2153 /// @brief Creates a command list on the context. 2154 /// 2155 /// @details 2156 /// - A command list represents a sequence of commands for execution on a 2157 /// command queue. 2158 /// - The command list is created in the 'open' state. 2159 /// - The application must only use the command list for the device, or its 2160 /// sub-devices, which was provided during creation. 2161 /// - The application may call this function from simultaneous threads. 2162 /// - The implementation of this function must be thread-safe. 2163 /// 2164 /// @returns 2165 /// - ::ZE_RESULT_SUCCESS 2166 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2167 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2168 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2169 /// + `nullptr == hContext` 2170 /// + `nullptr == hDevice` 2171 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2172 /// + `nullptr == desc` 2173 /// + `nullptr == phCommandList` 2174 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 2175 /// + `0x7 < desc->flags` 2176 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 2177 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 2178 ZE_APIEXPORT ze_result_t ZE_APICALL 2179 zeCommandListCreate( 2180 ze_context_handle_t hContext, ///< [in] handle of the context object 2181 ze_device_handle_t hDevice, ///< [in] handle of the device object 2182 const ze_command_list_desc_t* desc, ///< [in] pointer to command list descriptor 2183 ze_command_list_handle_t* phCommandList ///< [out] pointer to handle of command list object created 2184 ); 2185 2186 /////////////////////////////////////////////////////////////////////////////// 2187 /// @brief Creates an immediate command list on the context. 2188 /// 2189 /// @details 2190 /// - An immediate command list is used for low-latency submission of 2191 /// commands. 2192 /// - An immediate command list creates an implicit command queue. 2193 /// - The command list is created in the 'open' state and never needs to be 2194 /// closed. 2195 /// - The application must only use the command list for the device, or its 2196 /// sub-devices, which was provided during creation. 2197 /// - The application may call this function from simultaneous threads. 2198 /// - The implementation of this function must be thread-safe. 2199 /// 2200 /// @returns 2201 /// - ::ZE_RESULT_SUCCESS 2202 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2203 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2204 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2205 /// + `nullptr == hContext` 2206 /// + `nullptr == hDevice` 2207 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2208 /// + `nullptr == altdesc` 2209 /// + `nullptr == phCommandList` 2210 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 2211 /// + `0x1 < altdesc->flags` 2212 /// + `::ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS < altdesc->mode` 2213 /// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < altdesc->priority` 2214 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 2215 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 2216 ZE_APIEXPORT ze_result_t ZE_APICALL 2217 zeCommandListCreateImmediate( 2218 ze_context_handle_t hContext, ///< [in] handle of the context object 2219 ze_device_handle_t hDevice, ///< [in] handle of the device object 2220 const ze_command_queue_desc_t* altdesc, ///< [in] pointer to command queue descriptor 2221 ze_command_list_handle_t* phCommandList ///< [out] pointer to handle of command list object created 2222 ); 2223 2224 /////////////////////////////////////////////////////////////////////////////// 2225 /// @brief Destroys a command list. 2226 /// 2227 /// @details 2228 /// - The application must ensure the device is not currently referencing 2229 /// the command list before it is deleted. 2230 /// - The implementation of this function may immediately free all Host and 2231 /// Device allocations associated with this command list. 2232 /// - The application must **not** call this function from simultaneous 2233 /// threads with the same command list handle. 2234 /// - The implementation of this function must be thread-safe. 2235 /// 2236 /// @returns 2237 /// - ::ZE_RESULT_SUCCESS 2238 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2239 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2240 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2241 /// + `nullptr == hCommandList` 2242 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 2243 ZE_APIEXPORT ze_result_t ZE_APICALL 2244 zeCommandListDestroy( 2245 ze_command_list_handle_t hCommandList ///< [in][release] handle of command list object to destroy 2246 ); 2247 2248 /////////////////////////////////////////////////////////////////////////////// 2249 /// @brief Closes a command list; ready to be executed by a command queue. 2250 /// 2251 /// @details 2252 /// - The application must **not** call this function from simultaneous 2253 /// threads with the same command list handle. 2254 /// - The implementation of this function should be lock-free. 2255 /// 2256 /// @returns 2257 /// - ::ZE_RESULT_SUCCESS 2258 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2259 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2260 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2261 /// + `nullptr == hCommandList` 2262 ZE_APIEXPORT ze_result_t ZE_APICALL 2263 zeCommandListClose( 2264 ze_command_list_handle_t hCommandList ///< [in] handle of command list object to close 2265 ); 2266 2267 /////////////////////////////////////////////////////////////////////////////// 2268 /// @brief Reset a command list to initial (empty) state; ready for appending 2269 /// commands. 2270 /// 2271 /// @details 2272 /// - The application must ensure the device is not currently referencing 2273 /// the command list before it is reset 2274 /// - The application must **not** call this function from simultaneous 2275 /// threads with the same command list handle. 2276 /// - The implementation of this function should be lock-free. 2277 /// 2278 /// @returns 2279 /// - ::ZE_RESULT_SUCCESS 2280 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2281 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2282 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2283 /// + `nullptr == hCommandList` 2284 ZE_APIEXPORT ze_result_t ZE_APICALL 2285 zeCommandListReset( 2286 ze_command_list_handle_t hCommandList ///< [in] handle of command list object to reset 2287 ); 2288 2289 /////////////////////////////////////////////////////////////////////////////// 2290 /// @brief Appends a memory write of the device's global timestamp value into a 2291 /// command list. 2292 /// 2293 /// @details 2294 /// - The application must ensure the events are accessible by the device on 2295 /// which the command list was created. 2296 /// - The timestamp frequency can be queried from 2297 /// ::ze_device_properties_t.timerResolution. 2298 /// - The number of valid bits in the timestamp value can be queried from 2299 /// ::ze_device_properties_t.timestampValidBits. 2300 /// - The application must ensure the memory pointed to by dstptr is 2301 /// accessible by the device on which the command list was created. 2302 /// - The application must ensure the command list and events were created, 2303 /// and the memory was allocated, on the same context. 2304 /// - The application must **not** call this function from simultaneous 2305 /// threads with the same command list handle. 2306 /// - The implementation of this function should be lock-free. 2307 /// 2308 /// @returns 2309 /// - ::ZE_RESULT_SUCCESS 2310 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2311 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2312 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2313 /// + `nullptr == hCommandList` 2314 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2315 /// + `nullptr == dstptr` 2316 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2317 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2318 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 2319 ZE_APIEXPORT ze_result_t ZE_APICALL 2320 zeCommandListAppendWriteGlobalTimestamp( 2321 ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 2322 uint64_t* dstptr, ///< [in,out] pointer to memory where timestamp value will be written; must 2323 ///< be 8byte-aligned. 2324 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 2325 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing query; 2326 ///< must be 0 if `nullptr == phWaitEvents` 2327 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 2328 ///< on before executing query 2329 ); 2330 2331 #if !defined(__GNUC__) 2332 #pragma endregion 2333 #endif 2334 // Intel 'oneAPI' Level-Zero APIs for Barrier 2335 #if !defined(__GNUC__) 2336 #pragma region barrier 2337 #endif 2338 /////////////////////////////////////////////////////////////////////////////// 2339 /// @brief Appends an execution and global memory barrier into a command list. 2340 /// 2341 /// @details 2342 /// - The application must ensure the events are accessible by the device on 2343 /// which the command list was created. 2344 /// - If numWaitEvents is zero, then all previous commands, enqueued on same 2345 /// command queue, must complete prior to the execution of the barrier. 2346 /// This is not the case when numWaitEvents is non-zero. 2347 /// - If numWaitEvents is non-zero, then only all phWaitEvents must be 2348 /// signaled prior to the execution of the barrier. 2349 /// - This command blocks all following commands from beginning until the 2350 /// execution of the barrier completes. 2351 /// - The application must **not** call this function from simultaneous 2352 /// threads with the same command list handle. 2353 /// - The implementation of this function should be lock-free. 2354 /// 2355 /// @remarks 2356 /// _Analogues_ 2357 /// - **vkCmdPipelineBarrier** 2358 /// - clEnqueueBarrierWithWaitList 2359 /// 2360 /// @returns 2361 /// - ::ZE_RESULT_SUCCESS 2362 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2363 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2364 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2365 /// + `nullptr == hCommandList` 2366 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2367 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2368 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 2369 ZE_APIEXPORT ze_result_t ZE_APICALL 2370 zeCommandListAppendBarrier( 2371 ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 2372 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 2373 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; 2374 ///< must be 0 if `nullptr == phWaitEvents` 2375 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 2376 ///< on before executing barrier 2377 ); 2378 2379 /////////////////////////////////////////////////////////////////////////////// 2380 /// @brief Appends a global memory ranges barrier into a command list. 2381 /// 2382 /// @details 2383 /// - The application must ensure the events are accessible by the device on 2384 /// which the command list was created. 2385 /// - If numWaitEvents is zero, then all previous commands are completed 2386 /// prior to the execution of the barrier. 2387 /// - If numWaitEvents is non-zero, then then all phWaitEvents must be 2388 /// signaled prior to the execution of the barrier. 2389 /// - This command blocks all following commands from beginning until the 2390 /// execution of the barrier completes. 2391 /// - The application must **not** call this function from simultaneous 2392 /// threads with the same command list handle. 2393 /// - The implementation of this function should be lock-free. 2394 /// 2395 /// @returns 2396 /// - ::ZE_RESULT_SUCCESS 2397 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2398 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2399 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2400 /// + `nullptr == hCommandList` 2401 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2402 /// + `nullptr == pRangeSizes` 2403 /// + `nullptr == pRanges` 2404 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2405 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2406 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 2407 ZE_APIEXPORT ze_result_t ZE_APICALL 2408 zeCommandListAppendMemoryRangesBarrier( 2409 ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 2410 uint32_t numRanges, ///< [in] number of memory ranges 2411 const size_t* pRangeSizes, ///< [in][range(0, numRanges)] array of sizes of memory range 2412 const void** pRanges, ///< [in][range(0, numRanges)] array of memory ranges 2413 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 2414 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing barrier; 2415 ///< must be 0 if `nullptr == phWaitEvents` 2416 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 2417 ///< on before executing barrier 2418 ); 2419 2420 /////////////////////////////////////////////////////////////////////////////// 2421 /// @brief Ensures in-bound writes to the device are globally observable. 2422 /// 2423 /// @details 2424 /// - This is a special-case system level barrier that can be used to ensure 2425 /// global observability of writes; 2426 /// typically needed after a producer (e.g., NIC) performs direct writes 2427 /// to the device's memory (e.g., Direct RDMA writes). 2428 /// This is typically required when the memory corresponding to the writes 2429 /// is subsequently accessed from a remote device. 2430 /// - The application may call this function from simultaneous threads. 2431 /// - The implementation of this function should be lock-free. 2432 /// 2433 /// @returns 2434 /// - ::ZE_RESULT_SUCCESS 2435 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2436 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2437 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2438 /// + `nullptr == hContext` 2439 /// + `nullptr == hDevice` 2440 ZE_APIEXPORT ze_result_t ZE_APICALL 2441 zeContextSystemBarrier( 2442 ze_context_handle_t hContext, ///< [in] handle of context object 2443 ze_device_handle_t hDevice ///< [in] handle of the device 2444 ); 2445 2446 #if !defined(__GNUC__) 2447 #pragma endregion 2448 #endif 2449 // Intel 'oneAPI' Level-Zero APIs for Copies 2450 #if !defined(__GNUC__) 2451 #pragma region copy 2452 #endif 2453 /////////////////////////////////////////////////////////////////////////////// 2454 /// @brief Copies host, device, or shared memory. 2455 /// 2456 /// @details 2457 /// - The application must ensure the memory pointed to by dstptr and srcptr 2458 /// is accessible by the device on which the command list was created. 2459 /// - The implementation must not access the memory pointed to by dstptr and 2460 /// srcptr as they are free to be modified by either the Host or device up 2461 /// until execution. 2462 /// - The application must ensure the events are accessible by the device on 2463 /// which the command list was created. 2464 /// - The application must ensure the command list and events were created, 2465 /// and the memory was allocated, on the same context. 2466 /// - The application must **not** call this function from simultaneous 2467 /// threads with the same command list handle. 2468 /// - The implementation of this function should be lock-free. 2469 /// 2470 /// @remarks 2471 /// _Analogues_ 2472 /// - **clEnqueueCopyBuffer** 2473 /// - **clEnqueueReadBuffer** 2474 /// - **clEnqueueWriteBuffer** 2475 /// - **clEnqueueSVMMemcpy** 2476 /// 2477 /// @returns 2478 /// - ::ZE_RESULT_SUCCESS 2479 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2480 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2481 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2482 /// + `nullptr == hCommandList` 2483 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2484 /// + `nullptr == dstptr` 2485 /// + `nullptr == srcptr` 2486 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2487 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2488 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 2489 ZE_APIEXPORT ze_result_t ZE_APICALL 2490 zeCommandListAppendMemoryCopy( 2491 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 2492 void* dstptr, ///< [in] pointer to destination memory to copy to 2493 const void* srcptr, ///< [in] pointer to source memory to copy from 2494 size_t size, ///< [in] size in bytes to copy 2495 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 2496 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 2497 ///< if `nullptr == phWaitEvents` 2498 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 2499 ///< on before launching 2500 ); 2501 2502 /////////////////////////////////////////////////////////////////////////////// 2503 /// @brief Initializes host, device, or shared memory. 2504 /// 2505 /// @details 2506 /// - The application must ensure the memory pointed to by dstptr is 2507 /// accessible by the device on which the command list was created. 2508 /// - The implementation must not access the memory pointed to by dstptr as 2509 /// it is free to be modified by either the Host or device up until 2510 /// execution. 2511 /// - The value to initialize memory to is described by the pattern and the 2512 /// pattern size. 2513 /// - The pattern size must be a power-of-two and less than or equal to 2514 /// ::ze_command_queue_group_properties_t.maxMemoryFillPatternSize. 2515 /// - The application must ensure the events are accessible by the device on 2516 /// which the command list was created. 2517 /// - The application must ensure the command list and events were created, 2518 /// and the memory was allocated, on the same context. 2519 /// - The application must **not** call this function from simultaneous 2520 /// threads with the same command list handle. 2521 /// - The implementation of this function should be lock-free. 2522 /// 2523 /// @remarks 2524 /// _Analogues_ 2525 /// - **clEnqueueFillBuffer** 2526 /// - **clEnqueueSVMMemFill** 2527 /// 2528 /// @returns 2529 /// - ::ZE_RESULT_SUCCESS 2530 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2531 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2532 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2533 /// + `nullptr == hCommandList` 2534 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2535 /// + `nullptr == ptr` 2536 /// + `nullptr == pattern` 2537 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2538 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2539 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 2540 ZE_APIEXPORT ze_result_t ZE_APICALL 2541 zeCommandListAppendMemoryFill( 2542 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 2543 void* ptr, ///< [in] pointer to memory to initialize 2544 const void* pattern, ///< [in] pointer to value to initialize memory to 2545 size_t pattern_size, ///< [in] size in bytes of the value to initialize memory to 2546 size_t size, ///< [in] size in bytes to initialize 2547 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 2548 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 2549 ///< if `nullptr == phWaitEvents` 2550 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 2551 ///< on before launching 2552 ); 2553 2554 /////////////////////////////////////////////////////////////////////////////// 2555 /// @brief Copy region descriptor 2556 typedef struct _ze_copy_region_t 2557 { 2558 uint32_t originX; ///< [in] The origin x offset for region in bytes 2559 uint32_t originY; ///< [in] The origin y offset for region in rows 2560 uint32_t originZ; ///< [in] The origin z offset for region in slices 2561 uint32_t width; ///< [in] The region width relative to origin in bytes 2562 uint32_t height; ///< [in] The region height relative to origin in rows 2563 uint32_t depth; ///< [in] The region depth relative to origin in slices. Set this to 0 for 2564 ///< 2D copy. 2565 2566 } ze_copy_region_t; 2567 2568 /////////////////////////////////////////////////////////////////////////////// 2569 /// @brief Copies a region from a 2D or 3D array of host, device, or shared 2570 /// memory. 2571 /// 2572 /// @details 2573 /// - The application must ensure the memory pointed to by dstptr and srcptr 2574 /// is accessible by the device on which the command list was created. 2575 /// - The implementation must not access the memory pointed to by dstptr and 2576 /// srcptr as they are free to be modified by either the Host or device up 2577 /// until execution. 2578 /// - The region width, height, and depth for both src and dst must be same. 2579 /// The origins can be different. 2580 /// - The src and dst regions cannot be overlapping. 2581 /// - The application must ensure the events are accessible by the device on 2582 /// which the command list was created. 2583 /// - The application must ensure the command list and events were created, 2584 /// and the memory was allocated, on the same context. 2585 /// - The application must **not** call this function from simultaneous 2586 /// threads with the same command list handle. 2587 /// - The implementation of this function should be lock-free. 2588 /// 2589 /// @returns 2590 /// - ::ZE_RESULT_SUCCESS 2591 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2592 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2593 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2594 /// + `nullptr == hCommandList` 2595 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2596 /// + `nullptr == dstptr` 2597 /// + `nullptr == dstRegion` 2598 /// + `nullptr == srcptr` 2599 /// + `nullptr == srcRegion` 2600 /// - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS 2601 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2602 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2603 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 2604 ZE_APIEXPORT ze_result_t ZE_APICALL 2605 zeCommandListAppendMemoryCopyRegion( 2606 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 2607 void* dstptr, ///< [in] pointer to destination memory to copy to 2608 const ze_copy_region_t* dstRegion, ///< [in] pointer to destination region to copy to 2609 uint32_t dstPitch, ///< [in] destination pitch in bytes 2610 uint32_t dstSlicePitch, ///< [in] destination slice pitch in bytes. This is required for 3D region 2611 ///< copies where ::ze_copy_region_t.depth is not 0, otherwise it's 2612 ///< ignored. 2613 const void* srcptr, ///< [in] pointer to source memory to copy from 2614 const ze_copy_region_t* srcRegion, ///< [in] pointer to source region to copy from 2615 uint32_t srcPitch, ///< [in] source pitch in bytes 2616 uint32_t srcSlicePitch, ///< [in] source slice pitch in bytes. This is required for 3D region 2617 ///< copies where ::ze_copy_region_t.depth is not 0, otherwise it's 2618 ///< ignored. 2619 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 2620 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 2621 ///< if `nullptr == phWaitEvents` 2622 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 2623 ///< on before launching 2624 ); 2625 2626 /////////////////////////////////////////////////////////////////////////////// 2627 /// @brief Copies host, device, or shared memory from another context. 2628 /// 2629 /// @details 2630 /// - The current active and source context must be from the same driver. 2631 /// - The application must ensure the memory pointed to by dstptr and srcptr 2632 /// is accessible by the device on which the command list was created. 2633 /// - The implementation must not access the memory pointed to by dstptr and 2634 /// srcptr as they are free to be modified by either the Host or device up 2635 /// until execution. 2636 /// - The application must ensure the events are accessible by the device on 2637 /// which the command list was created. 2638 /// - The application must ensure the command list and events were created, 2639 /// and the memory was allocated, on the same context. 2640 /// - The application must **not** call this function from simultaneous 2641 /// threads with the same command list handle. 2642 /// - The implementation of this function should be lock-free. 2643 /// 2644 /// @returns 2645 /// - ::ZE_RESULT_SUCCESS 2646 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2647 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2648 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2649 /// + `nullptr == hCommandList` 2650 /// + `nullptr == hContextSrc` 2651 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2652 /// + `nullptr == dstptr` 2653 /// + `nullptr == srcptr` 2654 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2655 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2656 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 2657 ZE_APIEXPORT ze_result_t ZE_APICALL 2658 zeCommandListAppendMemoryCopyFromContext( 2659 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 2660 void* dstptr, ///< [in] pointer to destination memory to copy to 2661 ze_context_handle_t hContextSrc, ///< [in] handle of source context object 2662 const void* srcptr, ///< [in] pointer to source memory to copy from 2663 size_t size, ///< [in] size in bytes to copy 2664 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 2665 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 2666 ///< if `nullptr == phWaitEvents` 2667 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 2668 ///< on before launching 2669 ); 2670 2671 /////////////////////////////////////////////////////////////////////////////// 2672 /// @brief Copies an image. 2673 /// 2674 /// @details 2675 /// - The application must ensure the image and events are accessible by the 2676 /// device on which the command list was created. 2677 /// - The application must ensure the image format descriptors for both 2678 /// source and destination images are the same. 2679 /// - The application must ensure the command list, images and events were 2680 /// created on the same context. 2681 /// - The application must **not** call this function from simultaneous 2682 /// threads with the same command list handle. 2683 /// - The implementation of this function should be lock-free. 2684 /// 2685 /// @remarks 2686 /// _Analogues_ 2687 /// - **clEnqueueCopyImage** 2688 /// 2689 /// @returns 2690 /// - ::ZE_RESULT_SUCCESS 2691 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2692 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2693 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2694 /// + `nullptr == hCommandList` 2695 /// + `nullptr == hDstImage` 2696 /// + `nullptr == hSrcImage` 2697 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2698 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2699 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 2700 ZE_APIEXPORT ze_result_t ZE_APICALL 2701 zeCommandListAppendImageCopy( 2702 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 2703 ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to 2704 ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from 2705 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 2706 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 2707 ///< if `nullptr == phWaitEvents` 2708 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 2709 ///< on before launching 2710 ); 2711 2712 /////////////////////////////////////////////////////////////////////////////// 2713 /// @brief Region descriptor 2714 typedef struct _ze_image_region_t 2715 { 2716 uint32_t originX; ///< [in] The origin x offset for region in pixels 2717 uint32_t originY; ///< [in] The origin y offset for region in pixels 2718 uint32_t originZ; ///< [in] The origin z offset for region in pixels 2719 uint32_t width; ///< [in] The region width relative to origin in pixels 2720 uint32_t height; ///< [in] The region height relative to origin in pixels 2721 uint32_t depth; ///< [in] The region depth relative to origin. For 1D or 2D images, set 2722 ///< this to 1. 2723 2724 } ze_image_region_t; 2725 2726 /////////////////////////////////////////////////////////////////////////////// 2727 /// @brief Copies a region of an image to another image. 2728 /// 2729 /// @details 2730 /// - The application must ensure the image and events are accessible by the 2731 /// device on which the command list was created. 2732 /// - The region width and height for both src and dst must be same. The 2733 /// origins can be different. 2734 /// - The src and dst regions cannot be overlapping. 2735 /// - The application must ensure the image format descriptors for both 2736 /// source and destination images are the same. 2737 /// - The application must ensure the command list, images and events were 2738 /// created, and the memory was allocated, on the same context. 2739 /// - The application must **not** call this function from simultaneous 2740 /// threads with the same command list handle. 2741 /// - The implementation of this function should be lock-free. 2742 /// 2743 /// @returns 2744 /// - ::ZE_RESULT_SUCCESS 2745 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2746 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2747 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2748 /// + `nullptr == hCommandList` 2749 /// + `nullptr == hDstImage` 2750 /// + `nullptr == hSrcImage` 2751 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2752 /// - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS 2753 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2754 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 2755 ZE_APIEXPORT ze_result_t ZE_APICALL 2756 zeCommandListAppendImageCopyRegion( 2757 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 2758 ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to 2759 ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from 2760 const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor 2761 const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor 2762 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 2763 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 2764 ///< if `nullptr == phWaitEvents` 2765 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 2766 ///< on before launching 2767 ); 2768 2769 /////////////////////////////////////////////////////////////////////////////// 2770 /// @brief Copies from an image to device or shared memory. 2771 /// 2772 /// @details 2773 /// - The application must ensure the memory pointed to by dstptr is 2774 /// accessible by the device on which the command list was created. 2775 /// - The implementation must not access the memory pointed to by dstptr as 2776 /// it is free to be modified by either the Host or device up until 2777 /// execution. 2778 /// - The application must ensure the image and events are accessible by the 2779 /// device on which the command list was created. 2780 /// - The application must ensure the image format descriptor for the source 2781 /// image is a single-planar format. 2782 /// - The application must ensure the command list, image and events were 2783 /// created, and the memory was allocated, on the same context. 2784 /// - The application must **not** call this function from simultaneous 2785 /// threads with the same command list handle. 2786 /// - The implementation of this function should be lock-free. 2787 /// 2788 /// @remarks 2789 /// _Analogues_ 2790 /// - clEnqueueReadImage 2791 /// 2792 /// @returns 2793 /// - ::ZE_RESULT_SUCCESS 2794 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2795 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2796 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2797 /// + `nullptr == hCommandList` 2798 /// + `nullptr == hSrcImage` 2799 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2800 /// + `nullptr == dstptr` 2801 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2802 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2803 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 2804 ZE_APIEXPORT ze_result_t ZE_APICALL 2805 zeCommandListAppendImageCopyToMemory( 2806 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 2807 void* dstptr, ///< [in] pointer to destination memory to copy to 2808 ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from 2809 const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor 2810 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 2811 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 2812 ///< if `nullptr == phWaitEvents` 2813 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 2814 ///< on before launching 2815 ); 2816 2817 /////////////////////////////////////////////////////////////////////////////// 2818 /// @brief Copies to an image from device or shared memory. 2819 /// 2820 /// @details 2821 /// - The application must ensure the memory pointed to by srcptr is 2822 /// accessible by the device on which the command list was created. 2823 /// - The implementation must not access the memory pointed to by srcptr as 2824 /// it is free to be modified by either the Host or device up until 2825 /// execution. 2826 /// - The application must ensure the image and events are accessible by the 2827 /// device on which the command list was created. 2828 /// - The application must ensure the image format descriptor for the 2829 /// destination image is a single-planar format. 2830 /// - The application must ensure the command list, image and events were 2831 /// created, and the memory was allocated, on the same context. 2832 /// - The application must **not** call this function from simultaneous 2833 /// threads with the same command list handle. 2834 /// - The implementation of this function should be lock-free. 2835 /// 2836 /// @remarks 2837 /// _Analogues_ 2838 /// - clEnqueueWriteImage 2839 /// 2840 /// @returns 2841 /// - ::ZE_RESULT_SUCCESS 2842 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2843 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2844 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2845 /// + `nullptr == hCommandList` 2846 /// + `nullptr == hDstImage` 2847 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2848 /// + `nullptr == srcptr` 2849 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 2850 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 2851 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 2852 ZE_APIEXPORT ze_result_t ZE_APICALL 2853 zeCommandListAppendImageCopyFromMemory( 2854 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 2855 ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to 2856 const void* srcptr, ///< [in] pointer to source memory to copy from 2857 const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor 2858 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 2859 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 2860 ///< if `nullptr == phWaitEvents` 2861 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 2862 ///< on before launching 2863 ); 2864 2865 /////////////////////////////////////////////////////////////////////////////// 2866 /// @brief Asynchronously prefetches shared memory to the device associated with 2867 /// the specified command list 2868 /// 2869 /// @details 2870 /// - This is a hint to improve performance only and is not required for 2871 /// correctness. 2872 /// - Only prefetching to the device associated with the specified command 2873 /// list is supported. 2874 /// Prefetching to the host or to a peer device is not supported. 2875 /// - Prefetching may not be supported for all allocation types for all devices. 2876 /// If memory prefetching is not supported for the specified memory range 2877 /// the prefetch hint may be ignored. 2878 /// - Prefetching may only be supported at a device-specific granularity, 2879 /// such as at a page boundary. 2880 /// In this case, the memory range may be expanded such that the start and 2881 /// end of the range satisfy granularity requirements. 2882 /// - The application must ensure the memory pointed to by ptr is accessible 2883 /// by the device on which the command list was created. 2884 /// - The application must ensure the command list was created, and the 2885 /// memory was allocated, on the same context. 2886 /// - The application must **not** call this function from simultaneous 2887 /// threads with the same command list handle. 2888 /// - The implementation of this function should be lock-free. 2889 /// 2890 /// @remarks 2891 /// _Analogues_ 2892 /// - clEnqueueSVMMigrateMem 2893 /// 2894 /// @returns 2895 /// - ::ZE_RESULT_SUCCESS 2896 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2897 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2898 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2899 /// + `nullptr == hCommandList` 2900 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2901 /// + `nullptr == ptr` 2902 ZE_APIEXPORT ze_result_t ZE_APICALL 2903 zeCommandListAppendMemoryPrefetch( 2904 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 2905 const void* ptr, ///< [in] pointer to start of the memory range to prefetch 2906 size_t size ///< [in] size in bytes of the memory range to prefetch 2907 ); 2908 2909 /////////////////////////////////////////////////////////////////////////////// 2910 /// @brief Supported memory advice hints 2911 typedef enum _ze_memory_advice_t 2912 { 2913 ZE_MEMORY_ADVICE_SET_READ_MOSTLY = 0, ///< hint that memory will be read from frequently and written to rarely 2914 ZE_MEMORY_ADVICE_CLEAR_READ_MOSTLY = 1, ///< removes the affect of ::ZE_MEMORY_ADVICE_SET_READ_MOSTLY 2915 ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION = 2, ///< hint that the preferred memory location is the specified device 2916 ZE_MEMORY_ADVICE_CLEAR_PREFERRED_LOCATION = 3, ///< removes the affect of ::ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION 2917 ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY = 4, ///< hints that memory will mostly be accessed non-atomically 2918 ZE_MEMORY_ADVICE_CLEAR_NON_ATOMIC_MOSTLY = 5, ///< removes the affect of ::ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY 2919 ZE_MEMORY_ADVICE_BIAS_CACHED = 6, ///< hints that memory should be cached 2920 ZE_MEMORY_ADVICE_BIAS_UNCACHED = 7, ///< hints that memory should be not be cached 2921 ZE_MEMORY_ADVICE_FORCE_UINT32 = 0x7fffffff 2922 2923 } ze_memory_advice_t; 2924 2925 /////////////////////////////////////////////////////////////////////////////// 2926 /// @brief Provides advice about the use of a shared memory range 2927 /// 2928 /// @details 2929 /// - Memory advice is a performance hint only and is not required for 2930 /// functional correctness. 2931 /// - Memory advice can be used to override driver heuristics to explicitly 2932 /// control shared memory behavior. 2933 /// - Not all memory advice hints may be supported for all allocation types 2934 /// for all devices. 2935 /// If a memory advice hint is not supported by the device it will be ignored. 2936 /// - Memory advice may only be supported at a device-specific granularity, 2937 /// such as at a page boundary. 2938 /// In this case, the memory range may be expanded such that the start and 2939 /// end of the range satisfy granularity requirements. 2940 /// - The application must ensure the memory pointed to by ptr is accessible 2941 /// by the device on which the command list was created. 2942 /// - The application must ensure the command list was created, and memory 2943 /// was allocated, on the same context. 2944 /// - The application must **not** call this function from simultaneous 2945 /// threads with the same command list handle, and the memory was 2946 /// allocated. 2947 /// - The implementation of this function should be lock-free. 2948 /// 2949 /// @returns 2950 /// - ::ZE_RESULT_SUCCESS 2951 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 2952 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 2953 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 2954 /// + `nullptr == hCommandList` 2955 /// + `nullptr == hDevice` 2956 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 2957 /// + `nullptr == ptr` 2958 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 2959 /// + `::ZE_MEMORY_ADVICE_BIAS_UNCACHED < advice` 2960 ZE_APIEXPORT ze_result_t ZE_APICALL 2961 zeCommandListAppendMemAdvise( 2962 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 2963 ze_device_handle_t hDevice, ///< [in] device associated with the memory advice 2964 const void* ptr, ///< [in] Pointer to the start of the memory range 2965 size_t size, ///< [in] Size in bytes of the memory range 2966 ze_memory_advice_t advice ///< [in] Memory advice for the memory range 2967 ); 2968 2969 #if !defined(__GNUC__) 2970 #pragma endregion 2971 #endif 2972 // Intel 'oneAPI' Level-Zero APIs for Event 2973 #if !defined(__GNUC__) 2974 #pragma region event 2975 #endif 2976 /////////////////////////////////////////////////////////////////////////////// 2977 /// @brief Supported event pool creation flags 2978 typedef uint32_t ze_event_pool_flags_t; 2979 typedef enum _ze_event_pool_flag_t 2980 { 2981 ZE_EVENT_POOL_FLAG_HOST_VISIBLE = ZE_BIT(0), ///< signals and waits are also visible to host 2982 ZE_EVENT_POOL_FLAG_IPC = ZE_BIT(1), ///< signals and waits may be shared across processes 2983 ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP = ZE_BIT(2),///< Indicates all events in pool will contain kernel timestamps; cannot be 2984 ///< combined with ::ZE_EVENT_POOL_FLAG_IPC 2985 ZE_EVENT_POOL_FLAG_FORCE_UINT32 = 0x7fffffff 2986 2987 } ze_event_pool_flag_t; 2988 2989 /////////////////////////////////////////////////////////////////////////////// 2990 /// @brief Event pool descriptor 2991 typedef struct _ze_event_pool_desc_t 2992 { 2993 ze_structure_type_t stype; ///< [in] type of this structure 2994 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 2995 ///< structure (i.e. contains sType and pNext). 2996 ze_event_pool_flags_t flags; ///< [in] creation flags. 2997 ///< must be 0 (default) or a valid combination of ::ze_event_pool_flag_t; 2998 ///< default behavior is signals and waits are visible to the entire device 2999 ///< and peer devices. 3000 uint32_t count; ///< [in] number of events within the pool; must be greater than 0 3001 3002 } ze_event_pool_desc_t; 3003 3004 /////////////////////////////////////////////////////////////////////////////// 3005 /// @brief Creates a pool of events on the context. 3006 /// 3007 /// @details 3008 /// - The application must only use events within the pool for the 3009 /// device(s), or their sub-devices, which were provided during creation. 3010 /// - The application may call this function from simultaneous threads. 3011 /// - The implementation of this function must be thread-safe. 3012 /// 3013 /// @returns 3014 /// - ::ZE_RESULT_SUCCESS 3015 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3016 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3017 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3018 /// + `nullptr == hContext` 3019 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 3020 /// + `nullptr == desc` 3021 /// + `nullptr == phEventPool` 3022 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 3023 /// + `0x7 < desc->flags` 3024 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 3025 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 3026 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 3027 /// + `0 == desc->count` 3028 /// + `(nullptr == phDevices) && (0 < numDevices)` 3029 ZE_APIEXPORT ze_result_t ZE_APICALL 3030 zeEventPoolCreate( 3031 ze_context_handle_t hContext, ///< [in] handle of the context object 3032 const ze_event_pool_desc_t* desc, ///< [in] pointer to event pool descriptor 3033 uint32_t numDevices, ///< [in][optional] number of device handles; must be 0 if `nullptr == 3034 ///< phDevices` 3035 ze_device_handle_t* phDevices, ///< [in][optional][range(0, numDevices)] array of device handles which 3036 ///< have visibility to the event pool. 3037 ///< if nullptr, then event pool is visible to all devices supported by the 3038 ///< driver instance. 3039 ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created 3040 ); 3041 3042 /////////////////////////////////////////////////////////////////////////////// 3043 /// @brief Deletes an event pool object. 3044 /// 3045 /// @details 3046 /// - The application must destroy all event handles created from the pool 3047 /// before destroying the pool itself. 3048 /// - The application must ensure the device is not currently referencing 3049 /// the any event within the pool before it is deleted. 3050 /// - The implementation of this function may immediately free all Host and 3051 /// Device allocations associated with this event pool. 3052 /// - The application must **not** call this function from simultaneous 3053 /// threads with the same event pool handle. 3054 /// - The implementation of this function must be thread-safe. 3055 /// 3056 /// @returns 3057 /// - ::ZE_RESULT_SUCCESS 3058 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3059 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3060 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3061 /// + `nullptr == hEventPool` 3062 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 3063 ZE_APIEXPORT ze_result_t ZE_APICALL 3064 zeEventPoolDestroy( 3065 ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object to destroy 3066 ); 3067 3068 /////////////////////////////////////////////////////////////////////////////// 3069 /// @brief Supported event scope flags 3070 typedef uint32_t ze_event_scope_flags_t; 3071 typedef enum _ze_event_scope_flag_t 3072 { 3073 ZE_EVENT_SCOPE_FLAG_SUBDEVICE = ZE_BIT(0), ///< cache hierarchies are flushed or invalidated sufficient for local 3074 ///< sub-device access 3075 ZE_EVENT_SCOPE_FLAG_DEVICE = ZE_BIT(1), ///< cache hierarchies are flushed or invalidated sufficient for global 3076 ///< device access and peer device access 3077 ZE_EVENT_SCOPE_FLAG_HOST = ZE_BIT(2), ///< cache hierarchies are flushed or invalidated sufficient for device and 3078 ///< host access 3079 ZE_EVENT_SCOPE_FLAG_FORCE_UINT32 = 0x7fffffff 3080 3081 } ze_event_scope_flag_t; 3082 3083 /////////////////////////////////////////////////////////////////////////////// 3084 /// @brief Event descriptor 3085 typedef struct _ze_event_desc_t 3086 { 3087 ze_structure_type_t stype; ///< [in] type of this structure 3088 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 3089 ///< structure (i.e. contains sType and pNext). 3090 uint32_t index; ///< [in] index of the event within the pool; must be less-than the count 3091 ///< specified during pool creation 3092 ze_event_scope_flags_t signal; ///< [in] defines the scope of relevant cache hierarchies to flush on a 3093 ///< signal action before the event is triggered. 3094 ///< must be 0 (default) or a valid combination of ::ze_event_scope_flag_t; 3095 ///< default behavior is synchronization within the command list only, no 3096 ///< additional cache hierarchies are flushed. 3097 ze_event_scope_flags_t wait; ///< [in] defines the scope of relevant cache hierarchies to invalidate on 3098 ///< a wait action after the event is complete. 3099 ///< must be 0 (default) or a valid combination of ::ze_event_scope_flag_t; 3100 ///< default behavior is synchronization within the command list only, no 3101 ///< additional cache hierarchies are invalidated. 3102 3103 } ze_event_desc_t; 3104 3105 /////////////////////////////////////////////////////////////////////////////// 3106 /// @brief Creates an event from the pool. 3107 /// 3108 /// @details 3109 /// - An event is used to communicate fine-grain host-to-device, 3110 /// device-to-host or device-to-device dependencies have completed. 3111 /// - The application must ensure the location in the pool is not being used 3112 /// by another event. 3113 /// - The application must **not** call this function from simultaneous 3114 /// threads with the same event pool handle. 3115 /// - The implementation of this function should be lock-free. 3116 /// 3117 /// @remarks 3118 /// _Analogues_ 3119 /// - **clCreateUserEvent** 3120 /// - vkCreateEvent 3121 /// 3122 /// @returns 3123 /// - ::ZE_RESULT_SUCCESS 3124 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3125 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3126 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3127 /// + `nullptr == hEventPool` 3128 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 3129 /// + `nullptr == desc` 3130 /// + `nullptr == phEvent` 3131 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 3132 /// + `0x7 < desc->signal` 3133 /// + `0x7 < desc->wait` 3134 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 3135 ZE_APIEXPORT ze_result_t ZE_APICALL 3136 zeEventCreate( 3137 ze_event_pool_handle_t hEventPool, ///< [in] handle of the event pool 3138 const ze_event_desc_t* desc, ///< [in] pointer to event descriptor 3139 ze_event_handle_t* phEvent ///< [out] pointer to handle of event object created 3140 ); 3141 3142 /////////////////////////////////////////////////////////////////////////////// 3143 /// @brief Deletes an event object. 3144 /// 3145 /// @details 3146 /// - The application must ensure the device is not currently referencing 3147 /// the event before it is deleted. 3148 /// - The implementation of this function may immediately free all Host and 3149 /// Device allocations associated with this event. 3150 /// - The application must **not** call this function from simultaneous 3151 /// threads with the same event handle. 3152 /// - The implementation of this function should be lock-free. 3153 /// 3154 /// @remarks 3155 /// _Analogues_ 3156 /// - **clReleaseEvent** 3157 /// - vkDestroyEvent 3158 /// 3159 /// @returns 3160 /// - ::ZE_RESULT_SUCCESS 3161 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3162 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3163 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3164 /// + `nullptr == hEvent` 3165 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 3166 ZE_APIEXPORT ze_result_t ZE_APICALL 3167 zeEventDestroy( 3168 ze_event_handle_t hEvent ///< [in][release] handle of event object to destroy 3169 ); 3170 3171 /////////////////////////////////////////////////////////////////////////////// 3172 /// @brief Gets an IPC event pool handle for the specified event handle that can 3173 /// be shared with another process. 3174 /// 3175 /// @details 3176 /// - Event pool must have been created with ::ZE_EVENT_POOL_FLAG_IPC. 3177 /// - The application may call this function from simultaneous threads. 3178 /// 3179 /// @returns 3180 /// - ::ZE_RESULT_SUCCESS 3181 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3182 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3183 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3184 /// + `nullptr == hEventPool` 3185 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 3186 /// + `nullptr == phIpc` 3187 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3188 ZE_APIEXPORT ze_result_t ZE_APICALL 3189 zeEventPoolGetIpcHandle( 3190 ze_event_pool_handle_t hEventPool, ///< [in] handle of event pool object 3191 ze_ipc_event_pool_handle_t* phIpc ///< [out] Returned IPC event handle 3192 ); 3193 3194 /////////////////////////////////////////////////////////////////////////////// 3195 /// @brief Opens an IPC event pool handle to retrieve an event pool handle from 3196 /// another process. 3197 /// 3198 /// @details 3199 /// - Multiple calls to this function with the same IPC handle will return 3200 /// unique event pool handles. 3201 /// - The event handle in this process should not be freed with 3202 /// ::zeEventPoolDestroy, but rather with ::zeEventPoolCloseIpcHandle. 3203 /// - The application may call this function from simultaneous threads. 3204 /// 3205 /// @returns 3206 /// - ::ZE_RESULT_SUCCESS 3207 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3208 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3209 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3210 /// + `nullptr == hContext` 3211 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 3212 /// + `nullptr == phEventPool` 3213 ZE_APIEXPORT ze_result_t ZE_APICALL 3214 zeEventPoolOpenIpcHandle( 3215 ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event pool 3216 ///< handle 3217 ze_ipc_event_pool_handle_t hIpc, ///< [in] IPC event pool handle 3218 ze_event_pool_handle_t* phEventPool ///< [out] pointer handle of event pool object created 3219 ); 3220 3221 /////////////////////////////////////////////////////////////////////////////// 3222 /// @brief Closes an IPC event handle in the current process. 3223 /// 3224 /// @details 3225 /// - Closes an IPC event handle by destroying events that were opened in 3226 /// this process using ::zeEventPoolOpenIpcHandle. 3227 /// - The application must **not** call this function from simultaneous 3228 /// threads with the same event pool handle. 3229 /// 3230 /// @returns 3231 /// - ::ZE_RESULT_SUCCESS 3232 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3233 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3234 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3235 /// + `nullptr == hEventPool` 3236 ZE_APIEXPORT ze_result_t ZE_APICALL 3237 zeEventPoolCloseIpcHandle( 3238 ze_event_pool_handle_t hEventPool ///< [in][release] handle of event pool object 3239 ); 3240 3241 /////////////////////////////////////////////////////////////////////////////// 3242 /// @brief Appends a signal of the event from the device into a command list. 3243 /// 3244 /// @details 3245 /// - The application must ensure the events are accessible by the device on 3246 /// which the command list was created. 3247 /// - The duration of an event created from an event pool that was created 3248 /// using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag is undefined. 3249 /// However, for consistency and orthogonality the event will report 3250 /// correctly as signaled when used by other event API functionality. 3251 /// - The application must ensure the command list and events were created 3252 /// on the same context. 3253 /// - The application must **not** call this function from simultaneous 3254 /// threads with the same command list handle. 3255 /// - The implementation of this function should be lock-free. 3256 /// 3257 /// @remarks 3258 /// _Analogues_ 3259 /// - **clSetUserEventStatus** 3260 /// - vkCmdSetEvent 3261 /// 3262 /// @returns 3263 /// - ::ZE_RESULT_SUCCESS 3264 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3265 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3266 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3267 /// + `nullptr == hCommandList` 3268 /// + `nullptr == hEvent` 3269 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3270 ZE_APIEXPORT ze_result_t ZE_APICALL 3271 zeCommandListAppendSignalEvent( 3272 ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 3273 ze_event_handle_t hEvent ///< [in] handle of the event 3274 ); 3275 3276 /////////////////////////////////////////////////////////////////////////////// 3277 /// @brief Appends wait on event(s) on the device into a command list. 3278 /// 3279 /// @details 3280 /// - The application must ensure the events are accessible by the device on 3281 /// which the command list was created. 3282 /// - The application must ensure the command list and events were created 3283 /// on the same context. 3284 /// - The application must **not** call this function from simultaneous 3285 /// threads with the same command list handle. 3286 /// - The implementation of this function should be lock-free. 3287 /// 3288 /// @returns 3289 /// - ::ZE_RESULT_SUCCESS 3290 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3291 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3292 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3293 /// + `nullptr == hCommandList` 3294 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 3295 /// + `nullptr == phEvents` 3296 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3297 ZE_APIEXPORT ze_result_t ZE_APICALL 3298 zeCommandListAppendWaitOnEvents( 3299 ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 3300 uint32_t numEvents, ///< [in] number of events to wait on before continuing 3301 ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before 3302 ///< continuing 3303 ); 3304 3305 /////////////////////////////////////////////////////////////////////////////// 3306 /// @brief Signals a event from host. 3307 /// 3308 /// @details 3309 /// - The duration of an event created from an event pool that was created 3310 /// using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag is undefined. 3311 /// However, for consistency and orthogonality the event will report 3312 /// correctly as signaled when used by other event API functionality. 3313 /// - The application may call this function from simultaneous threads. 3314 /// - The implementation of this function should be lock-free. 3315 /// 3316 /// @remarks 3317 /// _Analogues_ 3318 /// - clSetUserEventStatus 3319 /// 3320 /// @returns 3321 /// - ::ZE_RESULT_SUCCESS 3322 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3323 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3324 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3325 /// + `nullptr == hEvent` 3326 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3327 ZE_APIEXPORT ze_result_t ZE_APICALL 3328 zeEventHostSignal( 3329 ze_event_handle_t hEvent ///< [in] handle of the event 3330 ); 3331 3332 /////////////////////////////////////////////////////////////////////////////// 3333 /// @brief The current host thread waits on an event to be signaled. 3334 /// 3335 /// @details 3336 /// - The application may call this function from simultaneous threads. 3337 /// - The implementation of this function should be lock-free. 3338 /// 3339 /// @remarks 3340 /// _Analogues_ 3341 /// - clWaitForEvents 3342 /// 3343 /// @returns 3344 /// - ::ZE_RESULT_SUCCESS 3345 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3346 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3347 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3348 /// + `nullptr == hEvent` 3349 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3350 /// - ::ZE_RESULT_NOT_READY 3351 /// + timeout expired 3352 ZE_APIEXPORT ze_result_t ZE_APICALL 3353 zeEventHostSynchronize( 3354 ze_event_handle_t hEvent, ///< [in] handle of the event 3355 uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to 3356 ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; 3357 ///< if zero, then operates exactly like ::zeEventQueryStatus; 3358 ///< if UINT64_MAX, then function will not return until complete or device 3359 ///< is lost. 3360 ///< Due to external dependencies, timeout may be rounded to the closest 3361 ///< value allowed by the accuracy of those dependencies. 3362 ); 3363 3364 /////////////////////////////////////////////////////////////////////////////// 3365 /// @brief Queries an event object's status on the host. 3366 /// 3367 /// @details 3368 /// - The application may call this function from simultaneous threads. 3369 /// - The implementation of this function should be lock-free. 3370 /// 3371 /// @remarks 3372 /// _Analogues_ 3373 /// - **clGetEventInfo** 3374 /// - vkGetEventStatus 3375 /// 3376 /// @returns 3377 /// - ::ZE_RESULT_SUCCESS 3378 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3379 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3380 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3381 /// + `nullptr == hEvent` 3382 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3383 /// - ::ZE_RESULT_NOT_READY 3384 /// + not signaled 3385 ZE_APIEXPORT ze_result_t ZE_APICALL 3386 zeEventQueryStatus( 3387 ze_event_handle_t hEvent ///< [in] handle of the event 3388 ); 3389 3390 /////////////////////////////////////////////////////////////////////////////// 3391 /// @brief Appends a reset of an event back to not signaled state into a command 3392 /// list. 3393 /// 3394 /// @details 3395 /// - The application must ensure the events are accessible by the device on 3396 /// which the command list was created. 3397 /// - The application must ensure the command list and events were created 3398 /// on the same context. 3399 /// - The application must **not** call this function from simultaneous 3400 /// threads with the same command list handle. 3401 /// - The implementation of this function should be lock-free. 3402 /// 3403 /// @remarks 3404 /// _Analogues_ 3405 /// - vkResetEvent 3406 /// 3407 /// @returns 3408 /// - ::ZE_RESULT_SUCCESS 3409 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3410 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3411 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3412 /// + `nullptr == hCommandList` 3413 /// + `nullptr == hEvent` 3414 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3415 ZE_APIEXPORT ze_result_t ZE_APICALL 3416 zeCommandListAppendEventReset( 3417 ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 3418 ze_event_handle_t hEvent ///< [in] handle of the event 3419 ); 3420 3421 /////////////////////////////////////////////////////////////////////////////// 3422 /// @brief The current host thread resets an event back to not signaled state. 3423 /// 3424 /// @details 3425 /// - The application may call this function from simultaneous threads. 3426 /// - The implementation of this function should be lock-free. 3427 /// 3428 /// @remarks 3429 /// _Analogues_ 3430 /// - vkResetEvent 3431 /// 3432 /// @returns 3433 /// - ::ZE_RESULT_SUCCESS 3434 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3435 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3436 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3437 /// + `nullptr == hEvent` 3438 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3439 ZE_APIEXPORT ze_result_t ZE_APICALL 3440 zeEventHostReset( 3441 ze_event_handle_t hEvent ///< [in] handle of the event 3442 ); 3443 3444 /////////////////////////////////////////////////////////////////////////////// 3445 /// @brief Kernel timestamp clock data 3446 /// 3447 /// @details 3448 /// - The timestamp frequency can be queried from 3449 /// ::ze_device_properties_t.timerResolution. 3450 /// - The number of valid bits in the timestamp value can be queried from 3451 /// ::ze_device_properties_t.kernelTimestampValidBits. 3452 typedef struct _ze_kernel_timestamp_data_t 3453 { 3454 uint64_t kernelStart; ///< [out] device clock at start of kernel execution 3455 uint64_t kernelEnd; ///< [out] device clock at end of kernel execution 3456 3457 } ze_kernel_timestamp_data_t; 3458 3459 /////////////////////////////////////////////////////////////////////////////// 3460 /// @brief Kernel timestamp result 3461 typedef struct _ze_kernel_timestamp_result_t 3462 { 3463 ze_kernel_timestamp_data_t global; ///< [out] wall-clock data 3464 ze_kernel_timestamp_data_t context; ///< [out] context-active data; only includes clocks while device context 3465 ///< was actively executing. 3466 3467 } ze_kernel_timestamp_result_t; 3468 3469 /////////////////////////////////////////////////////////////////////////////// 3470 /// @brief Queries an event's timestamp value on the host. 3471 /// 3472 /// @details 3473 /// - The application must ensure the event was created from an event pool 3474 /// that was created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag. 3475 /// - The destination memory will be unmodified if the event has not been 3476 /// signaled. 3477 /// - The application may call this function from simultaneous threads. 3478 /// - The implementation of this function should be lock-free. 3479 /// 3480 /// @returns 3481 /// - ::ZE_RESULT_SUCCESS 3482 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3483 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3484 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3485 /// + `nullptr == hEvent` 3486 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 3487 /// + `nullptr == dstptr` 3488 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3489 /// - ::ZE_RESULT_NOT_READY 3490 /// + not signaled 3491 ZE_APIEXPORT ze_result_t ZE_APICALL 3492 zeEventQueryKernelTimestamp( 3493 ze_event_handle_t hEvent, ///< [in] handle of the event 3494 ze_kernel_timestamp_result_t* dstptr ///< [in,out] pointer to memory for where timestamp result will be written. 3495 ); 3496 3497 /////////////////////////////////////////////////////////////////////////////// 3498 /// @brief Appends a query of an events' timestamp value(s) into a command list. 3499 /// 3500 /// @details 3501 /// - The application must ensure the events are accessible by the device on 3502 /// which the command list was created. 3503 /// - The application must ensure the events were created from an event pool 3504 /// that was created using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP flag. 3505 /// - The application must ensure the memory pointed to by both dstptr and 3506 /// pOffsets is accessible by the device on which the command list was 3507 /// created. 3508 /// - The value(s) written to the destination buffer are undefined if any 3509 /// timestamp event has not been signaled. 3510 /// - If pOffsets is nullptr, then multiple results will be appended 3511 /// sequentially into memory in the same order as phEvents. 3512 /// - The application must ensure the command list and events were created, 3513 /// and the memory was allocated, on the same context. 3514 /// - The application must **not** call this function from simultaneous 3515 /// threads with the same command list handle. 3516 /// - The implementation of this function should be lock-free. 3517 /// 3518 /// @returns 3519 /// - ::ZE_RESULT_SUCCESS 3520 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3521 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3522 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3523 /// + `nullptr == hCommandList` 3524 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 3525 /// + `nullptr == phEvents` 3526 /// + `nullptr == dstptr` 3527 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3528 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 3529 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 3530 ZE_APIEXPORT ze_result_t ZE_APICALL 3531 zeCommandListAppendQueryKernelTimestamps( 3532 ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 3533 uint32_t numEvents, ///< [in] the number of timestamp events to query 3534 ze_event_handle_t* phEvents, ///< [in][range(0, numEvents)] handles of timestamp events to query 3535 void* dstptr, ///< [in,out] pointer to memory where ::ze_kernel_timestamp_result_t will 3536 ///< be written; must be size-aligned. 3537 const size_t* pOffsets, ///< [in][optional][range(0, numEvents)] offset, in bytes, to write 3538 ///< results; address must be 4byte-aligned and offsets must be 3539 ///< size-aligned. 3540 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 3541 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before executing query; 3542 ///< must be 0 if `nullptr == phWaitEvents` 3543 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 3544 ///< on before executing query 3545 ); 3546 3547 #if !defined(__GNUC__) 3548 #pragma endregion 3549 #endif 3550 // Intel 'oneAPI' Level-Zero APIs for Fence 3551 #if !defined(__GNUC__) 3552 #pragma region fence 3553 #endif 3554 /////////////////////////////////////////////////////////////////////////////// 3555 /// @brief Supported fence creation flags 3556 typedef uint32_t ze_fence_flags_t; 3557 typedef enum _ze_fence_flag_t 3558 { 3559 ZE_FENCE_FLAG_SIGNALED = ZE_BIT(0), ///< fence is created in the signaled state, otherwise not signaled. 3560 ZE_FENCE_FLAG_FORCE_UINT32 = 0x7fffffff 3561 3562 } ze_fence_flag_t; 3563 3564 /////////////////////////////////////////////////////////////////////////////// 3565 /// @brief Fence descriptor 3566 typedef struct _ze_fence_desc_t 3567 { 3568 ze_structure_type_t stype; ///< [in] type of this structure 3569 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 3570 ///< structure (i.e. contains sType and pNext). 3571 ze_fence_flags_t flags; ///< [in] creation flags. 3572 ///< must be 0 (default) or a valid combination of ::ze_fence_flag_t. 3573 3574 } ze_fence_desc_t; 3575 3576 /////////////////////////////////////////////////////////////////////////////// 3577 /// @brief Creates a fence for the command queue. 3578 /// 3579 /// @details 3580 /// - A fence is a heavyweight synchronization primitive used to communicate 3581 /// to the host that command list execution has completed. 3582 /// - The application must only use the fence for the command queue which 3583 /// was provided during creation. 3584 /// - The application may call this function from simultaneous threads. 3585 /// - The implementation of this function must be thread-safe. 3586 /// 3587 /// @remarks 3588 /// _Analogues_ 3589 /// - **vkCreateFence** 3590 /// 3591 /// @returns 3592 /// - ::ZE_RESULT_SUCCESS 3593 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3594 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3595 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3596 /// + `nullptr == hCommandQueue` 3597 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 3598 /// + `nullptr == desc` 3599 /// + `nullptr == phFence` 3600 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 3601 /// + `0x1 < desc->flags` 3602 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 3603 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 3604 ZE_APIEXPORT ze_result_t ZE_APICALL 3605 zeFenceCreate( 3606 ze_command_queue_handle_t hCommandQueue, ///< [in] handle of command queue 3607 const ze_fence_desc_t* desc, ///< [in] pointer to fence descriptor 3608 ze_fence_handle_t* phFence ///< [out] pointer to handle of fence object created 3609 ); 3610 3611 /////////////////////////////////////////////////////////////////////////////// 3612 /// @brief Deletes a fence object. 3613 /// 3614 /// @details 3615 /// - The application must ensure the device is not currently referencing 3616 /// the fence before it is deleted. 3617 /// - The implementation of this function may immediately free all Host and 3618 /// Device allocations associated with this fence. 3619 /// - The application must **not** call this function from simultaneous 3620 /// threads with the same fence handle. 3621 /// - The implementation of this function must be thread-safe. 3622 /// 3623 /// @remarks 3624 /// _Analogues_ 3625 /// - **vkDestroyFence** 3626 /// 3627 /// @returns 3628 /// - ::ZE_RESULT_SUCCESS 3629 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3630 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3631 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3632 /// + `nullptr == hFence` 3633 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 3634 ZE_APIEXPORT ze_result_t ZE_APICALL 3635 zeFenceDestroy( 3636 ze_fence_handle_t hFence ///< [in][release] handle of fence object to destroy 3637 ); 3638 3639 /////////////////////////////////////////////////////////////////////////////// 3640 /// @brief The current host thread waits on a fence to be signaled. 3641 /// 3642 /// @details 3643 /// - The application may call this function from simultaneous threads. 3644 /// - The implementation of this function should be lock-free. 3645 /// 3646 /// @remarks 3647 /// _Analogues_ 3648 /// - **vkWaitForFences** 3649 /// 3650 /// @returns 3651 /// - ::ZE_RESULT_SUCCESS 3652 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3653 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3654 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3655 /// + `nullptr == hFence` 3656 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3657 /// - ::ZE_RESULT_NOT_READY 3658 /// + timeout expired 3659 ZE_APIEXPORT ze_result_t ZE_APICALL 3660 zeFenceHostSynchronize( 3661 ze_fence_handle_t hFence, ///< [in] handle of the fence 3662 uint64_t timeout ///< [in] if non-zero, then indicates the maximum time (in nanoseconds) to 3663 ///< yield before returning ::ZE_RESULT_SUCCESS or ::ZE_RESULT_NOT_READY; 3664 ///< if zero, then operates exactly like ::zeFenceQueryStatus; 3665 ///< if UINT64_MAX, then function will not return until complete or device 3666 ///< is lost. 3667 ///< Due to external dependencies, timeout may be rounded to the closest 3668 ///< value allowed by the accuracy of those dependencies. 3669 ); 3670 3671 /////////////////////////////////////////////////////////////////////////////// 3672 /// @brief Queries a fence object's status. 3673 /// 3674 /// @details 3675 /// - The application may call this function from simultaneous threads. 3676 /// - The implementation of this function should be lock-free. 3677 /// 3678 /// @remarks 3679 /// _Analogues_ 3680 /// - **vkGetFenceStatus** 3681 /// 3682 /// @returns 3683 /// - ::ZE_RESULT_SUCCESS 3684 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3685 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3686 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3687 /// + `nullptr == hFence` 3688 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 3689 /// - ::ZE_RESULT_NOT_READY 3690 /// + not signaled 3691 ZE_APIEXPORT ze_result_t ZE_APICALL 3692 zeFenceQueryStatus( 3693 ze_fence_handle_t hFence ///< [in] handle of the fence 3694 ); 3695 3696 /////////////////////////////////////////////////////////////////////////////// 3697 /// @brief Reset a fence back to the not signaled state. 3698 /// 3699 /// @details 3700 /// - The application may call this function from simultaneous threads. 3701 /// - The implementation of this function should be lock-free. 3702 /// 3703 /// @remarks 3704 /// _Analogues_ 3705 /// - **vkResetFences** 3706 /// 3707 /// @returns 3708 /// - ::ZE_RESULT_SUCCESS 3709 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3710 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3711 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3712 /// + `nullptr == hFence` 3713 ZE_APIEXPORT ze_result_t ZE_APICALL 3714 zeFenceReset( 3715 ze_fence_handle_t hFence ///< [in] handle of the fence 3716 ); 3717 3718 #if !defined(__GNUC__) 3719 #pragma endregion 3720 #endif 3721 // Intel 'oneAPI' Level-Zero APIs for Images 3722 #if !defined(__GNUC__) 3723 #pragma region image 3724 #endif 3725 /////////////////////////////////////////////////////////////////////////////// 3726 /// @brief Supported image creation flags 3727 typedef uint32_t ze_image_flags_t; 3728 typedef enum _ze_image_flag_t 3729 { 3730 ZE_IMAGE_FLAG_KERNEL_WRITE = ZE_BIT(0), ///< kernels will write contents 3731 ZE_IMAGE_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache contents 3732 ZE_IMAGE_FLAG_FORCE_UINT32 = 0x7fffffff 3733 3734 } ze_image_flag_t; 3735 3736 /////////////////////////////////////////////////////////////////////////////// 3737 /// @brief Supported image types 3738 typedef enum _ze_image_type_t 3739 { 3740 ZE_IMAGE_TYPE_1D = 0, ///< 1D 3741 ZE_IMAGE_TYPE_1DARRAY = 1, ///< 1D array 3742 ZE_IMAGE_TYPE_2D = 2, ///< 2D 3743 ZE_IMAGE_TYPE_2DARRAY = 3, ///< 2D array 3744 ZE_IMAGE_TYPE_3D = 4, ///< 3D 3745 ZE_IMAGE_TYPE_BUFFER = 5, ///< Buffer 3746 ZE_IMAGE_TYPE_FORCE_UINT32 = 0x7fffffff 3747 3748 } ze_image_type_t; 3749 3750 /////////////////////////////////////////////////////////////////////////////// 3751 /// @brief Supported image format layouts 3752 typedef enum _ze_image_format_layout_t 3753 { 3754 ZE_IMAGE_FORMAT_LAYOUT_8 = 0, ///< 8-bit single component layout 3755 ZE_IMAGE_FORMAT_LAYOUT_16 = 1, ///< 16-bit single component layout 3756 ZE_IMAGE_FORMAT_LAYOUT_32 = 2, ///< 32-bit single component layout 3757 ZE_IMAGE_FORMAT_LAYOUT_8_8 = 3, ///< 2-component 8-bit layout 3758 ZE_IMAGE_FORMAT_LAYOUT_8_8_8_8 = 4, ///< 4-component 8-bit layout 3759 ZE_IMAGE_FORMAT_LAYOUT_16_16 = 5, ///< 2-component 16-bit layout 3760 ZE_IMAGE_FORMAT_LAYOUT_16_16_16_16 = 6, ///< 4-component 16-bit layout 3761 ZE_IMAGE_FORMAT_LAYOUT_32_32 = 7, ///< 2-component 32-bit layout 3762 ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32 = 8, ///< 4-component 32-bit layout 3763 ZE_IMAGE_FORMAT_LAYOUT_10_10_10_2 = 9, ///< 4-component 10_10_10_2 layout 3764 ZE_IMAGE_FORMAT_LAYOUT_11_11_10 = 10, ///< 3-component 11_11_10 layout 3765 ZE_IMAGE_FORMAT_LAYOUT_5_6_5 = 11, ///< 3-component 5_6_5 layout 3766 ZE_IMAGE_FORMAT_LAYOUT_5_5_5_1 = 12, ///< 4-component 5_5_5_1 layout 3767 ZE_IMAGE_FORMAT_LAYOUT_4_4_4_4 = 13, ///< 4-component 4_4_4_4 layout 3768 ZE_IMAGE_FORMAT_LAYOUT_Y8 = 14, ///< Media Format: Y8. Format type and swizzle is ignored for this. 3769 ZE_IMAGE_FORMAT_LAYOUT_NV12 = 15, ///< Media Format: NV12. Format type and swizzle is ignored for this. 3770 ZE_IMAGE_FORMAT_LAYOUT_YUYV = 16, ///< Media Format: YUYV. Format type and swizzle is ignored for this. 3771 ZE_IMAGE_FORMAT_LAYOUT_VYUY = 17, ///< Media Format: VYUY. Format type and swizzle is ignored for this. 3772 ZE_IMAGE_FORMAT_LAYOUT_YVYU = 18, ///< Media Format: YVYU. Format type and swizzle is ignored for this. 3773 ZE_IMAGE_FORMAT_LAYOUT_UYVY = 19, ///< Media Format: UYVY. Format type and swizzle is ignored for this. 3774 ZE_IMAGE_FORMAT_LAYOUT_AYUV = 20, ///< Media Format: AYUV. Format type and swizzle is ignored for this. 3775 ZE_IMAGE_FORMAT_LAYOUT_P010 = 21, ///< Media Format: P010. Format type and swizzle is ignored for this. 3776 ZE_IMAGE_FORMAT_LAYOUT_Y410 = 22, ///< Media Format: Y410. Format type and swizzle is ignored for this. 3777 ZE_IMAGE_FORMAT_LAYOUT_P012 = 23, ///< Media Format: P012. Format type and swizzle is ignored for this. 3778 ZE_IMAGE_FORMAT_LAYOUT_Y16 = 24, ///< Media Format: Y16. Format type and swizzle is ignored for this. 3779 ZE_IMAGE_FORMAT_LAYOUT_P016 = 25, ///< Media Format: P016. Format type and swizzle is ignored for this. 3780 ZE_IMAGE_FORMAT_LAYOUT_Y216 = 26, ///< Media Format: Y216. Format type and swizzle is ignored for this. 3781 ZE_IMAGE_FORMAT_LAYOUT_P216 = 27, ///< Media Format: P216. Format type and swizzle is ignored for this. 3782 ZE_IMAGE_FORMAT_LAYOUT_P8 = 28, ///< Media Format: P8. Format type and swizzle is ignored for this. 3783 ZE_IMAGE_FORMAT_LAYOUT_YUY2 = 29, ///< Media Format: YUY2. Format type and swizzle is ignored for this. 3784 ZE_IMAGE_FORMAT_LAYOUT_A8P8 = 30, ///< Media Format: A8P8. Format type and swizzle is ignored for this. 3785 ZE_IMAGE_FORMAT_LAYOUT_IA44 = 31, ///< Media Format: IA44. Format type and swizzle is ignored for this. 3786 ZE_IMAGE_FORMAT_LAYOUT_AI44 = 32, ///< Media Format: AI44. Format type and swizzle is ignored for this. 3787 ZE_IMAGE_FORMAT_LAYOUT_Y416 = 33, ///< Media Format: Y416. Format type and swizzle is ignored for this. 3788 ZE_IMAGE_FORMAT_LAYOUT_Y210 = 34, ///< Media Format: Y210. Format type and swizzle is ignored for this. 3789 ZE_IMAGE_FORMAT_LAYOUT_I420 = 35, ///< Media Format: I420. Format type and swizzle is ignored for this. 3790 ZE_IMAGE_FORMAT_LAYOUT_YV12 = 36, ///< Media Format: YV12. Format type and swizzle is ignored for this. 3791 ZE_IMAGE_FORMAT_LAYOUT_400P = 37, ///< Media Format: 400P. Format type and swizzle is ignored for this. 3792 ZE_IMAGE_FORMAT_LAYOUT_422H = 38, ///< Media Format: 422H. Format type and swizzle is ignored for this. 3793 ZE_IMAGE_FORMAT_LAYOUT_422V = 39, ///< Media Format: 422V. Format type and swizzle is ignored for this. 3794 ZE_IMAGE_FORMAT_LAYOUT_444P = 40, ///< Media Format: 444P. Format type and swizzle is ignored for this. 3795 ZE_IMAGE_FORMAT_LAYOUT_RGBP = 41, ///< Media Format: RGBP. Format type and swizzle is ignored for this. 3796 ZE_IMAGE_FORMAT_LAYOUT_BRGP = 42, ///< Media Format: BRGP. Format type and swizzle is ignored for this. 3797 ZE_IMAGE_FORMAT_LAYOUT_FORCE_UINT32 = 0x7fffffff 3798 3799 } ze_image_format_layout_t; 3800 3801 /////////////////////////////////////////////////////////////////////////////// 3802 /// @brief Supported image format types 3803 typedef enum _ze_image_format_type_t 3804 { 3805 ZE_IMAGE_FORMAT_TYPE_UINT = 0, ///< Unsigned integer 3806 ZE_IMAGE_FORMAT_TYPE_SINT = 1, ///< Signed integer 3807 ZE_IMAGE_FORMAT_TYPE_UNORM = 2, ///< Unsigned normalized integer 3808 ZE_IMAGE_FORMAT_TYPE_SNORM = 3, ///< Signed normalized integer 3809 ZE_IMAGE_FORMAT_TYPE_FLOAT = 4, ///< Float 3810 ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32 = 0x7fffffff 3811 3812 } ze_image_format_type_t; 3813 3814 /////////////////////////////////////////////////////////////////////////////// 3815 /// @brief Supported image format component swizzle into channel 3816 typedef enum _ze_image_format_swizzle_t 3817 { 3818 ZE_IMAGE_FORMAT_SWIZZLE_R = 0, ///< Red component 3819 ZE_IMAGE_FORMAT_SWIZZLE_G = 1, ///< Green component 3820 ZE_IMAGE_FORMAT_SWIZZLE_B = 2, ///< Blue component 3821 ZE_IMAGE_FORMAT_SWIZZLE_A = 3, ///< Alpha component 3822 ZE_IMAGE_FORMAT_SWIZZLE_0 = 4, ///< Zero 3823 ZE_IMAGE_FORMAT_SWIZZLE_1 = 5, ///< One 3824 ZE_IMAGE_FORMAT_SWIZZLE_X = 6, ///< Don't care 3825 ZE_IMAGE_FORMAT_SWIZZLE_FORCE_UINT32 = 0x7fffffff 3826 3827 } ze_image_format_swizzle_t; 3828 3829 /////////////////////////////////////////////////////////////////////////////// 3830 /// @brief Image format 3831 typedef struct _ze_image_format_t 3832 { 3833 ze_image_format_layout_t layout; ///< [in] image format component layout 3834 ze_image_format_type_t type; ///< [in] image format type. Media formats can't be used for 3835 ///< ::ZE_IMAGE_TYPE_BUFFER. 3836 ze_image_format_swizzle_t x; ///< [in] image component swizzle into channel x 3837 ze_image_format_swizzle_t y; ///< [in] image component swizzle into channel y 3838 ze_image_format_swizzle_t z; ///< [in] image component swizzle into channel z 3839 ze_image_format_swizzle_t w; ///< [in] image component swizzle into channel w 3840 3841 } ze_image_format_t; 3842 3843 /////////////////////////////////////////////////////////////////////////////// 3844 /// @brief Image descriptor 3845 typedef struct _ze_image_desc_t 3846 { 3847 ze_structure_type_t stype; ///< [in] type of this structure 3848 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 3849 ///< structure (i.e. contains sType and pNext). 3850 ze_image_flags_t flags; ///< [in] creation flags. 3851 ///< must be 0 (default) or a valid combination of ::ze_image_flag_t; 3852 ///< default is read-only, cached access. 3853 ze_image_type_t type; ///< [in] image type 3854 ze_image_format_t format; ///< [in] image format 3855 uint64_t width; ///< [in] width dimension. 3856 ///< ::ZE_IMAGE_TYPE_BUFFER: size in bytes; see 3857 ///< ::ze_device_image_properties_t.maxImageBufferSize for limits. 3858 ///< ::ZE_IMAGE_TYPE_1D, ::ZE_IMAGE_TYPE_1DARRAY: width in pixels; see 3859 ///< ::ze_device_image_properties_t.maxImageDims1D for limits. 3860 ///< ::ZE_IMAGE_TYPE_2D, ::ZE_IMAGE_TYPE_2DARRAY: width in pixels; see 3861 ///< ::ze_device_image_properties_t.maxImageDims2D for limits. 3862 ///< ::ZE_IMAGE_TYPE_3D: width in pixels; see 3863 ///< ::ze_device_image_properties_t.maxImageDims3D for limits. 3864 uint32_t height; ///< [in] height dimension. 3865 ///< ::ZE_IMAGE_TYPE_2D, ::ZE_IMAGE_TYPE_2DARRAY: height in pixels; see 3866 ///< ::ze_device_image_properties_t.maxImageDims2D for limits. 3867 ///< ::ZE_IMAGE_TYPE_3D: height in pixels; see 3868 ///< ::ze_device_image_properties_t.maxImageDims3D for limits. 3869 ///< other: ignored. 3870 uint32_t depth; ///< [in] depth dimension. 3871 ///< ::ZE_IMAGE_TYPE_3D: depth in pixels; see 3872 ///< ::ze_device_image_properties_t.maxImageDims3D for limits. 3873 ///< other: ignored. 3874 uint32_t arraylevels; ///< [in] array levels. 3875 ///< ::ZE_IMAGE_TYPE_1DARRAY, ::ZE_IMAGE_TYPE_2DARRAY: see 3876 ///< ::ze_device_image_properties_t.maxImageArraySlices for limits. 3877 ///< other: ignored. 3878 uint32_t miplevels; ///< [in] mipmap levels (must be 0) 3879 3880 } ze_image_desc_t; 3881 3882 /////////////////////////////////////////////////////////////////////////////// 3883 /// @brief Supported sampler filtering flags 3884 typedef uint32_t ze_image_sampler_filter_flags_t; 3885 typedef enum _ze_image_sampler_filter_flag_t 3886 { 3887 ZE_IMAGE_SAMPLER_FILTER_FLAG_POINT = ZE_BIT(0), ///< device supports point filtering 3888 ZE_IMAGE_SAMPLER_FILTER_FLAG_LINEAR = ZE_BIT(1),///< device supports linear filtering 3889 ZE_IMAGE_SAMPLER_FILTER_FLAG_FORCE_UINT32 = 0x7fffffff 3890 3891 } ze_image_sampler_filter_flag_t; 3892 3893 /////////////////////////////////////////////////////////////////////////////// 3894 /// @brief Image properties 3895 typedef struct _ze_image_properties_t 3896 { 3897 ze_structure_type_t stype; ///< [in] type of this structure 3898 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 3899 ///< structure (i.e. contains sType and pNext). 3900 ze_image_sampler_filter_flags_t samplerFilterFlags; ///< [out] supported sampler filtering. 3901 ///< returns 0 (unsupported) or a combination of ::ze_image_sampler_filter_flag_t. 3902 3903 } ze_image_properties_t; 3904 3905 /////////////////////////////////////////////////////////////////////////////// 3906 /// @brief Retrieves supported properties of an image. 3907 /// 3908 /// @details 3909 /// - The application may call this function from simultaneous threads. 3910 /// - The implementation of this function should be lock-free. 3911 /// 3912 /// @returns 3913 /// - ::ZE_RESULT_SUCCESS 3914 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3915 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3916 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3917 /// + `nullptr == hDevice` 3918 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 3919 /// + `nullptr == desc` 3920 /// + `nullptr == pImageProperties` 3921 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 3922 /// + `0x3 < desc->flags` 3923 /// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` 3924 ZE_APIEXPORT ze_result_t ZE_APICALL 3925 zeImageGetProperties( 3926 ze_device_handle_t hDevice, ///< [in] handle of the device 3927 const ze_image_desc_t* desc, ///< [in] pointer to image descriptor 3928 ze_image_properties_t* pImageProperties ///< [out] pointer to image properties 3929 ); 3930 3931 /////////////////////////////////////////////////////////////////////////////// 3932 /// @brief Creates an image on the context. 3933 /// 3934 /// @details 3935 /// - The application must only use the image for the device, or its 3936 /// sub-devices, which was provided during creation. 3937 /// - The application may call this function from simultaneous threads. 3938 /// - The implementation of this function must be thread-safe. 3939 /// 3940 /// @remarks 3941 /// _Analogues_ 3942 /// - clCreateImage 3943 /// 3944 /// @returns 3945 /// - ::ZE_RESULT_SUCCESS 3946 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3947 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3948 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3949 /// + `nullptr == hContext` 3950 /// + `nullptr == hDevice` 3951 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 3952 /// + `nullptr == desc` 3953 /// + `nullptr == phImage` 3954 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 3955 /// + `0x3 < desc->flags` 3956 /// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` 3957 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT 3958 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 3959 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 3960 ZE_APIEXPORT ze_result_t ZE_APICALL 3961 zeImageCreate( 3962 ze_context_handle_t hContext, ///< [in] handle of the context object 3963 ze_device_handle_t hDevice, ///< [in] handle of the device 3964 const ze_image_desc_t* desc, ///< [in] pointer to image descriptor 3965 ze_image_handle_t* phImage ///< [out] pointer to handle of image object created 3966 ); 3967 3968 /////////////////////////////////////////////////////////////////////////////// 3969 /// @brief Deletes an image object. 3970 /// 3971 /// @details 3972 /// - The application must ensure the device is not currently referencing 3973 /// the image before it is deleted. 3974 /// - The implementation of this function may immediately free all Host and 3975 /// Device allocations associated with this image. 3976 /// - The application must **not** call this function from simultaneous 3977 /// threads with the same image handle. 3978 /// - The implementation of this function must be thread-safe. 3979 /// 3980 /// @returns 3981 /// - ::ZE_RESULT_SUCCESS 3982 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 3983 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 3984 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 3985 /// + `nullptr == hImage` 3986 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 3987 ZE_APIEXPORT ze_result_t ZE_APICALL 3988 zeImageDestroy( 3989 ze_image_handle_t hImage ///< [in][release] handle of image object to destroy 3990 ); 3991 3992 #if !defined(__GNUC__) 3993 #pragma endregion 3994 #endif 3995 // Intel 'oneAPI' Level-Zero APIs for Memory 3996 #if !defined(__GNUC__) 3997 #pragma region memory 3998 #endif 3999 /////////////////////////////////////////////////////////////////////////////// 4000 /// @brief Supported memory allocation flags 4001 typedef uint32_t ze_device_mem_alloc_flags_t; 4002 typedef enum _ze_device_mem_alloc_flag_t 4003 { 4004 ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation 4005 ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) 4006 ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(2),///< optimize shared allocation for first access on the device 4007 ZE_DEVICE_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff 4008 4009 } ze_device_mem_alloc_flag_t; 4010 4011 /////////////////////////////////////////////////////////////////////////////// 4012 /// @brief Device memory allocation descriptor 4013 typedef struct _ze_device_mem_alloc_desc_t 4014 { 4015 ze_structure_type_t stype; ///< [in] type of this structure 4016 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 4017 ///< structure (i.e. contains sType and pNext). 4018 ze_device_mem_alloc_flags_t flags; ///< [in] flags specifying additional allocation controls. 4019 ///< must be 0 (default) or a valid combination of ::ze_device_mem_alloc_flag_t; 4020 ///< default behavior may use implicit driver-based heuristics. 4021 uint32_t ordinal; ///< [in] ordinal of the device's local memory to allocate from. 4022 ///< must be less than the count returned from ::zeDeviceGetMemoryProperties. 4023 4024 } ze_device_mem_alloc_desc_t; 4025 4026 /////////////////////////////////////////////////////////////////////////////// 4027 /// @brief Supported host memory allocation flags 4028 typedef uint32_t ze_host_mem_alloc_flags_t; 4029 typedef enum _ze_host_mem_alloc_flag_t 4030 { 4031 ZE_HOST_MEM_ALLOC_FLAG_BIAS_CACHED = ZE_BIT(0), ///< host should cache allocation 4032 ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< host should not cache allocation (UC) 4033 ZE_HOST_MEM_ALLOC_FLAG_BIAS_WRITE_COMBINED = ZE_BIT(2), ///< host memory should be allocated write-combined (WC) 4034 ZE_HOST_MEM_ALLOC_FLAG_BIAS_INITIAL_PLACEMENT = ZE_BIT(3), ///< optimize shared allocation for first access on the host 4035 ZE_HOST_MEM_ALLOC_FLAG_FORCE_UINT32 = 0x7fffffff 4036 4037 } ze_host_mem_alloc_flag_t; 4038 4039 /////////////////////////////////////////////////////////////////////////////// 4040 /// @brief Host memory allocation descriptor 4041 typedef struct _ze_host_mem_alloc_desc_t 4042 { 4043 ze_structure_type_t stype; ///< [in] type of this structure 4044 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 4045 ///< structure (i.e. contains sType and pNext). 4046 ze_host_mem_alloc_flags_t flags; ///< [in] flags specifying additional allocation controls. 4047 ///< must be 0 (default) or a valid combination of ::ze_host_mem_alloc_flag_t; 4048 ///< default behavior may use implicit driver-based heuristics. 4049 4050 } ze_host_mem_alloc_desc_t; 4051 4052 /////////////////////////////////////////////////////////////////////////////// 4053 /// @brief Allocates shared memory on the context. 4054 /// 4055 /// @details 4056 /// - Shared allocations share ownership between the host and one or more 4057 /// devices. 4058 /// - Shared allocations may optionally be associated with a device by 4059 /// passing a handle to the device. 4060 /// - Devices supporting only single-device shared access capabilities may 4061 /// access shared memory associated with the device. 4062 /// For these devices, ownership of the allocation is shared between the 4063 /// host and the associated device only. 4064 /// - Passing nullptr as the device handle does not associate the shared 4065 /// allocation with any device. 4066 /// For allocations with no associated device, ownership of the allocation 4067 /// is shared between the host and all devices supporting cross-device 4068 /// shared access capabilities. 4069 /// - The application must only use the memory allocation for the context 4070 /// and device, or its sub-devices, which was provided during allocation. 4071 /// - The application may call this function from simultaneous threads. 4072 /// - The implementation of this function must be thread-safe. 4073 /// 4074 /// @returns 4075 /// - ::ZE_RESULT_SUCCESS 4076 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4077 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4078 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4079 /// + `nullptr == hContext` 4080 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4081 /// + `nullptr == device_desc` 4082 /// + `nullptr == host_desc` 4083 /// + `nullptr == pptr` 4084 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 4085 /// + `0x7 < device_desc->flags` 4086 /// + `0xf < host_desc->flags` 4087 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE 4088 /// + `0 == size` 4089 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT 4090 /// + Must be zero or a power-of-two 4091 /// + `0 != (alignment & (alignment - 1))` 4092 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 4093 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 4094 ZE_APIEXPORT ze_result_t ZE_APICALL 4095 zeMemAllocShared( 4096 ze_context_handle_t hContext, ///< [in] handle of the context object 4097 const ze_device_mem_alloc_desc_t* device_desc, ///< [in] pointer to device memory allocation descriptor 4098 const ze_host_mem_alloc_desc_t* host_desc, ///< [in] pointer to host memory allocation descriptor 4099 size_t size, ///< [in] size in bytes to allocate; must be less-than 4100 ///< ::ze_device_properties_t.maxMemAllocSize. 4101 size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of 4102 ///< two. 4103 ze_device_handle_t hDevice, ///< [in][optional] device handle to associate with 4104 void** pptr ///< [out] pointer to shared allocation 4105 ); 4106 4107 /////////////////////////////////////////////////////////////////////////////// 4108 /// @brief Allocates device memory on the context. 4109 /// 4110 /// @details 4111 /// - Device allocations are owned by a specific device. 4112 /// - In general, a device allocation may only be accessed by the device 4113 /// that owns it. 4114 /// - The application must only use the memory allocation for the context 4115 /// and device, or its sub-devices, which was provided during allocation. 4116 /// - The application may call this function from simultaneous threads. 4117 /// - The implementation of this function must be thread-safe. 4118 /// 4119 /// @returns 4120 /// - ::ZE_RESULT_SUCCESS 4121 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4122 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4123 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4124 /// + `nullptr == hContext` 4125 /// + `nullptr == hDevice` 4126 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4127 /// + `nullptr == device_desc` 4128 /// + `nullptr == pptr` 4129 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 4130 /// + `0x7 < device_desc->flags` 4131 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE 4132 /// + `0 == size` 4133 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT 4134 /// + Must be zero or a power-of-two 4135 /// + `0 != (alignment & (alignment - 1))` 4136 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 4137 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 4138 ZE_APIEXPORT ze_result_t ZE_APICALL 4139 zeMemAllocDevice( 4140 ze_context_handle_t hContext, ///< [in] handle of the context object 4141 const ze_device_mem_alloc_desc_t* device_desc, ///< [in] pointer to device memory allocation descriptor 4142 size_t size, ///< [in] size in bytes to allocate; must be less-than 4143 ///< ::ze_device_properties_t.maxMemAllocSize. 4144 size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of 4145 ///< two. 4146 ze_device_handle_t hDevice, ///< [in] handle of the device 4147 void** pptr ///< [out] pointer to device allocation 4148 ); 4149 4150 /////////////////////////////////////////////////////////////////////////////// 4151 /// @brief Allocates host memory on the context. 4152 /// 4153 /// @details 4154 /// - Host allocations are owned by the host process. 4155 /// - Host allocations are accessible by the host and all devices within the 4156 /// driver's context. 4157 /// - Host allocations are frequently used as staging areas to transfer data 4158 /// to or from devices. 4159 /// - The application must only use the memory allocation for the context 4160 /// which was provided during allocation. 4161 /// - The application may call this function from simultaneous threads. 4162 /// - The implementation of this function must be thread-safe. 4163 /// 4164 /// @returns 4165 /// - ::ZE_RESULT_SUCCESS 4166 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4167 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4168 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4169 /// + `nullptr == hContext` 4170 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4171 /// + `nullptr == host_desc` 4172 /// + `nullptr == pptr` 4173 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 4174 /// + `0xf < host_desc->flags` 4175 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE 4176 /// + `0 == size` 4177 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT 4178 /// + Must be zero or a power-of-two 4179 /// + `0 != (alignment & (alignment - 1))` 4180 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 4181 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 4182 ZE_APIEXPORT ze_result_t ZE_APICALL 4183 zeMemAllocHost( 4184 ze_context_handle_t hContext, ///< [in] handle of the context object 4185 const ze_host_mem_alloc_desc_t* host_desc, ///< [in] pointer to host memory allocation descriptor 4186 size_t size, ///< [in] size in bytes to allocate; must be less-than 4187 ///< ::ze_device_properties_t.maxMemAllocSize. 4188 size_t alignment, ///< [in] minimum alignment in bytes for the allocation; must be a power of 4189 ///< two. 4190 void** pptr ///< [out] pointer to host allocation 4191 ); 4192 4193 /////////////////////////////////////////////////////////////////////////////// 4194 /// @brief Frees allocated host memory, device memory, or shared memory on the 4195 /// context. 4196 /// 4197 /// @details 4198 /// - The application must ensure the device is not currently referencing 4199 /// the memory before it is freed 4200 /// - The implementation of this function may immediately free all Host and 4201 /// Device allocations associated with this memory 4202 /// - The application must **not** call this function from simultaneous 4203 /// threads with the same pointer. 4204 /// - The implementation of this function must be thread-safe. 4205 /// 4206 /// @returns 4207 /// - ::ZE_RESULT_SUCCESS 4208 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4209 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4210 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4211 /// + `nullptr == hContext` 4212 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4213 /// + `nullptr == ptr` 4214 ZE_APIEXPORT ze_result_t ZE_APICALL 4215 zeMemFree( 4216 ze_context_handle_t hContext, ///< [in] handle of the context object 4217 void* ptr ///< [in][release] pointer to memory to free 4218 ); 4219 4220 /////////////////////////////////////////////////////////////////////////////// 4221 /// @brief Memory allocation type 4222 typedef enum _ze_memory_type_t 4223 { 4224 ZE_MEMORY_TYPE_UNKNOWN = 0, ///< the memory pointed to is of unknown type 4225 ZE_MEMORY_TYPE_HOST = 1, ///< the memory pointed to is a host allocation 4226 ZE_MEMORY_TYPE_DEVICE = 2, ///< the memory pointed to is a device allocation 4227 ZE_MEMORY_TYPE_SHARED = 3, ///< the memory pointed to is a shared ownership allocation 4228 ZE_MEMORY_TYPE_FORCE_UINT32 = 0x7fffffff 4229 4230 } ze_memory_type_t; 4231 4232 /////////////////////////////////////////////////////////////////////////////// 4233 /// @brief Memory allocation properties queried using ::zeMemGetAllocProperties 4234 typedef struct _ze_memory_allocation_properties_t 4235 { 4236 ze_structure_type_t stype; ///< [in] type of this structure 4237 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 4238 ///< structure (i.e. contains sType and pNext). 4239 ze_memory_type_t type; ///< [out] type of allocated memory 4240 uint64_t id; ///< [out] identifier for this allocation 4241 uint64_t pageSize; ///< [out] page size used for allocation 4242 4243 } ze_memory_allocation_properties_t; 4244 4245 /////////////////////////////////////////////////////////////////////////////// 4246 /// @brief Retrieves attributes of a memory allocation 4247 /// 4248 /// @details 4249 /// - The application may call this function from simultaneous threads. 4250 /// - The application may query attributes of a memory allocation unrelated 4251 /// to the context. 4252 /// When this occurs, the returned allocation type will be 4253 /// ::ZE_MEMORY_TYPE_UNKNOWN, and the returned identifier and associated 4254 /// device is unspecified. 4255 /// 4256 /// @returns 4257 /// - ::ZE_RESULT_SUCCESS 4258 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4259 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4260 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4261 /// + `nullptr == hContext` 4262 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4263 /// + `nullptr == ptr` 4264 /// + `nullptr == pMemAllocProperties` 4265 ZE_APIEXPORT ze_result_t ZE_APICALL 4266 zeMemGetAllocProperties( 4267 ze_context_handle_t hContext, ///< [in] handle of the context object 4268 const void* ptr, ///< [in] memory pointer to query 4269 ze_memory_allocation_properties_t* pMemAllocProperties, ///< [in,out] query result for memory allocation properties 4270 ze_device_handle_t* phDevice ///< [out][optional] device associated with this allocation 4271 ); 4272 4273 /////////////////////////////////////////////////////////////////////////////// 4274 /// @brief Retrieves the base address and/or size of an allocation 4275 /// 4276 /// @details 4277 /// - The application may call this function from simultaneous threads. 4278 /// 4279 /// @returns 4280 /// - ::ZE_RESULT_SUCCESS 4281 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4282 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4283 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4284 /// + `nullptr == hContext` 4285 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4286 /// + `nullptr == ptr` 4287 ZE_APIEXPORT ze_result_t ZE_APICALL 4288 zeMemGetAddressRange( 4289 ze_context_handle_t hContext, ///< [in] handle of the context object 4290 const void* ptr, ///< [in] memory pointer to query 4291 void** pBase, ///< [in,out][optional] base address of the allocation 4292 size_t* pSize ///< [in,out][optional] size of the allocation 4293 ); 4294 4295 /////////////////////////////////////////////////////////////////////////////// 4296 /// @brief Creates an IPC memory handle for the specified allocation 4297 /// 4298 /// @details 4299 /// - Takes a pointer to a device memory allocation and creates an IPC 4300 /// memory handle for exporting it for use in another process. 4301 /// - The pointer must be base pointer of the device memory allocation; i.e. 4302 /// the value returned from ::zeMemAllocDevice. 4303 /// - The application may call this function from simultaneous threads. 4304 /// - The implementation of this function must be thread-safe. 4305 /// 4306 /// @returns 4307 /// - ::ZE_RESULT_SUCCESS 4308 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4309 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4310 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4311 /// + `nullptr == hContext` 4312 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4313 /// + `nullptr == ptr` 4314 /// + `nullptr == pIpcHandle` 4315 ZE_APIEXPORT ze_result_t ZE_APICALL 4316 zeMemGetIpcHandle( 4317 ze_context_handle_t hContext, ///< [in] handle of the context object 4318 const void* ptr, ///< [in] pointer to the device memory allocation 4319 ze_ipc_mem_handle_t* pIpcHandle ///< [out] Returned IPC memory handle 4320 ); 4321 4322 /////////////////////////////////////////////////////////////////////////////// 4323 /// @brief Supported IPC memory flags 4324 typedef uint32_t ze_ipc_memory_flags_t; 4325 typedef enum _ze_ipc_memory_flag_t 4326 { 4327 ZE_IPC_MEMORY_FLAG_BIAS_CACHED = ZE_BIT(0), ///< device should cache allocation 4328 ZE_IPC_MEMORY_FLAG_BIAS_UNCACHED = ZE_BIT(1), ///< device should not cache allocation (UC) 4329 ZE_IPC_MEMORY_FLAG_FORCE_UINT32 = 0x7fffffff 4330 4331 } ze_ipc_memory_flag_t; 4332 4333 /////////////////////////////////////////////////////////////////////////////// 4334 /// @brief Opens an IPC memory handle to retrieve a device pointer on the 4335 /// context. 4336 /// 4337 /// @details 4338 /// - Takes an IPC memory handle from a remote process and associates it 4339 /// with a device pointer usable in this process. 4340 /// - The device pointer in this process should not be freed with 4341 /// ::zeMemFree, but rather with ::zeMemCloseIpcHandle. 4342 /// - Multiple calls to this function with the same IPC handle will return 4343 /// unique pointers. 4344 /// - The application may call this function from simultaneous threads. 4345 /// - The implementation of this function must be thread-safe. 4346 /// 4347 /// @returns 4348 /// - ::ZE_RESULT_SUCCESS 4349 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4350 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4351 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4352 /// + `nullptr == hContext` 4353 /// + `nullptr == hDevice` 4354 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 4355 /// + `0x3 < flags` 4356 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4357 /// + `nullptr == pptr` 4358 ZE_APIEXPORT ze_result_t ZE_APICALL 4359 zeMemOpenIpcHandle( 4360 ze_context_handle_t hContext, ///< [in] handle of the context object 4361 ze_device_handle_t hDevice, ///< [in] handle of the device to associate with the IPC memory handle 4362 ze_ipc_mem_handle_t handle, ///< [in] IPC memory handle 4363 ze_ipc_memory_flags_t flags, ///< [in] flags controlling the operation. 4364 ///< must be 0 (default) or a valid combination of ::ze_ipc_memory_flag_t. 4365 void** pptr ///< [out] pointer to device allocation in this process 4366 ); 4367 4368 /////////////////////////////////////////////////////////////////////////////// 4369 /// @brief Closes an IPC memory handle 4370 /// 4371 /// @details 4372 /// - Closes an IPC memory handle by unmapping memory that was opened in 4373 /// this process using ::zeMemOpenIpcHandle. 4374 /// - The application must **not** call this function from simultaneous 4375 /// threads with the same pointer. 4376 /// - The implementation of this function must be thread-safe. 4377 /// 4378 /// @returns 4379 /// - ::ZE_RESULT_SUCCESS 4380 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4381 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4382 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4383 /// + `nullptr == hContext` 4384 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4385 /// + `nullptr == ptr` 4386 ZE_APIEXPORT ze_result_t ZE_APICALL 4387 zeMemCloseIpcHandle( 4388 ze_context_handle_t hContext, ///< [in] handle of the context object 4389 const void* ptr ///< [in][release] pointer to device allocation in this process 4390 ); 4391 4392 /////////////////////////////////////////////////////////////////////////////// 4393 /// @brief Additional allocation descriptor for exporting external memory 4394 /// 4395 /// @details 4396 /// - This structure may be passed to ::zeMemAllocDevice, via the `pNext` 4397 /// member of ::ze_device_mem_alloc_desc_t, to indicate an exportable 4398 /// memory allocation. 4399 /// - This structure may be passed to ::zeImageCreate, via the `pNext` 4400 /// member of ::ze_image_desc_t, to indicate an exportable image. 4401 typedef struct _ze_external_memory_export_desc_t 4402 { 4403 ze_structure_type_t stype; ///< [in] type of this structure 4404 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 4405 ///< structure (i.e. contains sType and pNext). 4406 ze_external_memory_type_flags_t flags; ///< [in] flags specifying memory export types for this allocation. 4407 ///< must be 0 (default) or a valid combination of ::ze_external_memory_type_flags_t 4408 4409 } ze_external_memory_export_desc_t; 4410 4411 /////////////////////////////////////////////////////////////////////////////// 4412 /// @brief Additional allocation descriptor for importing external memory as a 4413 /// file descriptor 4414 /// 4415 /// @details 4416 /// - This structure may be passed to ::zeMemAllocDevice, via the `pNext` 4417 /// member of ::ze_device_mem_alloc_desc_t, to import memory from a file 4418 /// descriptor. 4419 /// - This structure may be passed to ::zeImageCreate, via the `pNext` 4420 /// member of ::ze_image_desc_t, to import memory from a file descriptor. 4421 typedef struct _ze_external_memory_import_fd_t 4422 { 4423 ze_structure_type_t stype; ///< [in] type of this structure 4424 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 4425 ///< structure (i.e. contains sType and pNext). 4426 ze_external_memory_type_flags_t flags; ///< [in] flags specifying the memory import type for the file descriptor. 4427 ///< must be 0 (default) or a valid combination of ::ze_external_memory_type_flags_t 4428 int fd; ///< [in] the file descriptor handle to import 4429 4430 } ze_external_memory_import_fd_t; 4431 4432 /////////////////////////////////////////////////////////////////////////////// 4433 /// @brief Exports an allocation as a file descriptor 4434 /// 4435 /// @details 4436 /// - This structure may be passed to ::zeMemGetAllocProperties, via the 4437 /// `pNext` member of ::ze_memory_allocation_properties_t, to export a 4438 /// memory allocation as a file descriptor. 4439 /// - This structure may be passed to ::zeImageGetAllocPropertiesExt, via 4440 /// the `pNext` member of ::ze_image_allocation_ext_properties_t, to 4441 /// export an image as a file descriptor. 4442 /// - The requested memory export type must have been specified when the 4443 /// allocation was made. 4444 typedef struct _ze_external_memory_export_fd_t 4445 { 4446 ze_structure_type_t stype; ///< [in] type of this structure 4447 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 4448 ///< structure (i.e. contains sType and pNext). 4449 ze_external_memory_type_flags_t flags; ///< [in] flags specifying the memory export type for the file descriptor. 4450 ///< must be 0 (default) or a valid combination of ::ze_external_memory_type_flags_t 4451 int fd; ///< [out] the exported file descriptor handle representing the allocation. 4452 4453 } ze_external_memory_export_fd_t; 4454 4455 /////////////////////////////////////////////////////////////////////////////// 4456 /// @brief Additional allocation descriptor for importing external memory as a 4457 /// Win32 handle 4458 /// 4459 /// @details 4460 /// - When `handle` is `nullptr`, `name` must not be `nullptr`. 4461 /// - When `name` is `nullptr`, `handle` must not be `nullptr`. 4462 /// - When `flags` is ::ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32_KMT, 4463 /// `name` must be `nullptr`. 4464 /// - This structure may be passed to ::zeMemAllocDevice, via the `pNext` 4465 /// member of ::ze_device_mem_alloc_desc_t, to import memory from a Win32 4466 /// handle. 4467 /// - This structure may be passed to ::zeImageCreate, via the `pNext` 4468 /// member of ::ze_image_desc_t, to import memory from a Win32 handle. 4469 typedef struct _ze_external_memory_import_win32_handle_t 4470 { 4471 ze_structure_type_t stype; ///< [in] type of this structure 4472 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 4473 ///< structure (i.e. contains sType and pNext). 4474 ze_external_memory_type_flags_t flags; ///< [in] flags specifying the memory import type for the Win32 handle. 4475 ///< must be 0 (default) or a valid combination of ::ze_external_memory_type_flags_t 4476 void* handle; ///< [in][optional] the Win32 handle to import 4477 const void* name; ///< [in][optional] name of a memory object to import 4478 4479 } ze_external_memory_import_win32_handle_t; 4480 4481 /////////////////////////////////////////////////////////////////////////////// 4482 /// @brief Exports an allocation as a Win32 handle 4483 /// 4484 /// @details 4485 /// - This structure may be passed to ::zeMemGetAllocProperties, via the 4486 /// `pNext` member of ::ze_memory_allocation_properties_t, to export a 4487 /// memory allocation as a Win32 handle. 4488 /// - This structure may be passed to ::zeImageGetAllocPropertiesExt, via 4489 /// the `pNext` member of ::ze_image_allocation_ext_properties_t, to 4490 /// export an image as a Win32 handle. 4491 /// - The requested memory export type must have been specified when the 4492 /// allocation was made. 4493 typedef struct _ze_external_memory_export_win32_handle_t 4494 { 4495 ze_structure_type_t stype; ///< [in] type of this structure 4496 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 4497 ///< structure (i.e. contains sType and pNext). 4498 ze_external_memory_type_flags_t flags; ///< [in] flags specifying the memory export type for the Win32 handle. 4499 ///< must be 0 (default) or a valid combination of ::ze_external_memory_type_flags_t 4500 void* handle; ///< [out] the exported Win32 handle representing the allocation. 4501 4502 } ze_external_memory_export_win32_handle_t; 4503 4504 #if !defined(__GNUC__) 4505 #pragma endregion 4506 #endif 4507 // Intel 'oneAPI' Level-Zero APIs for Module 4508 #if !defined(__GNUC__) 4509 #pragma region module 4510 #endif 4511 /////////////////////////////////////////////////////////////////////////////// 4512 /// @brief Supported module creation input formats 4513 typedef enum _ze_module_format_t 4514 { 4515 ZE_MODULE_FORMAT_IL_SPIRV = 0, ///< Format is SPIRV IL format 4516 ZE_MODULE_FORMAT_NATIVE = 1, ///< Format is device native format 4517 ZE_MODULE_FORMAT_FORCE_UINT32 = 0x7fffffff 4518 4519 } ze_module_format_t; 4520 4521 /////////////////////////////////////////////////////////////////////////////// 4522 /// @brief Specialization constants - User defined constants 4523 typedef struct _ze_module_constants_t 4524 { 4525 uint32_t numConstants; ///< [in] Number of specialization constants. 4526 const uint32_t* pConstantIds; ///< [in][range(0, numConstants)] Array of IDs that is sized to 4527 ///< numConstants. 4528 const void** pConstantValues; ///< [in][range(0, numConstants)] Array of pointers to values that is sized 4529 ///< to numConstants. 4530 4531 } ze_module_constants_t; 4532 4533 /////////////////////////////////////////////////////////////////////////////// 4534 /// @brief Module descriptor 4535 typedef struct _ze_module_desc_t 4536 { 4537 ze_structure_type_t stype; ///< [in] type of this structure 4538 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 4539 ///< structure (i.e. contains sType and pNext). 4540 ze_module_format_t format; ///< [in] Module format passed in with pInputModule 4541 size_t inputSize; ///< [in] size of input IL or ISA from pInputModule. 4542 const uint8_t* pInputModule; ///< [in] pointer to IL or ISA 4543 const char* pBuildFlags; ///< [in][optional] string containing compiler flags. Following options are supported. 4544 ///< - "-ze-opt-disable" 4545 ///< - Disable optimizations 4546 ///< - "-ze-opt-level" 4547 ///< - Specifies optimization level for compiler. Levels are 4548 ///< implementation specific. 4549 ///< - 0 is no optimizations (equivalent to -ze-opt-disable) 4550 ///< - 1 is optimize minimally (may be the same as 2) 4551 ///< - 2 is optimize more (default) 4552 ///< - "-ze-opt-greater-than-4GB-buffer-required" 4553 ///< - Use 64-bit offset calculations for buffers. 4554 ///< - "-ze-opt-large-register-file" 4555 ///< - Increase number of registers available to threads. 4556 ///< - "-ze-opt-has-buffer-offset-arg" 4557 ///< - Extend stateless to stateful optimization to more 4558 ///< cases with the use of additional offset (e.g. 64-bit 4559 ///< pointer to binding table with 32-bit offset). 4560 ///< - "-g" 4561 ///< - Include debugging information. 4562 const ze_module_constants_t* pConstants; ///< [in][optional] pointer to specialization constants. Valid only for 4563 ///< SPIR-V input. This must be set to nullptr if no specialization 4564 ///< constants are provided. 4565 4566 } ze_module_desc_t; 4567 4568 /////////////////////////////////////////////////////////////////////////////// 4569 /// @brief Creates a module on the context. 4570 /// 4571 /// @details 4572 /// - Compiles the module for execution on the device. 4573 /// - The application must only use the module for the device, or its 4574 /// sub-devices, which was provided during creation. 4575 /// - The module can be copied to other devices and contexts within the same 4576 /// driver instance by using ::zeModuleGetNativeBinary. 4577 /// - A build log can optionally be returned to the caller. The caller is 4578 /// responsible for destroying build log using ::zeModuleBuildLogDestroy. 4579 /// - The module descriptor constants are only supported for SPIR-V 4580 /// specialization constants. 4581 /// - The application may call this function from simultaneous threads. 4582 /// - The implementation of this function must be thread-safe. 4583 /// 4584 /// @returns 4585 /// - ::ZE_RESULT_SUCCESS 4586 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4587 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4588 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4589 /// + `nullptr == hContext` 4590 /// + `nullptr == hDevice` 4591 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4592 /// + `nullptr == desc` 4593 /// + `nullptr == desc->pInputModule` 4594 /// + `nullptr == phModule` 4595 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 4596 /// + `::ZE_MODULE_FORMAT_NATIVE < desc->format` 4597 /// - ::ZE_RESULT_ERROR_INVALID_NATIVE_BINARY 4598 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 4599 /// + `0 == desc->inputSize` 4600 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 4601 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 4602 /// - ::ZE_RESULT_ERROR_MODULE_BUILD_FAILURE 4603 ZE_APIEXPORT ze_result_t ZE_APICALL 4604 zeModuleCreate( 4605 ze_context_handle_t hContext, ///< [in] handle of the context object 4606 ze_device_handle_t hDevice, ///< [in] handle of the device 4607 const ze_module_desc_t* desc, ///< [in] pointer to module descriptor 4608 ze_module_handle_t* phModule, ///< [out] pointer to handle of module object created 4609 ze_module_build_log_handle_t* phBuildLog ///< [out][optional] pointer to handle of module's build log. 4610 ); 4611 4612 /////////////////////////////////////////////////////////////////////////////// 4613 /// @brief Destroys module 4614 /// 4615 /// @details 4616 /// - The application must destroy all kernel and build log handles created 4617 /// from the module before destroying the module itself. 4618 /// - The application must ensure the device is not currently referencing 4619 /// the module before it is deleted. 4620 /// - The implementation of this function may immediately free all Host and 4621 /// Device allocations associated with this module. 4622 /// - The application must **not** call this function from simultaneous 4623 /// threads with the same module handle. 4624 /// - The implementation of this function must be thread-safe. 4625 /// 4626 /// @returns 4627 /// - ::ZE_RESULT_SUCCESS 4628 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4629 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4630 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4631 /// + `nullptr == hModule` 4632 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 4633 ZE_APIEXPORT ze_result_t ZE_APICALL 4634 zeModuleDestroy( 4635 ze_module_handle_t hModule ///< [in][release] handle of the module 4636 ); 4637 4638 /////////////////////////////////////////////////////////////////////////////// 4639 /// @brief Dynamically link modules together that share import/export linkage 4640 /// dependencies. 4641 /// 4642 /// @details 4643 /// - Modules support SPIR-V import and export linkage types for functions 4644 /// and global variables. See the SPIR-V specification for linkage 4645 /// details. 4646 /// - Modules can have both import and export linkage. 4647 /// - Modules that do not have any imports or exports do not need to be 4648 /// linked. 4649 /// - All module import requirements must be satisfied via linking before 4650 /// kernel objects can be created from them. 4651 /// - Modules cannot be partially linked. Unsatisfiable import dependencies 4652 /// in the set of modules passed to ::zeModuleDynamicLink will result in 4653 /// ::ZE_RESULT_ERROR_MODULE_LINK_FAILURE being returned. 4654 /// - Modules will only be linked once. A module can be used in multiple 4655 /// link calls if it has exports but its imports will not be re-linked. 4656 /// - Ambiguous dependencies, where multiple modules satisfy the same import 4657 /// dependencies for a module, are not allowed. 4658 /// - The application must ensure the modules being linked were created on 4659 /// the same context. 4660 /// - The application may call this function from simultaneous threads as 4661 /// long as the import modules being linked are not the same. 4662 /// - ModuleGetNativeBinary can be called on any module regardless of 4663 /// whether it is linked or not. 4664 /// - A link log can optionally be returned to the caller. The caller is 4665 /// responsible for destroying the link log using 4666 /// ::zeModuleBuildLogDestroy. 4667 /// - The link log may contain a list of the unresolved import dependencies 4668 /// if present. 4669 /// - The implementation of this function should be lock-free. 4670 /// 4671 /// @returns 4672 /// - ::ZE_RESULT_SUCCESS 4673 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4674 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4675 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4676 /// + `nullptr == phModules` 4677 /// - ::ZE_RESULT_ERROR_MODULE_LINK_FAILURE 4678 ZE_APIEXPORT ze_result_t ZE_APICALL 4679 zeModuleDynamicLink( 4680 uint32_t numModules, ///< [in] number of modules to be linked pointed to by phModules. 4681 ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to 4682 ///< dynamically link together. 4683 ze_module_build_log_handle_t* phLinkLog ///< [out][optional] pointer to handle of dynamic link log. 4684 ); 4685 4686 /////////////////////////////////////////////////////////////////////////////// 4687 /// @brief Destroys module build log object 4688 /// 4689 /// @details 4690 /// - The implementation of this function may immediately free all Host 4691 /// allocations associated with this object. 4692 /// - The application must **not** call this function from simultaneous 4693 /// threads with the same build log handle. 4694 /// - The implementation of this function should be lock-free. 4695 /// - This function can be called before or after ::zeModuleDestroy for the 4696 /// associated module. 4697 /// 4698 /// @returns 4699 /// - ::ZE_RESULT_SUCCESS 4700 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4701 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4702 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4703 /// + `nullptr == hModuleBuildLog` 4704 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 4705 ZE_APIEXPORT ze_result_t ZE_APICALL 4706 zeModuleBuildLogDestroy( 4707 ze_module_build_log_handle_t hModuleBuildLog ///< [in][release] handle of the module build log object. 4708 ); 4709 4710 /////////////////////////////////////////////////////////////////////////////// 4711 /// @brief Retrieves text string for build log. 4712 /// 4713 /// @details 4714 /// - The caller can pass nullptr for pBuildLog when querying only for size. 4715 /// - The caller must provide memory for build log. 4716 /// - The application may call this function from simultaneous threads. 4717 /// - The implementation of this function should be lock-free. 4718 /// 4719 /// @returns 4720 /// - ::ZE_RESULT_SUCCESS 4721 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4722 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4723 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4724 /// + `nullptr == hModuleBuildLog` 4725 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4726 /// + `nullptr == pSize` 4727 ZE_APIEXPORT ze_result_t ZE_APICALL 4728 zeModuleBuildLogGetString( 4729 ze_module_build_log_handle_t hModuleBuildLog, ///< [in] handle of the module build log object. 4730 size_t* pSize, ///< [in,out] size of build log string. 4731 char* pBuildLog ///< [in,out][optional] pointer to null-terminated string of the log. 4732 ); 4733 4734 /////////////////////////////////////////////////////////////////////////////// 4735 /// @brief Retrieve native binary from Module. 4736 /// 4737 /// @details 4738 /// - The native binary output can be cached to disk and new modules can be 4739 /// later constructed from the cached copy. 4740 /// - The native binary will retain debugging information that is associated 4741 /// with a module. 4742 /// - The caller can pass nullptr for pModuleNativeBinary when querying only 4743 /// for size. 4744 /// - The implementation will copy the native binary into a buffer supplied 4745 /// by the caller. 4746 /// - The application may call this function from simultaneous threads. 4747 /// - The implementation of this function should be lock-free. 4748 /// 4749 /// @returns 4750 /// - ::ZE_RESULT_SUCCESS 4751 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4752 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4753 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4754 /// + `nullptr == hModule` 4755 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4756 /// + `nullptr == pSize` 4757 ZE_APIEXPORT ze_result_t ZE_APICALL 4758 zeModuleGetNativeBinary( 4759 ze_module_handle_t hModule, ///< [in] handle of the module 4760 size_t* pSize, ///< [in,out] size of native binary in bytes. 4761 uint8_t* pModuleNativeBinary ///< [in,out][optional] byte pointer to native binary 4762 ); 4763 4764 /////////////////////////////////////////////////////////////////////////////// 4765 /// @brief Retrieve global variable pointer from Module. 4766 /// 4767 /// @details 4768 /// - The application may query global pointer from any module that either 4769 /// exports or imports it. 4770 /// - The application must dynamically link a module that imports a global 4771 /// before the global pointer can be queried from it. 4772 /// - The application may call this function from simultaneous threads. 4773 /// - The implementation of this function should be lock-free. 4774 /// 4775 /// @returns 4776 /// - ::ZE_RESULT_SUCCESS 4777 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4778 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4779 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4780 /// + `nullptr == hModule` 4781 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4782 /// + `nullptr == pGlobalName` 4783 /// - ::ZE_RESULT_ERROR_INVALID_GLOBAL_NAME 4784 ZE_APIEXPORT ze_result_t ZE_APICALL 4785 zeModuleGetGlobalPointer( 4786 ze_module_handle_t hModule, ///< [in] handle of the module 4787 const char* pGlobalName, ///< [in] name of global variable in module 4788 size_t* pSize, ///< [in,out][optional] size of global variable 4789 void** pptr ///< [in,out][optional] device visible pointer 4790 ); 4791 4792 /////////////////////////////////////////////////////////////////////////////// 4793 /// @brief Retrieve all kernel names in the module. 4794 /// 4795 /// @details 4796 /// - The application may call this function from simultaneous threads. 4797 /// - The implementation of this function should be lock-free. 4798 /// 4799 /// @returns 4800 /// - ::ZE_RESULT_SUCCESS 4801 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4802 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4803 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4804 /// + `nullptr == hModule` 4805 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4806 /// + `nullptr == pCount` 4807 ZE_APIEXPORT ze_result_t ZE_APICALL 4808 zeModuleGetKernelNames( 4809 ze_module_handle_t hModule, ///< [in] handle of the module 4810 uint32_t* pCount, ///< [in,out] pointer to the number of names. 4811 ///< if count is zero, then the driver shall update the value with the 4812 ///< total number of names available. 4813 ///< if count is greater than the number of names available, then the 4814 ///< driver shall update the value with the correct number of names available. 4815 const char** pNames ///< [in,out][optional][range(0, *pCount)] array of names of functions. 4816 ///< if count is less than the number of names available, then driver shall 4817 ///< only retrieve that number of names. 4818 ); 4819 4820 /////////////////////////////////////////////////////////////////////////////// 4821 /// @brief Supported module property flags 4822 typedef uint32_t ze_module_property_flags_t; 4823 typedef enum _ze_module_property_flag_t 4824 { 4825 ZE_MODULE_PROPERTY_FLAG_IMPORTS = ZE_BIT(0), ///< Module has imports (i.e. imported global variables and/or kernels). 4826 ///< See ::zeModuleDynamicLink. 4827 ZE_MODULE_PROPERTY_FLAG_FORCE_UINT32 = 0x7fffffff 4828 4829 } ze_module_property_flag_t; 4830 4831 /////////////////////////////////////////////////////////////////////////////// 4832 /// @brief Module properties 4833 typedef struct _ze_module_properties_t 4834 { 4835 ze_structure_type_t stype; ///< [in] type of this structure 4836 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 4837 ///< structure (i.e. contains sType and pNext). 4838 ze_module_property_flags_t flags; ///< [out] 0 (none) or a valid combination of ::ze_module_property_flag_t 4839 4840 } ze_module_properties_t; 4841 4842 /////////////////////////////////////////////////////////////////////////////// 4843 /// @brief Retrieve module properties. 4844 /// 4845 /// @details 4846 /// - The application may call this function from simultaneous threads. 4847 /// - The implementation of this function should be lock-free. 4848 /// 4849 /// @returns 4850 /// - ::ZE_RESULT_SUCCESS 4851 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4852 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4853 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4854 /// + `nullptr == hModule` 4855 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4856 /// + `nullptr == pModuleProperties` 4857 ZE_APIEXPORT ze_result_t ZE_APICALL 4858 zeModuleGetProperties( 4859 ze_module_handle_t hModule, ///< [in] handle of the module 4860 ze_module_properties_t* pModuleProperties ///< [in,out] query result for module properties. 4861 ); 4862 4863 /////////////////////////////////////////////////////////////////////////////// 4864 /// @brief Supported kernel creation flags 4865 typedef uint32_t ze_kernel_flags_t; 4866 typedef enum _ze_kernel_flag_t 4867 { 4868 ZE_KERNEL_FLAG_FORCE_RESIDENCY = ZE_BIT(0), ///< force all device allocations to be resident during execution 4869 ZE_KERNEL_FLAG_EXPLICIT_RESIDENCY = ZE_BIT(1), ///< application is responsible for all residency of device allocations. 4870 ///< driver may disable implicit residency management. 4871 ZE_KERNEL_FLAG_FORCE_UINT32 = 0x7fffffff 4872 4873 } ze_kernel_flag_t; 4874 4875 /////////////////////////////////////////////////////////////////////////////// 4876 /// @brief Kernel descriptor 4877 typedef struct _ze_kernel_desc_t 4878 { 4879 ze_structure_type_t stype; ///< [in] type of this structure 4880 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 4881 ///< structure (i.e. contains sType and pNext). 4882 ze_kernel_flags_t flags; ///< [in] creation flags. 4883 ///< must be 0 (default) or a valid combination of ::ze_kernel_flag_t; 4884 ///< default behavior may use driver-based residency. 4885 const char* pKernelName; ///< [in] null-terminated name of kernel in module 4886 4887 } ze_kernel_desc_t; 4888 4889 /////////////////////////////////////////////////////////////////////////////// 4890 /// @brief Create a kernel from the module. 4891 /// 4892 /// @details 4893 /// - Modules that have unresolved imports need to be dynamically linked 4894 /// before a kernel can be created from them. (See ::zeModuleDynamicLink) 4895 /// - The application may call this function from simultaneous threads. 4896 /// - The implementation of this function must be thread-safe. 4897 /// 4898 /// @returns 4899 /// - ::ZE_RESULT_SUCCESS 4900 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4901 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4902 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4903 /// + `nullptr == hModule` 4904 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4905 /// + `nullptr == desc` 4906 /// + `nullptr == desc->pKernelName` 4907 /// + `nullptr == phKernel` 4908 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 4909 /// + `0x3 < desc->flags` 4910 /// - ::ZE_RESULT_ERROR_INVALID_KERNEL_NAME 4911 /// - ::ZE_RESULT_ERROR_INVALID_MODULE_UNLINKED 4912 ZE_APIEXPORT ze_result_t ZE_APICALL 4913 zeKernelCreate( 4914 ze_module_handle_t hModule, ///< [in] handle of the module 4915 const ze_kernel_desc_t* desc, ///< [in] pointer to kernel descriptor 4916 ze_kernel_handle_t* phKernel ///< [out] handle of the Function object 4917 ); 4918 4919 /////////////////////////////////////////////////////////////////////////////// 4920 /// @brief Destroys a kernel object 4921 /// 4922 /// @details 4923 /// - The application must ensure the device is not currently referencing 4924 /// the kernel before it is deleted. 4925 /// - The implementation of this function may immediately free all Host and 4926 /// Device allocations associated with this kernel. 4927 /// - The application must **not** call this function from simultaneous 4928 /// threads with the same kernel handle. 4929 /// - The implementation of this function must be thread-safe. 4930 /// 4931 /// @returns 4932 /// - ::ZE_RESULT_SUCCESS 4933 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4934 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4935 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4936 /// + `nullptr == hKernel` 4937 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 4938 ZE_APIEXPORT ze_result_t ZE_APICALL 4939 zeKernelDestroy( 4940 ze_kernel_handle_t hKernel ///< [in][release] handle of the kernel object 4941 ); 4942 4943 /////////////////////////////////////////////////////////////////////////////// 4944 /// @brief Retrieve a function pointer from a module by name 4945 /// 4946 /// @details 4947 /// - The function pointer is unique for the device on which the module was 4948 /// created. 4949 /// - The function pointer is no longer valid if module is destroyed. 4950 /// - The application may call this function from simultaneous threads. 4951 /// - The implementation of this function should be lock-free. 4952 /// 4953 /// @returns 4954 /// - ::ZE_RESULT_SUCCESS 4955 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4956 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4957 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4958 /// + `nullptr == hModule` 4959 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 4960 /// + `nullptr == pFunctionName` 4961 /// + `nullptr == pfnFunction` 4962 /// - ::ZE_RESULT_ERROR_INVALID_FUNCTION_NAME 4963 ZE_APIEXPORT ze_result_t ZE_APICALL 4964 zeModuleGetFunctionPointer( 4965 ze_module_handle_t hModule, ///< [in] handle of the module 4966 const char* pFunctionName, ///< [in] Name of function to retrieve function pointer for. 4967 void** pfnFunction ///< [out] pointer to function. 4968 ); 4969 4970 /////////////////////////////////////////////////////////////////////////////// 4971 /// @brief Set group size for a kernel. 4972 /// 4973 /// @details 4974 /// - The group size will be used when a ::zeCommandListAppendLaunchKernel 4975 /// variant is called. 4976 /// - The application must **not** call this function from simultaneous 4977 /// threads with the same kernel handle. 4978 /// - The implementation of this function should be lock-free. 4979 /// 4980 /// @returns 4981 /// - ::ZE_RESULT_SUCCESS 4982 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 4983 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 4984 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 4985 /// + `nullptr == hKernel` 4986 /// - ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION 4987 ZE_APIEXPORT ze_result_t ZE_APICALL 4988 zeKernelSetGroupSize( 4989 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 4990 uint32_t groupSizeX, ///< [in] group size for X dimension to use for this kernel 4991 uint32_t groupSizeY, ///< [in] group size for Y dimension to use for this kernel 4992 uint32_t groupSizeZ ///< [in] group size for Z dimension to use for this kernel 4993 ); 4994 4995 /////////////////////////////////////////////////////////////////////////////// 4996 /// @brief Query a suggested group size for a kernel given a global size for each 4997 /// dimension. 4998 /// 4999 /// @details 5000 /// - This function ignores the group size that is set using 5001 /// ::zeKernelSetGroupSize. 5002 /// - The application may call this function from simultaneous threads. 5003 /// - The implementation of this function should be lock-free. 5004 /// 5005 /// @returns 5006 /// - ::ZE_RESULT_SUCCESS 5007 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5008 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5009 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5010 /// + `nullptr == hKernel` 5011 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5012 /// + `nullptr == groupSizeX` 5013 /// + `nullptr == groupSizeY` 5014 /// + `nullptr == groupSizeZ` 5015 /// - ::ZE_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION 5016 ZE_APIEXPORT ze_result_t ZE_APICALL 5017 zeKernelSuggestGroupSize( 5018 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5019 uint32_t globalSizeX, ///< [in] global width for X dimension 5020 uint32_t globalSizeY, ///< [in] global width for Y dimension 5021 uint32_t globalSizeZ, ///< [in] global width for Z dimension 5022 uint32_t* groupSizeX, ///< [out] recommended size of group for X dimension 5023 uint32_t* groupSizeY, ///< [out] recommended size of group for Y dimension 5024 uint32_t* groupSizeZ ///< [out] recommended size of group for Z dimension 5025 ); 5026 5027 /////////////////////////////////////////////////////////////////////////////// 5028 /// @brief Query a suggested max group count for a cooperative kernel. 5029 /// 5030 /// @details 5031 /// - The application may call this function from simultaneous threads. 5032 /// - The implementation of this function should be lock-free. 5033 /// 5034 /// @returns 5035 /// - ::ZE_RESULT_SUCCESS 5036 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5037 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5038 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5039 /// + `nullptr == hKernel` 5040 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5041 /// + `nullptr == totalGroupCount` 5042 ZE_APIEXPORT ze_result_t ZE_APICALL 5043 zeKernelSuggestMaxCooperativeGroupCount( 5044 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5045 uint32_t* totalGroupCount ///< [out] recommended total group count. 5046 ); 5047 5048 /////////////////////////////////////////////////////////////////////////////// 5049 /// @brief Set kernel argument for a kernel. 5050 /// 5051 /// @details 5052 /// - The argument values will be used when a 5053 /// ::zeCommandListAppendLaunchKernel variant is called. 5054 /// - The application must **not** call this function from simultaneous 5055 /// threads with the same kernel handle. 5056 /// - The implementation of this function should be lock-free. 5057 /// 5058 /// @returns 5059 /// - ::ZE_RESULT_SUCCESS 5060 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5061 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5062 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5063 /// + `nullptr == hKernel` 5064 /// - ::ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX 5065 /// - ::ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE 5066 ZE_APIEXPORT ze_result_t ZE_APICALL 5067 zeKernelSetArgumentValue( 5068 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5069 uint32_t argIndex, ///< [in] argument index in range [0, num args - 1] 5070 size_t argSize, ///< [in] size of argument type 5071 const void* pArgValue ///< [in][optional] argument value represented as matching arg type. If 5072 ///< null then argument value is considered null. 5073 ); 5074 5075 /////////////////////////////////////////////////////////////////////////////// 5076 /// @brief Kernel indirect access flags 5077 typedef uint32_t ze_kernel_indirect_access_flags_t; 5078 typedef enum _ze_kernel_indirect_access_flag_t 5079 { 5080 ZE_KERNEL_INDIRECT_ACCESS_FLAG_HOST = ZE_BIT(0),///< Indicates that the kernel accesses host allocations indirectly. 5081 ZE_KERNEL_INDIRECT_ACCESS_FLAG_DEVICE = ZE_BIT(1), ///< Indicates that the kernel accesses device allocations indirectly. 5082 ZE_KERNEL_INDIRECT_ACCESS_FLAG_SHARED = ZE_BIT(2), ///< Indicates that the kernel accesses shared allocations indirectly. 5083 ZE_KERNEL_INDIRECT_ACCESS_FLAG_FORCE_UINT32 = 0x7fffffff 5084 5085 } ze_kernel_indirect_access_flag_t; 5086 5087 /////////////////////////////////////////////////////////////////////////////// 5088 /// @brief Sets kernel indirect access flags. 5089 /// 5090 /// @details 5091 /// - The application should specify which allocations will be indirectly 5092 /// accessed by the kernel to allow driver to optimize which allocations 5093 /// are made resident 5094 /// - This function may **not** be called from simultaneous threads with the 5095 /// same Kernel handle. 5096 /// - The implementation of this function should be lock-free. 5097 /// 5098 /// @returns 5099 /// - ::ZE_RESULT_SUCCESS 5100 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5101 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5102 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5103 /// + `nullptr == hKernel` 5104 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 5105 /// + `0x7 < flags` 5106 ZE_APIEXPORT ze_result_t ZE_APICALL 5107 zeKernelSetIndirectAccess( 5108 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5109 ze_kernel_indirect_access_flags_t flags ///< [in] kernel indirect access flags 5110 ); 5111 5112 /////////////////////////////////////////////////////////////////////////////// 5113 /// @brief Retrieve kernel indirect access flags. 5114 /// 5115 /// @details 5116 /// - This function may be called from simultaneous threads with the same 5117 /// Kernel handle. 5118 /// - The implementation of this function should be lock-free. 5119 /// 5120 /// @returns 5121 /// - ::ZE_RESULT_SUCCESS 5122 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5123 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5124 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5125 /// + `nullptr == hKernel` 5126 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5127 /// + `nullptr == pFlags` 5128 ZE_APIEXPORT ze_result_t ZE_APICALL 5129 zeKernelGetIndirectAccess( 5130 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5131 ze_kernel_indirect_access_flags_t* pFlags ///< [out] query result for kernel indirect access flags. 5132 ); 5133 5134 /////////////////////////////////////////////////////////////////////////////// 5135 /// @brief Retrieve all declared kernel attributes (i.e. can be specified with 5136 /// __attribute__ in runtime language). 5137 /// 5138 /// @details 5139 /// - This function may be called from simultaneous threads with the same 5140 /// Kernel handle. 5141 /// - The implementation of this function should be lock-free. 5142 /// 5143 /// @returns 5144 /// - ::ZE_RESULT_SUCCESS 5145 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5146 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5147 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5148 /// + `nullptr == hKernel` 5149 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5150 /// + `nullptr == pSize` 5151 /// + `nullptr == pString` 5152 ZE_APIEXPORT ze_result_t ZE_APICALL 5153 zeKernelGetSourceAttributes( 5154 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5155 uint32_t* pSize, ///< [in,out] pointer to size of string in bytes. 5156 char** pString ///< [in,out] pointer to null-terminated string, whose lifetime is tied to 5157 ///< the kernel object, where kernel source attributes are separated by 5158 ///< space. 5159 ); 5160 5161 /////////////////////////////////////////////////////////////////////////////// 5162 /// @brief Supported Cache Config flags 5163 typedef uint32_t ze_cache_config_flags_t; 5164 typedef enum _ze_cache_config_flag_t 5165 { 5166 ZE_CACHE_CONFIG_FLAG_LARGE_SLM = ZE_BIT(0), ///< Large SLM size 5167 ZE_CACHE_CONFIG_FLAG_LARGE_DATA = ZE_BIT(1), ///< Large General Data size 5168 ZE_CACHE_CONFIG_FLAG_FORCE_UINT32 = 0x7fffffff 5169 5170 } ze_cache_config_flag_t; 5171 5172 /////////////////////////////////////////////////////////////////////////////// 5173 /// @brief Sets the preferred cache configuration. 5174 /// 5175 /// @details 5176 /// - The cache configuration will be used when a 5177 /// ::zeCommandListAppendLaunchKernel variant is called. 5178 /// - The application must **not** call this function from simultaneous 5179 /// threads with the same kernel handle. 5180 /// - The implementation of this function should be lock-free. 5181 /// 5182 /// @returns 5183 /// - ::ZE_RESULT_SUCCESS 5184 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5185 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5186 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5187 /// + `nullptr == hKernel` 5188 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 5189 /// + `0x3 < flags` 5190 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE 5191 ZE_APIEXPORT ze_result_t ZE_APICALL 5192 zeKernelSetCacheConfig( 5193 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5194 ze_cache_config_flags_t flags ///< [in] cache configuration. 5195 ///< must be 0 (default configuration) or a valid combination of ::ze_cache_config_flag_t. 5196 ); 5197 5198 /////////////////////////////////////////////////////////////////////////////// 5199 #ifndef ZE_MAX_KERNEL_UUID_SIZE 5200 /// @brief Maximum kernel universal unique id (UUID) size in bytes 5201 #define ZE_MAX_KERNEL_UUID_SIZE 16 5202 #endif // ZE_MAX_KERNEL_UUID_SIZE 5203 5204 /////////////////////////////////////////////////////////////////////////////// 5205 #ifndef ZE_MAX_MODULE_UUID_SIZE 5206 /// @brief Maximum module universal unique id (UUID) size in bytes 5207 #define ZE_MAX_MODULE_UUID_SIZE 16 5208 #endif // ZE_MAX_MODULE_UUID_SIZE 5209 5210 /////////////////////////////////////////////////////////////////////////////// 5211 /// @brief Kernel universal unique id (UUID) 5212 typedef struct _ze_kernel_uuid_t 5213 { 5214 uint8_t kid[ZE_MAX_KERNEL_UUID_SIZE]; ///< [out] opaque data representing a kernel UUID 5215 uint8_t mid[ZE_MAX_MODULE_UUID_SIZE]; ///< [out] opaque data representing the kernel's module UUID 5216 5217 } ze_kernel_uuid_t; 5218 5219 /////////////////////////////////////////////////////////////////////////////// 5220 /// @brief Kernel properties 5221 typedef struct _ze_kernel_properties_t 5222 { 5223 ze_structure_type_t stype; ///< [in] type of this structure 5224 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 5225 ///< structure (i.e. contains sType and pNext). 5226 uint32_t numKernelArgs; ///< [out] number of kernel arguments. 5227 uint32_t requiredGroupSizeX; ///< [out] required group size in the X dimension, 5228 ///< or zero if there is no required group size 5229 uint32_t requiredGroupSizeY; ///< [out] required group size in the Y dimension, 5230 ///< or zero if there is no required group size 5231 uint32_t requiredGroupSizeZ; ///< [out] required group size in the Z dimension, 5232 ///< or zero if there is no required group size 5233 uint32_t requiredNumSubGroups; ///< [out] required number of subgroups per thread group, 5234 ///< or zero if there is no required number of subgroups 5235 uint32_t requiredSubgroupSize; ///< [out] required subgroup size, 5236 ///< or zero if there is no required subgroup size 5237 uint32_t maxSubgroupSize; ///< [out] maximum subgroup size 5238 uint32_t maxNumSubgroups; ///< [out] maximum number of subgroups per thread group 5239 uint32_t localMemSize; ///< [out] local memory size used by each thread group 5240 uint32_t privateMemSize; ///< [out] private memory size allocated by compiler used by each thread 5241 uint32_t spillMemSize; ///< [out] spill memory size allocated by compiler 5242 ze_kernel_uuid_t uuid; ///< [out] universal unique identifier. 5243 5244 } ze_kernel_properties_t; 5245 5246 /////////////////////////////////////////////////////////////////////////////// 5247 /// @brief Additional kernel preferred group size properties 5248 /// 5249 /// @details 5250 /// - This structure may be passed to ::zeKernelGetProperties, via the 5251 /// `pNext` member of ::ze_kernel_properties_t, to query additional kernel 5252 /// preferred group size properties. 5253 typedef struct _ze_kernel_preferred_group_size_properties_t 5254 { 5255 ze_structure_type_t stype; ///< [in] type of this structure 5256 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 5257 ///< structure (i.e. contains sType and pNext). 5258 uint32_t preferredMultiple; ///< [out] preferred group size multiple 5259 5260 } ze_kernel_preferred_group_size_properties_t; 5261 5262 /////////////////////////////////////////////////////////////////////////////// 5263 /// @brief Retrieve kernel properties. 5264 /// 5265 /// @details 5266 /// - The application may call this function from simultaneous threads. 5267 /// - The implementation of this function should be lock-free. 5268 /// 5269 /// @returns 5270 /// - ::ZE_RESULT_SUCCESS 5271 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5272 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5273 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5274 /// + `nullptr == hKernel` 5275 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5276 /// + `nullptr == pKernelProperties` 5277 ZE_APIEXPORT ze_result_t ZE_APICALL 5278 zeKernelGetProperties( 5279 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5280 ze_kernel_properties_t* pKernelProperties ///< [in,out] query result for kernel properties. 5281 ); 5282 5283 /////////////////////////////////////////////////////////////////////////////// 5284 /// @brief Retrieve kernel name from Kernel. 5285 /// 5286 /// @details 5287 /// - The caller can pass nullptr for pName when querying only for size. 5288 /// - The implementation will copy the kernel name into a buffer supplied by 5289 /// the caller. 5290 /// - The application may call this function from simultaneous threads. 5291 /// - The implementation of this function should be lock-free. 5292 /// 5293 /// @returns 5294 /// - ::ZE_RESULT_SUCCESS 5295 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5296 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5297 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5298 /// + `nullptr == hKernel` 5299 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5300 /// + `nullptr == pSize` 5301 ZE_APIEXPORT ze_result_t ZE_APICALL 5302 zeKernelGetName( 5303 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5304 size_t* pSize, ///< [in,out] size of kernel name string, including null terminator, in 5305 ///< bytes. 5306 char* pName ///< [in,out][optional] char pointer to kernel name. 5307 ); 5308 5309 /////////////////////////////////////////////////////////////////////////////// 5310 /// @brief Kernel dispatch group count. 5311 typedef struct _ze_group_count_t 5312 { 5313 uint32_t groupCountX; ///< [in] number of thread groups in X dimension 5314 uint32_t groupCountY; ///< [in] number of thread groups in Y dimension 5315 uint32_t groupCountZ; ///< [in] number of thread groups in Z dimension 5316 5317 } ze_group_count_t; 5318 5319 /////////////////////////////////////////////////////////////////////////////// 5320 /// @brief Launch kernel over one or more work groups. 5321 /// 5322 /// @details 5323 /// - The application must ensure the kernel and events are accessible by 5324 /// the device on which the command list was created. 5325 /// - This may **only** be called for a command list created with command 5326 /// queue group ordinal that supports compute. 5327 /// - The application must ensure the command list, kernel and events were 5328 /// created on the same context. 5329 /// - This function may **not** be called from simultaneous threads with the 5330 /// same command list handle. 5331 /// - The implementation of this function should be lock-free. 5332 /// 5333 /// @returns 5334 /// - ::ZE_RESULT_SUCCESS 5335 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5336 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5337 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5338 /// + `nullptr == hCommandList` 5339 /// + `nullptr == hKernel` 5340 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5341 /// + `nullptr == pLaunchFuncArgs` 5342 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 5343 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 5344 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 5345 ZE_APIEXPORT ze_result_t ZE_APICALL 5346 zeCommandListAppendLaunchKernel( 5347 ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 5348 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5349 const ze_group_count_t* pLaunchFuncArgs, ///< [in] thread group launch arguments 5350 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 5351 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 5352 ///< if `nullptr == phWaitEvents` 5353 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 5354 ///< on before launching 5355 ); 5356 5357 /////////////////////////////////////////////////////////////////////////////// 5358 /// @brief Launch kernel cooperatively over one or more work groups. 5359 /// 5360 /// @details 5361 /// - The application must ensure the kernel and events are accessible by 5362 /// the device on which the command list was created. 5363 /// - This may **only** be called for a command list created with command 5364 /// queue group ordinal that supports compute. 5365 /// - This may only be used for a command list that are submitted to command 5366 /// queue with cooperative flag set. 5367 /// - The application must ensure the command list, kernel and events were 5368 /// created on the same context. 5369 /// - This function may **not** be called from simultaneous threads with the 5370 /// same command list handle. 5371 /// - The implementation of this function should be lock-free. 5372 /// - Use ::zeKernelSuggestMaxCooperativeGroupCount to recommend max group 5373 /// count for device for cooperative functions that device supports. 5374 /// 5375 /// @returns 5376 /// - ::ZE_RESULT_SUCCESS 5377 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5378 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5379 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5380 /// + `nullptr == hCommandList` 5381 /// + `nullptr == hKernel` 5382 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5383 /// + `nullptr == pLaunchFuncArgs` 5384 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 5385 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 5386 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 5387 ZE_APIEXPORT ze_result_t ZE_APICALL 5388 zeCommandListAppendLaunchCooperativeKernel( 5389 ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 5390 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5391 const ze_group_count_t* pLaunchFuncArgs, ///< [in] thread group launch arguments 5392 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 5393 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 5394 ///< if `nullptr == phWaitEvents` 5395 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 5396 ///< on before launching 5397 ); 5398 5399 /////////////////////////////////////////////////////////////////////////////// 5400 /// @brief Launch kernel over one or more work groups using indirect arguments. 5401 /// 5402 /// @details 5403 /// - The application must ensure the kernel and events are accessible by 5404 /// the device on which the command list was created. 5405 /// - The application must ensure the launch arguments are visible to the 5406 /// device on which the command list was created. 5407 /// - The implementation must not access the contents of the launch 5408 /// arguments as they are free to be modified by either the Host or device 5409 /// up until execution. 5410 /// - This may **only** be called for a command list created with command 5411 /// queue group ordinal that supports compute. 5412 /// - The application must ensure the command list, kernel and events were 5413 /// created, and the memory was allocated, on the same context. 5414 /// - This function may **not** be called from simultaneous threads with the 5415 /// same command list handle. 5416 /// - The implementation of this function should be lock-free. 5417 /// 5418 /// @returns 5419 /// - ::ZE_RESULT_SUCCESS 5420 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5421 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5422 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5423 /// + `nullptr == hCommandList` 5424 /// + `nullptr == hKernel` 5425 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5426 /// + `nullptr == pLaunchArgumentsBuffer` 5427 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 5428 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 5429 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 5430 ZE_APIEXPORT ze_result_t ZE_APICALL 5431 zeCommandListAppendLaunchKernelIndirect( 5432 ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 5433 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 5434 const ze_group_count_t* pLaunchArgumentsBuffer, ///< [in] pointer to device buffer that will contain thread group launch 5435 ///< arguments 5436 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 5437 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 5438 ///< if `nullptr == phWaitEvents` 5439 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 5440 ///< on before launching 5441 ); 5442 5443 /////////////////////////////////////////////////////////////////////////////// 5444 /// @brief Launch multiple kernels over one or more work groups using an array of 5445 /// indirect arguments. 5446 /// 5447 /// @details 5448 /// - The application must ensure the kernel and events are accessible by 5449 /// the device on which the command list was created. 5450 /// - The application must ensure the array of launch arguments and count 5451 /// buffer are visible to the device on which the command list was 5452 /// created. 5453 /// - The implementation must not access the contents of the array of launch 5454 /// arguments or count buffer as they are free to be modified by either 5455 /// the Host or device up until execution. 5456 /// - This may **only** be called for a command list created with command 5457 /// queue group ordinal that supports compute. 5458 /// - The application must enusre the command list, kernel and events were 5459 /// created, and the memory was allocated, on the same context. 5460 /// - This function may **not** be called from simultaneous threads with the 5461 /// same command list handle. 5462 /// - The implementation of this function should be lock-free. 5463 /// 5464 /// @returns 5465 /// - ::ZE_RESULT_SUCCESS 5466 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5467 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5468 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5469 /// + `nullptr == hCommandList` 5470 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5471 /// + `nullptr == phKernels` 5472 /// + `nullptr == pCountBuffer` 5473 /// + `nullptr == pLaunchArgumentsBuffer` 5474 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 5475 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 5476 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 5477 ZE_APIEXPORT ze_result_t ZE_APICALL 5478 zeCommandListAppendLaunchMultipleKernelsIndirect( 5479 ze_command_list_handle_t hCommandList, ///< [in] handle of the command list 5480 uint32_t numKernels, ///< [in] maximum number of kernels to launch 5481 ze_kernel_handle_t* phKernels, ///< [in][range(0, numKernels)] handles of the kernel objects 5482 const uint32_t* pCountBuffer, ///< [in] pointer to device memory location that will contain the actual 5483 ///< number of kernels to launch; value must be less-than or equal-to 5484 ///< numKernels 5485 const ze_group_count_t* pLaunchArgumentsBuffer, ///< [in][range(0, numKernels)] pointer to device buffer that will contain 5486 ///< a contiguous array of thread group launch arguments 5487 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 5488 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 5489 ///< if `nullptr == phWaitEvents` 5490 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 5491 ///< on before launching 5492 ); 5493 5494 #if !defined(__GNUC__) 5495 #pragma endregion 5496 #endif 5497 // Intel 'oneAPI' Level-Zero Extension for supporting module programs. 5498 #if !defined(__GNUC__) 5499 #pragma region program 5500 #endif 5501 /////////////////////////////////////////////////////////////////////////////// 5502 #ifndef ZE_MODULE_PROGRAM_EXP_NAME 5503 /// @brief Module Program Extension Name 5504 #define ZE_MODULE_PROGRAM_EXP_NAME "ZE_experimental_module_program" 5505 #endif // ZE_MODULE_PROGRAM_EXP_NAME 5506 5507 /////////////////////////////////////////////////////////////////////////////// 5508 /// @brief Module Program Extension Version(s) 5509 typedef enum _ze_module_program_exp_version_t 5510 { 5511 ZE_MODULE_PROGRAM_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 5512 ZE_MODULE_PROGRAM_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version 5513 ZE_MODULE_PROGRAM_EXP_VERSION_FORCE_UINT32 = 0x7fffffff 5514 5515 } ze_module_program_exp_version_t; 5516 5517 /////////////////////////////////////////////////////////////////////////////// 5518 /// @brief Module extended descriptor to support multiple input modules. 5519 /// 5520 /// @details 5521 /// - Implementation must support ::ZE_experimental_module_program extension 5522 /// - Modules support import and export linkage for functions and global 5523 /// variables. 5524 /// - SPIR-V import and export linkage types are used. See SPIR-V 5525 /// specification for linkage details. 5526 /// - pInputModules, pBuildFlags, and pConstants from ::ze_module_desc_t is 5527 /// ignored. 5528 /// - Format in ::ze_module_desc_t needs to be set to 5529 /// ::ZE_MODULE_FORMAT_IL_SPIRV. 5530 typedef struct _ze_module_program_exp_desc_t 5531 { 5532 ze_structure_type_t stype; ///< [in] type of this structure 5533 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 5534 ///< structure (i.e. contains sType and pNext). 5535 uint32_t count; ///< [in] Count of input modules 5536 const size_t* inputSizes; ///< [in][range(0, count)] sizes of each input IL module in pInputModules. 5537 const uint8_t** pInputModules; ///< [in][range(0, count)] pointer to an array of IL (e.g. SPIR-V modules). 5538 ///< Valid only for SPIR-V input. 5539 const char** pBuildFlags; ///< [in][optional][range(0, count)] array of strings containing build 5540 ///< flags. See pBuildFlags in ::ze_module_desc_t. 5541 const ze_module_constants_t** pConstants; ///< [in][optional][range(0, count)] pointer to array of specialization 5542 ///< constant strings. Valid only for SPIR-V input. This must be set to 5543 ///< nullptr if no specialization constants are provided. 5544 5545 } ze_module_program_exp_desc_t; 5546 5547 #if !defined(__GNUC__) 5548 #pragma endregion 5549 #endif 5550 // Intel 'oneAPI' Level-Zero Extension APIs for Raytracing 5551 #if !defined(__GNUC__) 5552 #pragma region raytracing 5553 #endif 5554 /////////////////////////////////////////////////////////////////////////////// 5555 #ifndef ZE_RAYTRACING_EXT_NAME 5556 /// @brief Raytracing Extension Name 5557 #define ZE_RAYTRACING_EXT_NAME "ZE_extension_raytracing" 5558 #endif // ZE_RAYTRACING_EXT_NAME 5559 5560 /////////////////////////////////////////////////////////////////////////////// 5561 /// @brief Raytracing Extension Version(s) 5562 typedef enum _ze_raytracing_ext_version_t 5563 { 5564 ZE_RAYTRACING_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 5565 ZE_RAYTRACING_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version 5566 ZE_RAYTRACING_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 5567 5568 } ze_raytracing_ext_version_t; 5569 5570 /////////////////////////////////////////////////////////////////////////////// 5571 /// @brief Supported raytracing capability flags 5572 typedef uint32_t ze_device_raytracing_ext_flags_t; 5573 typedef enum _ze_device_raytracing_ext_flag_t 5574 { 5575 ZE_DEVICE_RAYTRACING_EXT_FLAG_RAYQUERY = ZE_BIT(0), ///< Supports rayquery 5576 ZE_DEVICE_RAYTRACING_EXT_FLAG_FORCE_UINT32 = 0x7fffffff 5577 5578 } ze_device_raytracing_ext_flag_t; 5579 5580 /////////////////////////////////////////////////////////////////////////////// 5581 /// @brief Raytracing properties queried using ::zeDeviceGetModuleProperties 5582 /// 5583 /// @details 5584 /// - This structure may be returned from ::zeDeviceGetModuleProperties, via 5585 /// `pNext` member of ::ze_device_module_properties_t. 5586 typedef struct _ze_device_raytracing_ext_properties_t 5587 { 5588 ze_structure_type_t stype; ///< [in] type of this structure 5589 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 5590 ///< structure (i.e. contains sType and pNext). 5591 ze_device_raytracing_ext_flags_t flags; ///< [out] 0 or a valid combination of ::ze_device_raytracing_ext_flags_t 5592 uint32_t maxBVHLevels; ///< [out] Maximum number of BVH levels supported 5593 5594 } ze_device_raytracing_ext_properties_t; 5595 5596 /////////////////////////////////////////////////////////////////////////////// 5597 /// @brief Supported raytracing memory allocation flags 5598 typedef uint32_t ze_raytracing_mem_alloc_ext_flags_t; 5599 typedef enum _ze_raytracing_mem_alloc_ext_flag_t 5600 { 5601 ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_TBD = ZE_BIT(0), ///< reserved for future use 5602 ZE_RAYTRACING_MEM_ALLOC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff 5603 5604 } ze_raytracing_mem_alloc_ext_flag_t; 5605 5606 /////////////////////////////////////////////////////////////////////////////// 5607 /// @brief Raytracing memory allocation descriptor 5608 /// 5609 /// @details 5610 /// - This structure must be passed to ::zeMemAllocShared or 5611 /// ::zeMemAllocDevice, via `pNext` member of 5612 /// ::ze_device_mem_alloc_desc_t, for any memory allocation that is to be 5613 /// accessed by raytracing fixed-function of the device. 5614 typedef struct _ze_raytracing_mem_alloc_ext_desc_t 5615 { 5616 ze_structure_type_t stype; ///< [in] type of this structure 5617 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 5618 ///< structure (i.e. contains sType and pNext). 5619 ze_raytracing_mem_alloc_ext_flags_t flags; ///< [in] flags specifying additional allocation controls. 5620 ///< must be 0 (default) or a valid combination of ::ze_raytracing_mem_alloc_ext_flag_t; 5621 ///< default behavior may use implicit driver-based heuristics. 5622 5623 } ze_raytracing_mem_alloc_ext_desc_t; 5624 5625 #if !defined(__GNUC__) 5626 #pragma endregion 5627 #endif 5628 // Intel 'oneAPI' Level-Zero APIs for Memory Residency 5629 #if !defined(__GNUC__) 5630 #pragma region residency 5631 #endif 5632 /////////////////////////////////////////////////////////////////////////////// 5633 /// @brief Makes memory resident for the device. 5634 /// 5635 /// @details 5636 /// - The application must ensure the memory is resident before being 5637 /// referenced by the device 5638 /// - The application may call this function from simultaneous threads. 5639 /// - The implementation of this function should be lock-free. 5640 /// 5641 /// @returns 5642 /// - ::ZE_RESULT_SUCCESS 5643 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5644 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5645 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5646 /// + `nullptr == hContext` 5647 /// + `nullptr == hDevice` 5648 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5649 /// + `nullptr == ptr` 5650 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 5651 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 5652 ZE_APIEXPORT ze_result_t ZE_APICALL 5653 zeContextMakeMemoryResident( 5654 ze_context_handle_t hContext, ///< [in] handle of context object 5655 ze_device_handle_t hDevice, ///< [in] handle of the device 5656 void* ptr, ///< [in] pointer to memory to make resident 5657 size_t size ///< [in] size in bytes to make resident 5658 ); 5659 5660 /////////////////////////////////////////////////////////////////////////////// 5661 /// @brief Allows memory to be evicted from the device. 5662 /// 5663 /// @details 5664 /// - The application must ensure the device is not currently referencing 5665 /// the memory before it is evicted 5666 /// - The application may free the memory without evicting; the memory is 5667 /// implicitly evicted when freed. 5668 /// - The application may call this function from simultaneous threads. 5669 /// - The implementation of this function should be lock-free. 5670 /// 5671 /// @returns 5672 /// - ::ZE_RESULT_SUCCESS 5673 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5674 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5675 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5676 /// + `nullptr == hContext` 5677 /// + `nullptr == hDevice` 5678 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5679 /// + `nullptr == ptr` 5680 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 5681 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 5682 ZE_APIEXPORT ze_result_t ZE_APICALL 5683 zeContextEvictMemory( 5684 ze_context_handle_t hContext, ///< [in] handle of context object 5685 ze_device_handle_t hDevice, ///< [in] handle of the device 5686 void* ptr, ///< [in] pointer to memory to evict 5687 size_t size ///< [in] size in bytes to evict 5688 ); 5689 5690 /////////////////////////////////////////////////////////////////////////////// 5691 /// @brief Makes image resident for the device. 5692 /// 5693 /// @details 5694 /// - The application must ensure the image is resident before being 5695 /// referenced by the device 5696 /// - The application may call this function from simultaneous threads. 5697 /// - The implementation of this function should be lock-free. 5698 /// 5699 /// @returns 5700 /// - ::ZE_RESULT_SUCCESS 5701 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5702 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5703 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5704 /// + `nullptr == hContext` 5705 /// + `nullptr == hDevice` 5706 /// + `nullptr == hImage` 5707 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 5708 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 5709 ZE_APIEXPORT ze_result_t ZE_APICALL 5710 zeContextMakeImageResident( 5711 ze_context_handle_t hContext, ///< [in] handle of context object 5712 ze_device_handle_t hDevice, ///< [in] handle of the device 5713 ze_image_handle_t hImage ///< [in] handle of image to make resident 5714 ); 5715 5716 /////////////////////////////////////////////////////////////////////////////// 5717 /// @brief Allows image to be evicted from the device. 5718 /// 5719 /// @details 5720 /// - The application must ensure the device is not currently referencing 5721 /// the image before it is evicted 5722 /// - The application may destroy the image without evicting; the image is 5723 /// implicitly evicted when destroyed. 5724 /// - The application may call this function from simultaneous threads. 5725 /// - The implementation of this function should be lock-free. 5726 /// 5727 /// @returns 5728 /// - ::ZE_RESULT_SUCCESS 5729 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5730 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5731 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5732 /// + `nullptr == hContext` 5733 /// + `nullptr == hDevice` 5734 /// + `nullptr == hImage` 5735 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 5736 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 5737 ZE_APIEXPORT ze_result_t ZE_APICALL 5738 zeContextEvictImage( 5739 ze_context_handle_t hContext, ///< [in] handle of context object 5740 ze_device_handle_t hDevice, ///< [in] handle of the device 5741 ze_image_handle_t hImage ///< [in] handle of image to make evict 5742 ); 5743 5744 #if !defined(__GNUC__) 5745 #pragma endregion 5746 #endif 5747 // Intel 'oneAPI' Level-Zero APIs for Sampler 5748 #if !defined(__GNUC__) 5749 #pragma region sampler 5750 #endif 5751 /////////////////////////////////////////////////////////////////////////////// 5752 /// @brief Sampler addressing modes 5753 typedef enum _ze_sampler_address_mode_t 5754 { 5755 ZE_SAMPLER_ADDRESS_MODE_NONE = 0, ///< No coordinate modifications for out-of-bounds image access. 5756 ZE_SAMPLER_ADDRESS_MODE_REPEAT = 1, ///< Out-of-bounds coordinates are wrapped back around. 5757 ZE_SAMPLER_ADDRESS_MODE_CLAMP = 2, ///< Out-of-bounds coordinates are clamped to edge. 5758 ZE_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3, ///< Out-of-bounds coordinates are clamped to border color which is (0.0f, 5759 ///< 0.0f, 0.0f, 0.0f) if image format swizzle contains alpha, otherwise 5760 ///< (0.0f, 0.0f, 0.0f, 1.0f). 5761 ZE_SAMPLER_ADDRESS_MODE_MIRROR = 4, ///< Out-of-bounds coordinates are mirrored starting from edge. 5762 ZE_SAMPLER_ADDRESS_MODE_FORCE_UINT32 = 0x7fffffff 5763 5764 } ze_sampler_address_mode_t; 5765 5766 /////////////////////////////////////////////////////////////////////////////// 5767 /// @brief Sampler filtering modes 5768 typedef enum _ze_sampler_filter_mode_t 5769 { 5770 ZE_SAMPLER_FILTER_MODE_NEAREST = 0, ///< No coordinate modifications for out of bounds image access. 5771 ZE_SAMPLER_FILTER_MODE_LINEAR = 1, ///< Out-of-bounds coordinates are wrapped back around. 5772 ZE_SAMPLER_FILTER_MODE_FORCE_UINT32 = 0x7fffffff 5773 5774 } ze_sampler_filter_mode_t; 5775 5776 /////////////////////////////////////////////////////////////////////////////// 5777 /// @brief Sampler descriptor 5778 typedef struct _ze_sampler_desc_t 5779 { 5780 ze_structure_type_t stype; ///< [in] type of this structure 5781 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 5782 ///< structure (i.e. contains sType and pNext). 5783 ze_sampler_address_mode_t addressMode; ///< [in] Sampler addressing mode to determine how out-of-bounds 5784 ///< coordinates are handled. 5785 ze_sampler_filter_mode_t filterMode; ///< [in] Sampler filter mode to determine how samples are filtered. 5786 ze_bool_t isNormalized; ///< [in] Are coordinates normalized [0, 1] or not. 5787 5788 } ze_sampler_desc_t; 5789 5790 /////////////////////////////////////////////////////////////////////////////// 5791 /// @brief Creates sampler on the context. 5792 /// 5793 /// @details 5794 /// - The application must only use the sampler for the device, or its 5795 /// sub-devices, which was provided during creation. 5796 /// - The application may call this function from simultaneous threads. 5797 /// - The implementation of this function must be thread-safe. 5798 /// 5799 /// @returns 5800 /// - ::ZE_RESULT_SUCCESS 5801 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5802 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5803 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5804 /// + `nullptr == hContext` 5805 /// + `nullptr == hDevice` 5806 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5807 /// + `nullptr == desc` 5808 /// + `nullptr == phSampler` 5809 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 5810 /// + `::ZE_SAMPLER_ADDRESS_MODE_MIRROR < desc->addressMode` 5811 /// + `::ZE_SAMPLER_FILTER_MODE_LINEAR < desc->filterMode` 5812 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 5813 ZE_APIEXPORT ze_result_t ZE_APICALL 5814 zeSamplerCreate( 5815 ze_context_handle_t hContext, ///< [in] handle of the context object 5816 ze_device_handle_t hDevice, ///< [in] handle of the device 5817 const ze_sampler_desc_t* desc, ///< [in] pointer to sampler descriptor 5818 ze_sampler_handle_t* phSampler ///< [out] handle of the sampler 5819 ); 5820 5821 /////////////////////////////////////////////////////////////////////////////// 5822 /// @brief Destroys sampler object 5823 /// 5824 /// @details 5825 /// - The application must ensure the device is not currently referencing 5826 /// the sampler before it is deleted. 5827 /// - The implementation of this function may immediately free all Host and 5828 /// Device allocations associated with this sampler. 5829 /// - The application must **not** call this function from simultaneous 5830 /// threads with the same sampler handle. 5831 /// - The implementation of this function must be thread-safe. 5832 /// 5833 /// @returns 5834 /// - ::ZE_RESULT_SUCCESS 5835 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5836 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5837 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5838 /// + `nullptr == hSampler` 5839 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 5840 ZE_APIEXPORT ze_result_t ZE_APICALL 5841 zeSamplerDestroy( 5842 ze_sampler_handle_t hSampler ///< [in][release] handle of the sampler 5843 ); 5844 5845 #if !defined(__GNUC__) 5846 #pragma endregion 5847 #endif 5848 // Intel 'oneAPI' Level-Zero APIs for Virtual Memory Management 5849 #if !defined(__GNUC__) 5850 #pragma region virtual 5851 #endif 5852 /////////////////////////////////////////////////////////////////////////////// 5853 /// @brief Virtual memory page access attributes 5854 typedef enum _ze_memory_access_attribute_t 5855 { 5856 ZE_MEMORY_ACCESS_ATTRIBUTE_NONE = 0, ///< Indicates the memory page is inaccessible. 5857 ZE_MEMORY_ACCESS_ATTRIBUTE_READWRITE = 1, ///< Indicates the memory page supports read write access. 5858 ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY = 2, ///< Indicates the memory page supports read-only access. 5859 ZE_MEMORY_ACCESS_ATTRIBUTE_FORCE_UINT32 = 0x7fffffff 5860 5861 } ze_memory_access_attribute_t; 5862 5863 /////////////////////////////////////////////////////////////////////////////// 5864 /// @brief Reserves pages in virtual address space. 5865 /// 5866 /// @details 5867 /// - The application must only use the memory allocation on the context for 5868 /// which it was created. 5869 /// - The starting address and size must be page aligned. See 5870 /// ::zeVirtualMemQueryPageSize. 5871 /// - If pStart is not null then implementation will attempt to reserve 5872 /// starting from that address. If not available then will find another 5873 /// suitable starting address. 5874 /// - The application may call this function from simultaneous threads. 5875 /// - The access attributes will default to none to indicate reservation is 5876 /// inaccessible. 5877 /// - The implementation of this function must be thread-safe. 5878 /// 5879 /// @returns 5880 /// - ::ZE_RESULT_SUCCESS 5881 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5882 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5883 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5884 /// + `nullptr == hContext` 5885 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5886 /// + `nullptr == pStart` 5887 /// + `nullptr == pptr` 5888 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE 5889 /// + `0 == size` 5890 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 5891 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 5892 ZE_APIEXPORT ze_result_t ZE_APICALL 5893 zeVirtualMemReserve( 5894 ze_context_handle_t hContext, ///< [in] handle of the context object 5895 const void* pStart, ///< [in] pointer to start of region to reserve. If nullptr then 5896 ///< implementation will choose a start address. 5897 size_t size, ///< [in] size in bytes to reserve; must be page aligned. 5898 void** pptr ///< [out] pointer to virtual reservation. 5899 ); 5900 5901 /////////////////////////////////////////////////////////////////////////////// 5902 /// @brief Free pages in a reserved virtual address range. 5903 /// 5904 /// @details 5905 /// - Any existing virtual mappings for the range will be unmapped. 5906 /// - Physical allocations objects that were mapped to this range will not 5907 /// be destroyed. These need to be destroyed explicitly. 5908 /// - The application may call this function from simultaneous threads. 5909 /// - The implementation of this function must be thread-safe. 5910 /// 5911 /// @returns 5912 /// - ::ZE_RESULT_SUCCESS 5913 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5914 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5915 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5916 /// + `nullptr == hContext` 5917 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5918 /// + `nullptr == ptr` 5919 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE 5920 /// + `0 == size` 5921 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT 5922 ZE_APIEXPORT ze_result_t ZE_APICALL 5923 zeVirtualMemFree( 5924 ze_context_handle_t hContext, ///< [in] handle of the context object 5925 const void* ptr, ///< [in] pointer to start of region to free. 5926 size_t size ///< [in] size in bytes to free; must be page aligned. 5927 ); 5928 5929 /////////////////////////////////////////////////////////////////////////////// 5930 /// @brief Queries page size to use for aligning virtual memory reservations and 5931 /// physical memory allocations. 5932 /// 5933 /// @details 5934 /// - The application may call this function from simultaneous threads. 5935 /// - The implementation of this function must be thread-safe. 5936 /// 5937 /// @returns 5938 /// - ::ZE_RESULT_SUCCESS 5939 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5940 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5941 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5942 /// + `nullptr == hContext` 5943 /// + `nullptr == hDevice` 5944 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5945 /// + `nullptr == pagesize` 5946 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE 5947 /// + `0 == size` 5948 ZE_APIEXPORT ze_result_t ZE_APICALL 5949 zeVirtualMemQueryPageSize( 5950 ze_context_handle_t hContext, ///< [in] handle of the context object 5951 ze_device_handle_t hDevice, ///< [in] handle of the device object 5952 size_t size, ///< [in] unaligned allocation size in bytes 5953 size_t* pagesize ///< [out] pointer to page size to use for start address and size 5954 ///< alignments. 5955 ); 5956 5957 /////////////////////////////////////////////////////////////////////////////// 5958 /// @brief Supported physical memory creation flags 5959 typedef uint32_t ze_physical_mem_flags_t; 5960 typedef enum _ze_physical_mem_flag_t 5961 { 5962 ZE_PHYSICAL_MEM_FLAG_TBD = ZE_BIT(0), ///< reserved for future use. 5963 ZE_PHYSICAL_MEM_FLAG_FORCE_UINT32 = 0x7fffffff 5964 5965 } ze_physical_mem_flag_t; 5966 5967 /////////////////////////////////////////////////////////////////////////////// 5968 /// @brief Physical memory descriptor 5969 typedef struct _ze_physical_mem_desc_t 5970 { 5971 ze_structure_type_t stype; ///< [in] type of this structure 5972 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 5973 ///< structure (i.e. contains sType and pNext). 5974 ze_physical_mem_flags_t flags; ///< [in] creation flags. 5975 ///< must be 0 (default) or a valid combination of ::ze_physical_mem_flag_t. 5976 size_t size; ///< [in] size in bytes to reserve; must be page aligned. 5977 5978 } ze_physical_mem_desc_t; 5979 5980 /////////////////////////////////////////////////////////////////////////////// 5981 /// @brief Creates a physical memory object for the context. 5982 /// 5983 /// @details 5984 /// - The application must only use the physical memory object on the 5985 /// context for which it was created. 5986 /// - The size must be page aligned. See ::zeVirtualMemQueryPageSize. 5987 /// - The application may call this function from simultaneous threads. 5988 /// - The implementation of this function must be thread-safe. 5989 /// 5990 /// @returns 5991 /// - ::ZE_RESULT_SUCCESS 5992 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 5993 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 5994 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 5995 /// + `nullptr == hContext` 5996 /// + `nullptr == hDevice` 5997 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 5998 /// + `nullptr == desc` 5999 /// + `nullptr == phPhysicalMemory` 6000 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 6001 /// + `0x1 < desc->flags` 6002 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE 6003 /// + `0 == desc->size` 6004 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 6005 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT 6006 ZE_APIEXPORT ze_result_t ZE_APICALL 6007 zePhysicalMemCreate( 6008 ze_context_handle_t hContext, ///< [in] handle of the context object 6009 ze_device_handle_t hDevice, ///< [in] handle of the device object 6010 ze_physical_mem_desc_t* desc, ///< [in] pointer to physical memory descriptor. 6011 ze_physical_mem_handle_t* phPhysicalMemory ///< [out] pointer to handle of physical memory object created 6012 ); 6013 6014 /////////////////////////////////////////////////////////////////////////////// 6015 /// @brief Destroys a physical memory object. 6016 /// 6017 /// @details 6018 /// - The application must ensure the device is not currently referencing 6019 /// the physical memory object before it is deleted 6020 /// - The application must **not** call this function from simultaneous 6021 /// threads with the same physical memory handle. 6022 /// - The implementation of this function must be thread-safe. 6023 /// 6024 /// @returns 6025 /// - ::ZE_RESULT_SUCCESS 6026 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6027 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6028 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6029 /// + `nullptr == hContext` 6030 /// + `nullptr == hPhysicalMemory` 6031 /// - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE 6032 ZE_APIEXPORT ze_result_t ZE_APICALL 6033 zePhysicalMemDestroy( 6034 ze_context_handle_t hContext, ///< [in] handle of the context object 6035 ze_physical_mem_handle_t hPhysicalMemory ///< [in][release] handle of physical memory object to destroy 6036 ); 6037 6038 /////////////////////////////////////////////////////////////////////////////// 6039 /// @brief Maps pages in virtual address space to pages from physical memory 6040 /// object. 6041 /// 6042 /// @details 6043 /// - The virtual address range must have been reserved using 6044 /// ::zeVirtualMemReserve. 6045 /// - The application must only use the mapped memory allocation on the 6046 /// context for which it was created. 6047 /// - The virtual start address and size must be page aligned. See 6048 /// ::zeVirtualMemQueryPageSize. 6049 /// - The application should use, for the starting address and size, the 6050 /// same size alignment used for the physical allocation. 6051 /// - The application may call this function from simultaneous threads. 6052 /// - The implementation of this function must be thread-safe. 6053 /// 6054 /// @returns 6055 /// - ::ZE_RESULT_SUCCESS 6056 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6057 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6058 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6059 /// + `nullptr == hContext` 6060 /// + `nullptr == hPhysicalMemory` 6061 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 6062 /// + `nullptr == ptr` 6063 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 6064 /// + `::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY < access` 6065 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE 6066 /// + `0 == size` 6067 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 6068 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 6069 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT 6070 ZE_APIEXPORT ze_result_t ZE_APICALL 6071 zeVirtualMemMap( 6072 ze_context_handle_t hContext, ///< [in] handle of the context object 6073 const void* ptr, ///< [in] pointer to start of virtual address range to map. 6074 size_t size, ///< [in] size in bytes of virtual address range to map; must be page 6075 ///< aligned. 6076 ze_physical_mem_handle_t hPhysicalMemory, ///< [in] handle to physical memory object. 6077 size_t offset, ///< [in] offset into physical memory allocation object; must be page 6078 ///< aligned. 6079 ze_memory_access_attribute_t access ///< [in] specifies page access attributes to apply to the virtual address 6080 ///< range. 6081 ); 6082 6083 /////////////////////////////////////////////////////////////////////////////// 6084 /// @brief Unmaps pages in virtual address space from pages from a physical 6085 /// memory object. 6086 /// 6087 /// @details 6088 /// - The page access attributes for virtual address range will revert back 6089 /// to none. 6090 /// - The application may call this function from simultaneous threads. 6091 /// - The implementation of this function must be thread-safe. 6092 /// 6093 /// @returns 6094 /// - ::ZE_RESULT_SUCCESS 6095 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6096 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6097 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6098 /// + `nullptr == hContext` 6099 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 6100 /// + `nullptr == ptr` 6101 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 6102 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 6103 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT - "Address must be page aligned" 6104 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE 6105 /// + `0 == size` 6106 /// + Size must be page aligned 6107 ZE_APIEXPORT ze_result_t ZE_APICALL 6108 zeVirtualMemUnmap( 6109 ze_context_handle_t hContext, ///< [in] handle of the context object 6110 const void* ptr, ///< [in] pointer to start of region to unmap. 6111 size_t size ///< [in] size in bytes to unmap; must be page aligned. 6112 ); 6113 6114 /////////////////////////////////////////////////////////////////////////////// 6115 /// @brief Set memory access attributes for a virtual address range. 6116 /// 6117 /// @details 6118 /// - This function may be called from simultaneous threads with the same 6119 /// function handle. 6120 /// - The implementation of this function should be lock-free. 6121 /// 6122 /// @returns 6123 /// - ::ZE_RESULT_SUCCESS 6124 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6125 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6126 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6127 /// + `nullptr == hContext` 6128 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 6129 /// + `nullptr == ptr` 6130 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 6131 /// + `::ZE_MEMORY_ACCESS_ATTRIBUTE_READONLY < access` 6132 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT - "Address must be page aligned" 6133 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE 6134 /// + `0 == size` 6135 /// + Size must be page aligned 6136 ZE_APIEXPORT ze_result_t ZE_APICALL 6137 zeVirtualMemSetAccessAttribute( 6138 ze_context_handle_t hContext, ///< [in] handle of the context object 6139 const void* ptr, ///< [in] pointer to start of reserved virtual address region. 6140 size_t size, ///< [in] size in bytes; must be page aligned. 6141 ze_memory_access_attribute_t access ///< [in] specifies page access attributes to apply to the virtual address 6142 ///< range. 6143 ); 6144 6145 /////////////////////////////////////////////////////////////////////////////// 6146 /// @brief Get memory access attribute for a virtual address range. 6147 /// 6148 /// @details 6149 /// - If size and outSize are equal then the pages in the specified virtual 6150 /// address range have the same access attributes. 6151 /// - This function may be called from simultaneous threads with the same 6152 /// function handle. 6153 /// - The implementation of this function should be lock-free. 6154 /// 6155 /// @returns 6156 /// - ::ZE_RESULT_SUCCESS 6157 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6158 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6159 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6160 /// + `nullptr == hContext` 6161 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 6162 /// + `nullptr == ptr` 6163 /// + `nullptr == access` 6164 /// + `nullptr == outSize` 6165 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT - "Address must be page aligned" 6166 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE 6167 /// + `0 == size` 6168 /// + Size must be page aligned 6169 ZE_APIEXPORT ze_result_t ZE_APICALL 6170 zeVirtualMemGetAccessAttribute( 6171 ze_context_handle_t hContext, ///< [in] handle of the context object 6172 const void* ptr, ///< [in] pointer to start of virtual address region for query. 6173 size_t size, ///< [in] size in bytes; must be page aligned. 6174 ze_memory_access_attribute_t* access, ///< [out] query result for page access attribute. 6175 size_t* outSize ///< [out] query result for size of virtual address range, starting at ptr, 6176 ///< that shares same access attribute. 6177 ); 6178 6179 #if !defined(__GNUC__) 6180 #pragma endregion 6181 #endif 6182 // Intel 'oneAPI' Level-Zero Extension APIs for Floating-Point Atomics 6183 #if !defined(__GNUC__) 6184 #pragma region floatAtomics 6185 #endif 6186 /////////////////////////////////////////////////////////////////////////////// 6187 #ifndef ZE_FLOAT_ATOMICS_EXT_NAME 6188 /// @brief Floating-Point Atomics Extension Name 6189 #define ZE_FLOAT_ATOMICS_EXT_NAME "ZE_extension_float_atomics" 6190 #endif // ZE_FLOAT_ATOMICS_EXT_NAME 6191 6192 /////////////////////////////////////////////////////////////////////////////// 6193 /// @brief Floating-Point Atomics Extension Version(s) 6194 typedef enum _ze_float_atomics_ext_version_t 6195 { 6196 ZE_FLOAT_ATOMICS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 6197 ZE_FLOAT_ATOMICS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 6198 ZE_FLOAT_ATOMICS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 6199 6200 } ze_float_atomics_ext_version_t; 6201 6202 /////////////////////////////////////////////////////////////////////////////// 6203 /// @brief Supported floating-point atomic capability flags 6204 typedef uint32_t ze_device_fp_atomic_ext_flags_t; 6205 typedef enum _ze_device_fp_atomic_ext_flag_t 6206 { 6207 ZE_DEVICE_FP_ATOMIC_EXT_FLAG_GLOBAL_LOAD_STORE = ZE_BIT(0), ///< Supports atomic load, store, and exchange 6208 ZE_DEVICE_FP_ATOMIC_EXT_FLAG_GLOBAL_ADD = ZE_BIT(1),///< Supports atomic add and subtract 6209 ZE_DEVICE_FP_ATOMIC_EXT_FLAG_GLOBAL_MIN_MAX = ZE_BIT(2),///< Supports atomic min and max 6210 ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_LOAD_STORE = ZE_BIT(16), ///< Supports atomic load, store, and exchange 6211 ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_ADD = ZE_BIT(17),///< Supports atomic add and subtract 6212 ZE_DEVICE_FP_ATOMIC_EXT_FLAG_LOCAL_MIN_MAX = ZE_BIT(18),///< Supports atomic min and max 6213 ZE_DEVICE_FP_ATOMIC_EXT_FLAG_FORCE_UINT32 = 0x7fffffff 6214 6215 } ze_device_fp_atomic_ext_flag_t; 6216 6217 /////////////////////////////////////////////////////////////////////////////// 6218 /// @brief Device floating-point atomic properties queried using 6219 /// ::zeDeviceGetModuleProperties 6220 /// 6221 /// @details 6222 /// - This structure may be returned from ::zeDeviceGetModuleProperties, via 6223 /// `pNext` member of ::ze_device_module_properties_t. 6224 typedef struct _ze_float_atomic_ext_properties_t 6225 { 6226 ze_structure_type_t stype; ///< [in] type of this structure 6227 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 6228 ///< structure (i.e. contains sType and pNext). 6229 ze_device_fp_atomic_ext_flags_t fp16Flags; ///< [out] Capabilities for half-precision floating-point atomic operations 6230 ze_device_fp_atomic_ext_flags_t fp32Flags; ///< [out] Capabilities for single-precision floating-point atomic 6231 ///< operations 6232 ze_device_fp_atomic_ext_flags_t fp64Flags; ///< [out] Capabilities for double-precision floating-point atomic 6233 ///< operations 6234 6235 } ze_float_atomic_ext_properties_t; 6236 6237 #if !defined(__GNUC__) 6238 #pragma endregion 6239 #endif 6240 // Intel 'oneAPI' Level-Zero Extension for supporting kernel global work offset. 6241 #if !defined(__GNUC__) 6242 #pragma region globaloffset 6243 #endif 6244 /////////////////////////////////////////////////////////////////////////////// 6245 #ifndef ZE_GLOBAL_OFFSET_EXP_NAME 6246 /// @brief Global Offset Extension Name 6247 #define ZE_GLOBAL_OFFSET_EXP_NAME "ZE_experimental_global_offset" 6248 #endif // ZE_GLOBAL_OFFSET_EXP_NAME 6249 6250 /////////////////////////////////////////////////////////////////////////////// 6251 /// @brief Global Offset Extension Version(s) 6252 typedef enum _ze_global_offset_exp_version_t 6253 { 6254 ZE_GLOBAL_OFFSET_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 6255 ZE_GLOBAL_OFFSET_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 6256 ZE_GLOBAL_OFFSET_EXP_VERSION_FORCE_UINT32 = 0x7fffffff 6257 6258 } ze_global_offset_exp_version_t; 6259 6260 /////////////////////////////////////////////////////////////////////////////// 6261 /// @brief Set global work offset for a kernel. 6262 /// 6263 /// @details 6264 /// - The global work offset will be used when 6265 /// a ::zeCommandListAppendLaunchKernel() variant is called. 6266 /// - The application must **not** call this function from simultaneous 6267 /// threads with the same kernel handle. 6268 /// - The implementation of this function should be lock-free. 6269 /// 6270 /// @returns 6271 /// - ::ZE_RESULT_SUCCESS 6272 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6273 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6274 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6275 /// + `nullptr == hKernel` 6276 ZE_APIEXPORT ze_result_t ZE_APICALL 6277 zeKernelSetGlobalOffsetExp( 6278 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 6279 uint32_t offsetX, ///< [in] global offset for X dimension to use for this kernel 6280 uint32_t offsetY, ///< [in] global offset for Y dimension to use for this kernel 6281 uint32_t offsetZ ///< [in] global offset for Z dimension to use for this kernel 6282 ); 6283 6284 #if !defined(__GNUC__) 6285 #pragma endregion 6286 #endif 6287 // Intel 'oneAPI' Level-Zero Extension for supporting relaxed allocation limits. 6288 #if !defined(__GNUC__) 6289 #pragma region relaxedAllocLimits 6290 #endif 6291 /////////////////////////////////////////////////////////////////////////////// 6292 #ifndef ZE_RELAXED_ALLOCATION_LIMITS_EXP_NAME 6293 /// @brief Relaxed Allocation Limits Extension Name 6294 #define ZE_RELAXED_ALLOCATION_LIMITS_EXP_NAME "ZE_experimental_relaxed_allocation_limits" 6295 #endif // ZE_RELAXED_ALLOCATION_LIMITS_EXP_NAME 6296 6297 /////////////////////////////////////////////////////////////////////////////// 6298 /// @brief Relaxed Allocation Limits Extension Version(s) 6299 typedef enum _ze_relaxed_allocation_limits_exp_version_t 6300 { 6301 ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 6302 ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 6303 ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff 6304 6305 } ze_relaxed_allocation_limits_exp_version_t; 6306 6307 /////////////////////////////////////////////////////////////////////////////// 6308 /// @brief Supported relaxed memory allocation flags 6309 typedef uint32_t ze_relaxed_allocation_limits_exp_flags_t; 6310 typedef enum _ze_relaxed_allocation_limits_exp_flag_t 6311 { 6312 ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE = ZE_BIT(0), ///< Allocation size may exceed ::ze_device_properties_t.maxMemAllocSize 6313 ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_FORCE_UINT32 = 0x7fffffff 6314 6315 } ze_relaxed_allocation_limits_exp_flag_t; 6316 6317 /////////////////////////////////////////////////////////////////////////////// 6318 /// @brief Relaxed limits memory allocation descriptor 6319 /// 6320 /// @details 6321 /// - This structure may be passed to ::zeMemAllocShared or 6322 /// ::zeMemAllocDevice, via `pNext` member of 6323 /// ::ze_device_mem_alloc_desc_t. 6324 /// - This structure may also be passed to ::zeMemAllocHost, via `pNext` 6325 /// member of ::ze_host_mem_alloc_desc_t. 6326 typedef struct _ze_relaxed_allocation_limits_exp_desc_t 6327 { 6328 ze_structure_type_t stype; ///< [in] type of this structure 6329 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 6330 ///< structure (i.e. contains sType and pNext). 6331 ze_relaxed_allocation_limits_exp_flags_t flags; ///< [in] flags specifying allocation limits to relax. 6332 ///< must be 0 (default) or a valid combination of ::ze_relaxed_allocation_limits_exp_flag_t; 6333 6334 } ze_relaxed_allocation_limits_exp_desc_t; 6335 6336 #if !defined(__GNUC__) 6337 #pragma endregion 6338 #endif 6339 // Intel 'oneAPI' Level-Zero Extension APIs for Cache Reservation 6340 #if !defined(__GNUC__) 6341 #pragma region cacheReservation 6342 #endif 6343 /////////////////////////////////////////////////////////////////////////////// 6344 #ifndef ZE_CACHE_RESERVATION_EXT_NAME 6345 /// @brief Cache_Reservation Extension Name 6346 #define ZE_CACHE_RESERVATION_EXT_NAME "ZE_extension_cache_reservation" 6347 #endif // ZE_CACHE_RESERVATION_EXT_NAME 6348 6349 /////////////////////////////////////////////////////////////////////////////// 6350 /// @brief Cache_Reservation Extension Version(s) 6351 typedef enum _ze_cache_reservation_ext_version_t 6352 { 6353 ZE_CACHE_RESERVATION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 6354 ZE_CACHE_RESERVATION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 6355 ZE_CACHE_RESERVATION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 6356 6357 } ze_cache_reservation_ext_version_t; 6358 6359 /////////////////////////////////////////////////////////////////////////////// 6360 /// @brief Cache Reservation Region 6361 typedef enum _ze_cache_ext_region_t 6362 { 6363 ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT = 0,///< utilize driver default scheme 6364 ZE_CACHE_EXT_REGION_ZE_CACHE_RESERVE_REGION = 1,///< Utilize reserver region 6365 ZE_CACHE_EXT_REGION_ZE_CACHE_NON_RESERVED_REGION = 2, ///< Utilize non-reserverd region 6366 ZE_CACHE_EXT_REGION_FORCE_UINT32 = 0x7fffffff 6367 6368 } ze_cache_ext_region_t; 6369 6370 /////////////////////////////////////////////////////////////////////////////// 6371 /// @brief CacheReservation structure 6372 /// 6373 /// @details 6374 /// - This structure must be passed to ::zeDeviceGetCacheProperties via 6375 /// `pNext` member of ::ze_device_cache_properties_t 6376 /// - Used for determining the max cache reservation allowed on device. Size 6377 /// of zero means no reservation available. 6378 typedef struct _ze_cache_reservation_ext_desc_t 6379 { 6380 ze_structure_type_t stype; ///< [in] type of this structure 6381 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 6382 ///< structure (i.e. contains sType and pNext). 6383 size_t maxCacheReservationSize; ///< [out] max cache reservation size 6384 6385 } ze_cache_reservation_ext_desc_t; 6386 6387 /////////////////////////////////////////////////////////////////////////////// 6388 /// @brief Reserve Cache on Device 6389 /// 6390 /// @details 6391 /// - The application may call this function but may not be successful as 6392 /// some other application may have reserve prior 6393 /// 6394 /// @remarks 6395 /// _Analogues_ 6396 /// - None 6397 /// 6398 /// @returns 6399 /// - ::ZE_RESULT_SUCCESS 6400 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6401 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6402 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6403 /// + `nullptr == hDevice` 6404 ZE_APIEXPORT ze_result_t ZE_APICALL 6405 zeDeviceReserveCacheExt( 6406 ze_device_handle_t hDevice, ///< [in] handle of the device object 6407 size_t cacheLevel, ///< [in] cache level where application want to reserve. If zero, then the 6408 ///< driver shall default to last level of cache and attempt to reserve in 6409 ///< that cache. 6410 size_t cacheReservationSize ///< [in] value for reserving size, in bytes. If zero, then the driver 6411 ///< shall remove prior reservation 6412 ); 6413 6414 /////////////////////////////////////////////////////////////////////////////// 6415 /// @brief Assign VA section to use reserved section 6416 /// 6417 /// @details 6418 /// - The application may call this function to assign VA to particular 6419 /// reservartion region 6420 /// 6421 /// @returns 6422 /// - ::ZE_RESULT_SUCCESS 6423 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6424 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6425 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6426 /// + `nullptr == hDevice` 6427 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 6428 /// + `nullptr == ptr` 6429 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 6430 /// + `::ZE_CACHE_EXT_REGION_::ZE_CACHE_NON_RESERVED_REGION < cacheRegion` 6431 ZE_APIEXPORT ze_result_t ZE_APICALL 6432 zeDeviceSetCacheAdviceExt( 6433 ze_device_handle_t hDevice, ///< [in] handle of the device object 6434 void* ptr, ///< [in] memory pointer to query 6435 size_t regionSize, ///< [in] region size, in pages 6436 ze_cache_ext_region_t cacheRegion ///< [in] reservation region 6437 ); 6438 6439 #if !defined(__GNUC__) 6440 #pragma endregion 6441 #endif 6442 // Intel 'oneAPI' Level-Zero Extension for supporting event query timestamps. 6443 #if !defined(__GNUC__) 6444 #pragma region eventquerytimestamps 6445 #endif 6446 /////////////////////////////////////////////////////////////////////////////// 6447 #ifndef ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME 6448 /// @brief Event Query Timestamps Extension Name 6449 #define ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME "ZE_experimental_event_query_timestamps" 6450 #endif // ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME 6451 6452 /////////////////////////////////////////////////////////////////////////////// 6453 /// @brief Event Query Timestamps Extension Version(s) 6454 typedef enum _ze_event_query_timestamps_exp_version_t 6455 { 6456 ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 6457 ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version 6458 ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff 6459 6460 } ze_event_query_timestamps_exp_version_t; 6461 6462 /////////////////////////////////////////////////////////////////////////////// 6463 /// @brief Query event timestamps for a device or sub-device. 6464 /// 6465 /// @details 6466 /// - The application may call this function from simultaneous threads. 6467 /// - The implementation of this function must be thread-safe. 6468 /// - The implementation must support 6469 /// ::ZE_experimental_event_query_timestamps. 6470 /// - The implementation must return all timestamps for the specified event 6471 /// and device pair. 6472 /// - The implementation must return all timestamps for all sub-devices when 6473 /// device handle is parent device. 6474 /// - The implementation may return all timestamps for sub-devices when 6475 /// device handle is sub-device or may return 0 for count. 6476 /// 6477 /// @remarks 6478 /// _Analogues_ 6479 /// - None 6480 /// 6481 /// @returns 6482 /// - ::ZE_RESULT_SUCCESS 6483 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6484 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6485 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6486 /// + `nullptr == hEvent` 6487 /// + `nullptr == hDevice` 6488 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 6489 /// + `nullptr == pCount` 6490 ZE_APIEXPORT ze_result_t ZE_APICALL 6491 zeEventQueryTimestampsExp( 6492 ze_event_handle_t hEvent, ///< [in] handle of the event 6493 ze_device_handle_t hDevice, ///< [in] handle of the device to query 6494 uint32_t* pCount, ///< [in,out] pointer to the number of timestamp results. 6495 ///< if count is zero, then the driver shall update the value with the 6496 ///< total number of timestamps available. 6497 ///< if count is greater than the number of timestamps available, then the 6498 ///< driver shall update the value with the correct number of timestamps available. 6499 ze_kernel_timestamp_result_t* pTimestamps ///< [in,out][optional][range(0, *pCount)] array of timestamp results. 6500 ///< if count is less than the number of timestamps available, then driver 6501 ///< shall only retrieve that number of timestamps. 6502 ); 6503 6504 #if !defined(__GNUC__) 6505 #pragma endregion 6506 #endif 6507 // Intel 'oneAPI' Level-Zero Extension for supporting image memory properties. 6508 #if !defined(__GNUC__) 6509 #pragma region imagememoryproperties 6510 #endif 6511 /////////////////////////////////////////////////////////////////////////////// 6512 #ifndef ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME 6513 /// @brief Image Memory Properties Extension Name 6514 #define ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME "ZE_experimental_image_memory_properties" 6515 #endif // ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME 6516 6517 /////////////////////////////////////////////////////////////////////////////// 6518 /// @brief Image Memory Properties Extension Version(s) 6519 typedef enum _ze_image_memory_properties_exp_version_t 6520 { 6521 ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 6522 ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 6523 ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_FORCE_UINT32 = 0x7fffffff 6524 6525 } ze_image_memory_properties_exp_version_t; 6526 6527 /////////////////////////////////////////////////////////////////////////////// 6528 /// @brief Image memory properties 6529 typedef struct _ze_image_memory_properties_exp_t 6530 { 6531 ze_structure_type_t stype; ///< [in] type of this structure 6532 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 6533 ///< structure (i.e. contains sType and pNext). 6534 uint64_t size; ///< [out] size of image allocation in bytes. 6535 uint64_t rowPitch; ///< [out] size of image row in bytes. 6536 uint64_t slicePitch; ///< [out] size of image slice in bytes. 6537 6538 } ze_image_memory_properties_exp_t; 6539 6540 /////////////////////////////////////////////////////////////////////////////// 6541 /// @brief Query image memory properties. 6542 /// 6543 /// @details 6544 /// - The application may call this function from simultaneous threads. 6545 /// - The implementation of this function must be thread-safe. 6546 /// - The implementation must support 6547 /// ::ZE_experimental_image_memory_properties extension. 6548 /// 6549 /// @remarks 6550 /// _Analogues_ 6551 /// - None 6552 /// 6553 /// @returns 6554 /// - ::ZE_RESULT_SUCCESS 6555 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6556 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6557 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6558 /// + `nullptr == hImage` 6559 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 6560 /// + `nullptr == pMemoryProperties` 6561 ZE_APIEXPORT ze_result_t ZE_APICALL 6562 zeImageGetMemoryPropertiesExp( 6563 ze_image_handle_t hImage, ///< [in] handle of image object 6564 ze_image_memory_properties_exp_t* pMemoryProperties ///< [in,out] query result for image memory properties. 6565 ); 6566 6567 #if !defined(__GNUC__) 6568 #pragma endregion 6569 #endif 6570 // Intel 'oneAPI' Level-Zero Extension for supporting image views. 6571 #if !defined(__GNUC__) 6572 #pragma region imageview 6573 #endif 6574 /////////////////////////////////////////////////////////////////////////////// 6575 #ifndef ZE_IMAGE_VIEW_EXP_NAME 6576 /// @brief Image View Extension Name 6577 #define ZE_IMAGE_VIEW_EXP_NAME "ZE_experimental_image_view" 6578 #endif // ZE_IMAGE_VIEW_EXP_NAME 6579 6580 /////////////////////////////////////////////////////////////////////////////// 6581 /// @brief Image View Extension Version(s) 6582 typedef enum _ze_image_view_exp_version_t 6583 { 6584 ZE_IMAGE_VIEW_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 6585 ZE_IMAGE_VIEW_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version 6586 ZE_IMAGE_VIEW_EXP_VERSION_FORCE_UINT32 = 0x7fffffff 6587 6588 } ze_image_view_exp_version_t; 6589 6590 /////////////////////////////////////////////////////////////////////////////// 6591 /// @brief Create image view on the context. 6592 /// 6593 /// @details 6594 /// - The application must only use the image view for the device, or its 6595 /// sub-devices, which was provided during creation. 6596 /// - The application may call this function from simultaneous threads. 6597 /// - The implementation of this function must be thread-safe. 6598 /// - The implementation must support ::ZE_experimental_image_view 6599 /// extension. 6600 /// - Image views are treated as images from the API. 6601 /// - Image views provide a mechanism to redescribe how an image is 6602 /// interpreted (e.g. different format). 6603 /// - Image views become disabled when their corresponding image resource is 6604 /// destroyed. 6605 /// - Use ::zeImageDestroy to destroy image view objects. 6606 /// 6607 /// @remarks 6608 /// _Analogues_ 6609 /// - None 6610 /// 6611 /// @returns 6612 /// - ::ZE_RESULT_SUCCESS 6613 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6614 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6615 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6616 /// + `nullptr == hContext` 6617 /// + `nullptr == hDevice` 6618 /// + `nullptr == hImage` 6619 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 6620 /// + `nullptr == desc` 6621 /// + `nullptr == phImageView` 6622 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 6623 /// + `0x3 < desc->flags` 6624 /// + `::ZE_IMAGE_TYPE_BUFFER < desc->type` 6625 /// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT 6626 /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY 6627 /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY 6628 ZE_APIEXPORT ze_result_t ZE_APICALL 6629 zeImageViewCreateExp( 6630 ze_context_handle_t hContext, ///< [in] handle of the context object 6631 ze_device_handle_t hDevice, ///< [in] handle of the device 6632 const ze_image_desc_t* desc, ///< [in] pointer to image descriptor 6633 ze_image_handle_t hImage, ///< [in] handle of image object to create view from 6634 ze_image_handle_t* phImageView ///< [out] pointer to handle of image object created for view 6635 ); 6636 6637 #if !defined(__GNUC__) 6638 #pragma endregion 6639 #endif 6640 // Intel 'oneAPI' Level-Zero Extension for supporting image views for planar images. 6641 #if !defined(__GNUC__) 6642 #pragma region imageviewplanar 6643 #endif 6644 /////////////////////////////////////////////////////////////////////////////// 6645 #ifndef ZE_IMAGE_VIEW_PLANAR_EXP_NAME 6646 /// @brief Image View Planar Extension Name 6647 #define ZE_IMAGE_VIEW_PLANAR_EXP_NAME "ZE_experimental_image_view_planar" 6648 #endif // ZE_IMAGE_VIEW_PLANAR_EXP_NAME 6649 6650 /////////////////////////////////////////////////////////////////////////////// 6651 /// @brief Image View Planar Extension Version(s) 6652 typedef enum _ze_image_view_planar_exp_version_t 6653 { 6654 ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 6655 ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 6656 ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_FORCE_UINT32 = 0x7fffffff 6657 6658 } ze_image_view_planar_exp_version_t; 6659 6660 /////////////////////////////////////////////////////////////////////////////// 6661 /// @brief Image view planar descriptor 6662 typedef struct _ze_image_view_planar_exp_desc_t 6663 { 6664 ze_structure_type_t stype; ///< [in] type of this structure 6665 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 6666 ///< structure (i.e. contains sType and pNext). 6667 uint32_t planeIndex; ///< [in] the 0-based plane index (e.g. NV12 is 0 = Y plane, 1 UV plane) 6668 6669 } ze_image_view_planar_exp_desc_t; 6670 6671 #if !defined(__GNUC__) 6672 #pragma endregion 6673 #endif 6674 // Intel 'oneAPI' Level-Zero Extension for specifying kernel scheduling hints. 6675 #if !defined(__GNUC__) 6676 #pragma region kernelSchedulingHints 6677 #endif 6678 /////////////////////////////////////////////////////////////////////////////// 6679 #ifndef ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME 6680 /// @brief Kernel Scheduling Hints Extension Name 6681 #define ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME "ZE_experimental_scheduling_hints" 6682 #endif // ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME 6683 6684 /////////////////////////////////////////////////////////////////////////////// 6685 /// @brief Kernel Scheduling Hints Extension Version(s) 6686 typedef enum _ze_scheduling_hints_exp_version_t 6687 { 6688 ZE_SCHEDULING_HINTS_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 6689 ZE_SCHEDULING_HINTS_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 6690 ZE_SCHEDULING_HINTS_EXP_VERSION_FORCE_UINT32 = 0x7fffffff 6691 6692 } ze_scheduling_hints_exp_version_t; 6693 6694 /////////////////////////////////////////////////////////////////////////////// 6695 /// @brief Supported kernel scheduling hint flags 6696 typedef uint32_t ze_scheduling_hint_exp_flags_t; 6697 typedef enum _ze_scheduling_hint_exp_flag_t 6698 { 6699 ZE_SCHEDULING_HINT_EXP_FLAG_OLDEST_FIRST = ZE_BIT(0), ///< Hint that the kernel prefers oldest-first scheduling 6700 ZE_SCHEDULING_HINT_EXP_FLAG_ROUND_ROBIN = ZE_BIT(1),///< Hint that the kernel prefers round-robin scheduling 6701 ZE_SCHEDULING_HINT_EXP_FLAG_STALL_BASED_ROUND_ROBIN = ZE_BIT(2),///< Hint that the kernel prefers stall-based round-robin scheduling 6702 ZE_SCHEDULING_HINT_EXP_FLAG_FORCE_UINT32 = 0x7fffffff 6703 6704 } ze_scheduling_hint_exp_flag_t; 6705 6706 /////////////////////////////////////////////////////////////////////////////// 6707 /// @brief Device kernel scheduling hint properties queried using 6708 /// ::zeDeviceGetModuleProperties 6709 /// 6710 /// @details 6711 /// - This structure may be returned from ::zeDeviceGetModuleProperties, via 6712 /// `pNext` member of ::ze_device_module_properties_t. 6713 typedef struct _ze_scheduling_hint_exp_properties_t 6714 { 6715 ze_structure_type_t stype; ///< [in] type of this structure 6716 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 6717 ///< structure (i.e. contains sType and pNext). 6718 ze_scheduling_hint_exp_flags_t schedulingHintFlags; ///< [out] Supported kernel scheduling hints. 6719 ///< May be 0 (none) or a valid combination of ::ze_scheduling_hint_exp_flag_t. 6720 6721 } ze_scheduling_hint_exp_properties_t; 6722 6723 /////////////////////////////////////////////////////////////////////////////// 6724 /// @brief Kernel scheduling hint descriptor 6725 /// 6726 /// @details 6727 /// - This structure may be passed to ::zeKernelSchedulingHintExp. 6728 typedef struct _ze_scheduling_hint_exp_desc_t 6729 { 6730 ze_structure_type_t stype; ///< [in] type of this structure 6731 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 6732 ///< structure (i.e. contains sType and pNext). 6733 ze_scheduling_hint_exp_flags_t flags; ///< [in] flags specifying kernel scheduling hints. 6734 ///< must be 0 (default) or a valid combination of ::ze_scheduling_hint_exp_flag_t. 6735 6736 } ze_scheduling_hint_exp_desc_t; 6737 6738 /////////////////////////////////////////////////////////////////////////////// 6739 /// @brief Provide kernel scheduling hints that may improve performance 6740 /// 6741 /// @details 6742 /// - The scheduling hints may improve performance only and are not required 6743 /// for correctness. 6744 /// - If a specified scheduling hint is unsupported it will be silently 6745 /// ignored. 6746 /// - If two conflicting scheduling hints are specified there is no defined behavior; 6747 /// the hints may be ignored or one hint may be chosen arbitrarily. 6748 /// - The application must not call this function from simultaneous threads 6749 /// with the same kernel handle. 6750 /// - The implementation of this function should be lock-free. 6751 /// 6752 /// @returns 6753 /// - ::ZE_RESULT_SUCCESS 6754 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6755 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6756 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6757 /// + `nullptr == hKernel` 6758 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 6759 /// + `nullptr == pHint` 6760 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 6761 /// + `0x7 < pHint->flags` 6762 ZE_APIEXPORT ze_result_t ZE_APICALL 6763 zeKernelSchedulingHintExp( 6764 ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object 6765 ze_scheduling_hint_exp_desc_t* pHint ///< [in] pointer to kernel scheduling hint descriptor 6766 ); 6767 6768 #if !defined(__GNUC__) 6769 #pragma endregion 6770 #endif 6771 // Intel 'oneAPI' Level-Zero Extension APIs for One-Definition-Rule Linkage Types 6772 #if !defined(__GNUC__) 6773 #pragma region linkonceodr 6774 #endif 6775 /////////////////////////////////////////////////////////////////////////////// 6776 #ifndef ZE_LINKONCE_ODR_EXT_NAME 6777 /// @brief Linkonce ODR Extension Name 6778 #define ZE_LINKONCE_ODR_EXT_NAME "ZE_extension_linkonce_odr" 6779 #endif // ZE_LINKONCE_ODR_EXT_NAME 6780 6781 /////////////////////////////////////////////////////////////////////////////// 6782 /// @brief Linkonce ODR Extension Version(s) 6783 typedef enum _ze_linkonce_odr_ext_version_t 6784 { 6785 ZE_LINKONCE_ODR_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 6786 ZE_LINKONCE_ODR_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 6787 ZE_LINKONCE_ODR_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 6788 6789 } ze_linkonce_odr_ext_version_t; 6790 6791 #if !defined(__GNUC__) 6792 #pragma endregion 6793 #endif 6794 // Intel 'oneAPI' Level-Zero Extension for supporting power saving hint. 6795 #if !defined(__GNUC__) 6796 #pragma region powersavinghint 6797 #endif 6798 /////////////////////////////////////////////////////////////////////////////// 6799 #ifndef ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME 6800 /// @brief Power Saving Hint Extension Name 6801 #define ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME "ZE_experimental_power_saving_hint" 6802 #endif // ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME 6803 6804 /////////////////////////////////////////////////////////////////////////////// 6805 /// @brief Power Saving Hint Extension Version(s) 6806 typedef enum _ze_power_saving_hint_exp_version_t 6807 { 6808 ZE_POWER_SAVING_HINT_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 6809 ZE_POWER_SAVING_HINT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 6810 ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff 6811 6812 } ze_power_saving_hint_exp_version_t; 6813 6814 /////////////////////////////////////////////////////////////////////////////// 6815 /// @brief Supported device types 6816 typedef enum _ze_power_saving_hint_type_t 6817 { 6818 ZE_POWER_SAVING_HINT_TYPE_MIN = 0, ///< Minumum power savings. The device will make no attempt to save power 6819 ///< while executing work submitted to this context. 6820 ZE_POWER_SAVING_HINT_TYPE_MAX = 100, ///< Maximum power savings. The device will do everything to bring power to 6821 ///< a minimum while executing work submitted to this context. 6822 ZE_POWER_SAVING_HINT_TYPE_FORCE_UINT32 = 0x7fffffff 6823 6824 } ze_power_saving_hint_type_t; 6825 6826 /////////////////////////////////////////////////////////////////////////////// 6827 /// @brief Extended context descriptor containing power saving hint. 6828 typedef struct _ze_context_power_saving_hint_exp_desc_t 6829 { 6830 ze_structure_type_t stype; ///< [in] type of this structure 6831 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 6832 ///< structure (i.e. contains sType and pNext). 6833 uint32_t hint; ///< [in] power saving hint (default value = 0). This is value from [0,100] 6834 ///< and can use pre-defined settings from ::ze_power_saving_hint_type_t. 6835 6836 } ze_context_power_saving_hint_exp_desc_t; 6837 6838 #if !defined(__GNUC__) 6839 #pragma endregion 6840 #endif 6841 // Intel 'oneAPI' Level-Zero Extension APIs for Subgroups 6842 #if !defined(__GNUC__) 6843 #pragma region subgroups 6844 #endif 6845 /////////////////////////////////////////////////////////////////////////////// 6846 #ifndef ZE_SUBGROUPS_EXT_NAME 6847 /// @brief Subgroups Extension Name 6848 #define ZE_SUBGROUPS_EXT_NAME "ZE_extension_subgroups" 6849 #endif // ZE_SUBGROUPS_EXT_NAME 6850 6851 /////////////////////////////////////////////////////////////////////////////// 6852 /// @brief Subgroups Extension Version(s) 6853 typedef enum _ze_subgroup_ext_version_t 6854 { 6855 ZE_SUBGROUP_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 6856 ZE_SUBGROUP_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 6857 ZE_SUBGROUP_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 6858 6859 } ze_subgroup_ext_version_t; 6860 6861 #if !defined(__GNUC__) 6862 #pragma endregion 6863 #endif 6864 // Intel 'oneAPI' Level-Zero Extension APIs for EU Count 6865 #if !defined(__GNUC__) 6866 #pragma region EUCount 6867 #endif 6868 /////////////////////////////////////////////////////////////////////////////// 6869 #ifndef ZE_EU_COUNT_EXT_NAME 6870 /// @brief EU Count Extension Name 6871 #define ZE_EU_COUNT_EXT_NAME "ZE_extension_eu_count" 6872 #endif // ZE_EU_COUNT_EXT_NAME 6873 6874 /////////////////////////////////////////////////////////////////////////////// 6875 /// @brief EU Count Extension Version(s) 6876 typedef enum _ze_eu_count_ext_version_t 6877 { 6878 ZE_EU_COUNT_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 6879 ZE_EU_COUNT_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 6880 ZE_EU_COUNT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 6881 6882 } ze_eu_count_ext_version_t; 6883 6884 /////////////////////////////////////////////////////////////////////////////// 6885 /// @brief EU count queried using ::zeDeviceGetProperties 6886 /// 6887 /// @details 6888 /// - This structure may be returned from ::zeDeviceGetProperties via 6889 /// `pNext` member of ::ze_device_properties_t 6890 /// - Used for determining the total number of EUs available on device. 6891 typedef struct _ze_eu_count_ext_t 6892 { 6893 ze_structure_type_t stype; ///< [in] type of this structure 6894 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 6895 ///< structure (i.e. contains sType and pNext). 6896 uint32_t numTotalEUs; ///< [out] Total number of EUs available 6897 6898 } ze_eu_count_ext_t; 6899 6900 #if !defined(__GNUC__) 6901 #pragma endregion 6902 #endif 6903 // Intel 'oneAPI' Level-Zero Extension APIs for PCI Properties 6904 #if !defined(__GNUC__) 6905 #pragma region PCIProperties 6906 #endif 6907 /////////////////////////////////////////////////////////////////////////////// 6908 #ifndef ZE_PCI_PROPERTIES_EXT_NAME 6909 /// @brief PCI Properties Extension Name 6910 #define ZE_PCI_PROPERTIES_EXT_NAME "ZE_extension_pci_properties" 6911 #endif // ZE_PCI_PROPERTIES_EXT_NAME 6912 6913 /////////////////////////////////////////////////////////////////////////////// 6914 /// @brief PCI Properties Extension Version(s) 6915 typedef enum _ze_pci_properties_ext_version_t 6916 { 6917 ZE_PCI_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 6918 ZE_PCI_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version 6919 ZE_PCI_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 6920 6921 } ze_pci_properties_ext_version_t; 6922 6923 /////////////////////////////////////////////////////////////////////////////// 6924 /// @brief Device PCI address 6925 /// 6926 /// @details 6927 /// - This structure may be passed to ::zeDevicePciGetPropertiesExt as an 6928 /// attribute of ::ze_pci_ext_properties_t. 6929 /// - A PCI BDF address is the bus:device:function address of the device and 6930 /// is useful for locating the device in the PCI switch fabric. 6931 typedef struct _ze_pci_address_ext_t 6932 { 6933 uint32_t domain; ///< [out] PCI domain number 6934 uint32_t bus; ///< [out] PCI BDF bus number 6935 uint32_t device; ///< [out] PCI BDF device number 6936 uint32_t function; ///< [out] PCI BDF function number 6937 6938 } ze_pci_address_ext_t; 6939 6940 /////////////////////////////////////////////////////////////////////////////// 6941 /// @brief Device PCI speed 6942 typedef struct _ze_pci_speed_ext_t 6943 { 6944 int32_t genVersion; ///< [out] The link generation. A value of -1 means that this property is 6945 ///< unknown. 6946 int32_t width; ///< [out] The number of lanes. A value of -1 means that this property is 6947 ///< unknown. 6948 int64_t maxBandwidth; ///< [out] The theoretical maximum bandwidth in bytes/sec (sum of all 6949 ///< lanes). A value of -1 means that this property is unknown. 6950 6951 } ze_pci_speed_ext_t; 6952 6953 /////////////////////////////////////////////////////////////////////////////// 6954 /// @brief Static PCI properties 6955 typedef struct _ze_pci_ext_properties_t 6956 { 6957 ze_structure_type_t stype; ///< [in] type of this structure 6958 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 6959 ///< structure (i.e. contains sType and pNext). 6960 ze_pci_address_ext_t address; ///< [out] The BDF address 6961 ze_pci_speed_ext_t maxSpeed; ///< [out] Fastest port configuration supported by the device (sum of all 6962 ///< lanes) 6963 6964 } ze_pci_ext_properties_t; 6965 6966 /////////////////////////////////////////////////////////////////////////////// 6967 /// @brief Get PCI properties - address, max speed 6968 /// 6969 /// @details 6970 /// - The application may call this function from simultaneous threads. 6971 /// - The implementation of this function should be lock-free. 6972 /// 6973 /// @remarks 6974 /// _Analogues_ 6975 /// - None 6976 /// 6977 /// @returns 6978 /// - ::ZE_RESULT_SUCCESS 6979 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 6980 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 6981 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 6982 /// + `nullptr == hDevice` 6983 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 6984 /// + `nullptr == pPciProperties` 6985 ZE_APIEXPORT ze_result_t ZE_APICALL 6986 zeDevicePciGetPropertiesExt( 6987 ze_device_handle_t hDevice, ///< [in] handle of the device object. 6988 ze_pci_ext_properties_t* pPciProperties ///< [in,out] returns the PCI properties of the device. 6989 ); 6990 6991 #if !defined(__GNUC__) 6992 #pragma endregion 6993 #endif 6994 // Intel 'oneAPI' Level-Zero Extension APIs for sRGB 6995 #if !defined(__GNUC__) 6996 #pragma region SRGB 6997 #endif 6998 /////////////////////////////////////////////////////////////////////////////// 6999 #ifndef ZE_SRGB_EXT_NAME 7000 /// @brief sRGB Extension Name 7001 #define ZE_SRGB_EXT_NAME "ZE_extension_srgb" 7002 #endif // ZE_SRGB_EXT_NAME 7003 7004 /////////////////////////////////////////////////////////////////////////////// 7005 /// @brief sRGB Extension Version(s) 7006 typedef enum _ze_srgb_ext_version_t 7007 { 7008 ZE_SRGB_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 7009 ZE_SRGB_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 7010 ZE_SRGB_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 7011 7012 } ze_srgb_ext_version_t; 7013 7014 /////////////////////////////////////////////////////////////////////////////// 7015 /// @brief sRGB image descriptor 7016 /// 7017 /// @details 7018 /// - This structure may be passed to ::zeImageCreate via the `pNext` member 7019 /// of ::ze_image_desc_t 7020 /// - Used for specifying that the image is in sRGB format. 7021 typedef struct _ze_srgb_ext_desc_t 7022 { 7023 ze_structure_type_t stype; ///< [in] type of this structure 7024 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 7025 ///< structure (i.e. contains sType and pNext). 7026 ze_bool_t sRGB; ///< [in] Is sRGB. 7027 7028 } ze_srgb_ext_desc_t; 7029 7030 #if !defined(__GNUC__) 7031 #pragma endregion 7032 #endif 7033 // Intel 'oneAPI' Level-Zero Extension APIs for Image Copy To/From Memory 7034 #if !defined(__GNUC__) 7035 #pragma region imageCopy 7036 #endif 7037 /////////////////////////////////////////////////////////////////////////////// 7038 #ifndef ZE_IMAGE_COPY_EXT_NAME 7039 /// @brief Image Copy Extension Name 7040 #define ZE_IMAGE_COPY_EXT_NAME "ZE_extension_image_copy" 7041 #endif // ZE_IMAGE_COPY_EXT_NAME 7042 7043 /////////////////////////////////////////////////////////////////////////////// 7044 /// @brief Image Copy Extension Version(s) 7045 typedef enum _ze_image_copy_ext_version_t 7046 { 7047 ZE_IMAGE_COPY_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 7048 ZE_IMAGE_COPY_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version 7049 ZE_IMAGE_COPY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 7050 7051 } ze_image_copy_ext_version_t; 7052 7053 /////////////////////////////////////////////////////////////////////////////// 7054 /// @brief Copies from an image to device or shared memory. 7055 /// 7056 /// @details 7057 /// - The application must ensure the memory pointed to by dstptr is 7058 /// accessible by the device on which the command list was created. 7059 /// - The implementation must not access the memory pointed to by dstptr as 7060 /// it is free to be modified by either the Host or device up until 7061 /// execution. 7062 /// - The application must ensure the image and events are accessible by the 7063 /// device on which the command list was created. 7064 /// - The application must ensure the image format descriptor for the source 7065 /// image is a single-planar format. 7066 /// - The application must ensure that the rowPitch is set to 0 if image is 7067 /// a 1D image. Otherwise the rowPitch must be greater than or equal to 7068 /// the element size in bytes × width. 7069 /// - If rowPitch is set to 0, the appropriate row pitch is calculated based 7070 /// on the size of each element in bytes multiplied by width 7071 /// - The application must ensure that the slicePitch is set to 0 if image 7072 /// is a 1D or 2D image. Otherwise this value must be greater than or 7073 /// equal to rowPitch × height. 7074 /// - If slicePitch is set to 0, the appropriate slice pitch is calculated 7075 /// based on the rowPitch × height. 7076 /// - The application must ensure the command list, image and events were 7077 /// created, and the memory was allocated, on the same context. 7078 /// - The application must **not** call this function from simultaneous 7079 /// threads with the same command list handle. 7080 /// - The implementation of this function should be lock-free. 7081 /// 7082 /// @remarks 7083 /// _Analogues_ 7084 /// - clEnqueueReadImage 7085 /// 7086 /// @returns 7087 /// - ::ZE_RESULT_SUCCESS 7088 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 7089 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 7090 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 7091 /// + `nullptr == hCommandList` 7092 /// + `nullptr == hSrcImage` 7093 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 7094 /// + `nullptr == dstptr` 7095 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 7096 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 7097 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 7098 ZE_APIEXPORT ze_result_t ZE_APICALL 7099 zeCommandListAppendImageCopyToMemoryExt( 7100 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 7101 void* dstptr, ///< [in] pointer to destination memory to copy to 7102 ze_image_handle_t hSrcImage, ///< [in] handle of source image to copy from 7103 const ze_image_region_t* pSrcRegion, ///< [in][optional] source region descriptor 7104 uint32_t destRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D 7105 ///< image or each image of a 1D or 2D image array being written 7106 uint32_t destSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or 7107 ///< each image of a 1D or 2D image array being written 7108 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 7109 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 7110 ///< if `nullptr == phWaitEvents` 7111 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 7112 ///< on before launching 7113 ); 7114 7115 /////////////////////////////////////////////////////////////////////////////// 7116 /// @brief Copies to an image from device or shared memory. 7117 /// 7118 /// @details 7119 /// - The application must ensure the memory pointed to by srcptr is 7120 /// accessible by the device on which the command list was created. 7121 /// - The implementation must not access the memory pointed to by srcptr as 7122 /// it is free to be modified by either the Host or device up until 7123 /// execution. 7124 /// - The application must ensure the image and events are accessible by the 7125 /// device on which the command list was created. 7126 /// - The application must ensure the image format descriptor for the 7127 /// destination image is a single-planar format. 7128 /// - The application must ensure that the rowPitch is set to 0 if image is 7129 /// a 1D image. Otherwise the rowPitch must be greater than or equal to 7130 /// the element size in bytes × width. 7131 /// - If rowPitch is set to 0, the appropriate row pitch is calculated based 7132 /// on the size of each element in bytes multiplied by width 7133 /// - The application must ensure that the slicePitch is set to 0 if image 7134 /// is a 1D or 2D image. Otherwise this value must be greater than or 7135 /// equal to rowPitch × height. 7136 /// - If slicePitch is set to 0, the appropriate slice pitch is calculated 7137 /// based on the rowPitch × height. 7138 /// - The application must ensure the command list, image and events were 7139 /// created, and the memory was allocated, on the same context. 7140 /// - The application must **not** call this function from simultaneous 7141 /// threads with the same command list handle. 7142 /// - The implementation of this function should be lock-free. 7143 /// 7144 /// @remarks 7145 /// _Analogues_ 7146 /// - clEnqueueWriteImage 7147 /// 7148 /// @returns 7149 /// - ::ZE_RESULT_SUCCESS 7150 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 7151 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 7152 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 7153 /// + `nullptr == hCommandList` 7154 /// + `nullptr == hDstImage` 7155 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 7156 /// + `nullptr == srcptr` 7157 /// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT 7158 /// - ::ZE_RESULT_ERROR_INVALID_SIZE 7159 /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` 7160 ZE_APIEXPORT ze_result_t ZE_APICALL 7161 zeCommandListAppendImageCopyFromMemoryExt( 7162 ze_command_list_handle_t hCommandList, ///< [in] handle of command list 7163 ze_image_handle_t hDstImage, ///< [in] handle of destination image to copy to 7164 const void* srcptr, ///< [in] pointer to source memory to copy from 7165 const ze_image_region_t* pDstRegion, ///< [in][optional] destination region descriptor 7166 uint32_t srcRowPitch, ///< [in] size in bytes of the 1D slice of the 2D region of a 2D or 3D 7167 ///< image or each image of a 1D or 2D image array being read 7168 uint32_t srcSlicePitch, ///< [in] size in bytes of the 2D slice of the 3D region of a 3D image or 7169 ///< each image of a 1D or 2D image array being read 7170 ze_event_handle_t hSignalEvent, ///< [in][optional] handle of the event to signal on completion 7171 uint32_t numWaitEvents, ///< [in][optional] number of events to wait on before launching; must be 0 7172 ///< if `nullptr == phWaitEvents` 7173 ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait 7174 ///< on before launching 7175 ); 7176 7177 #if !defined(__GNUC__) 7178 #pragma endregion 7179 #endif 7180 // Intel 'oneAPI' Level-Zero Extension for Querying Image Allocation Properties. 7181 #if !defined(__GNUC__) 7182 #pragma region imageQueryAllocProperties 7183 #endif 7184 /////////////////////////////////////////////////////////////////////////////// 7185 #ifndef ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME 7186 /// @brief Image Query Allocation Properties Extension Name 7187 #define ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME "ZE_extension_image_query_alloc_properties" 7188 #endif // ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME 7189 7190 /////////////////////////////////////////////////////////////////////////////// 7191 /// @brief Image Query Allocation Properties Extension Version(s) 7192 typedef enum _ze_image_query_alloc_properties_ext_version_t 7193 { 7194 ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 7195 ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 7196 ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 7197 7198 } ze_image_query_alloc_properties_ext_version_t; 7199 7200 /////////////////////////////////////////////////////////////////////////////// 7201 /// @brief Image allocation properties queried using 7202 /// ::zeImageGetAllocPropertiesExt 7203 typedef struct _ze_image_allocation_ext_properties_t 7204 { 7205 ze_structure_type_t stype; ///< [in] type of this structure 7206 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 7207 ///< structure (i.e. contains sType and pNext). 7208 uint64_t id; ///< [out] identifier for this allocation 7209 7210 } ze_image_allocation_ext_properties_t; 7211 7212 /////////////////////////////////////////////////////////////////////////////// 7213 /// @brief Retrieves attributes of an image allocation 7214 /// 7215 /// @details 7216 /// - The application may call this function from simultaneous threads. 7217 /// 7218 /// @returns 7219 /// - ::ZE_RESULT_SUCCESS 7220 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 7221 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 7222 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 7223 /// + `nullptr == hContext` 7224 /// + `nullptr == hImage` 7225 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 7226 /// + `nullptr == pImageAllocProperties` 7227 ZE_APIEXPORT ze_result_t ZE_APICALL 7228 zeImageGetAllocPropertiesExt( 7229 ze_context_handle_t hContext, ///< [in] handle of the context object 7230 ze_image_handle_t hImage, ///< [in] handle of image object to query 7231 ze_image_allocation_ext_properties_t* pImageAllocProperties ///< [in,out] query result for image allocation properties 7232 ); 7233 7234 #if !defined(__GNUC__) 7235 #pragma endregion 7236 #endif 7237 // Intel 'oneAPI' Level-Zero Extension APIs for Linkage Inspection 7238 #if !defined(__GNUC__) 7239 #pragma region linkageInspection 7240 #endif 7241 /////////////////////////////////////////////////////////////////////////////// 7242 #ifndef ZE_LINKAGE_INSPECTION_EXT_NAME 7243 /// @brief Linkage Inspection Extension Name 7244 #define ZE_LINKAGE_INSPECTION_EXT_NAME "ZE_extension_linkage_inspection" 7245 #endif // ZE_LINKAGE_INSPECTION_EXT_NAME 7246 7247 /////////////////////////////////////////////////////////////////////////////// 7248 /// @brief Linkage Inspection Extension Version(s) 7249 typedef enum _ze_linkage_inspection_ext_version_t 7250 { 7251 ZE_LINKAGE_INSPECTION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 7252 ZE_LINKAGE_INSPECTION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version 7253 ZE_LINKAGE_INSPECTION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 7254 7255 } ze_linkage_inspection_ext_version_t; 7256 7257 /////////////////////////////////////////////////////////////////////////////// 7258 /// @brief Supported module linkage inspection flags 7259 typedef uint32_t ze_linkage_inspection_ext_flags_t; 7260 typedef enum _ze_linkage_inspection_ext_flag_t 7261 { 7262 ZE_LINKAGE_INSPECTION_EXT_FLAG_IMPORTS = ZE_BIT(0), ///< List all imports of modules 7263 ZE_LINKAGE_INSPECTION_EXT_FLAG_UNRESOLVABLE_IMPORTS = ZE_BIT(1),///< List all imports of modules that do not have a corresponding export 7264 ZE_LINKAGE_INSPECTION_EXT_FLAG_EXPORTS = ZE_BIT(2), ///< List all exports of modules 7265 ZE_LINKAGE_INSPECTION_EXT_FLAG_FORCE_UINT32 = 0x7fffffff 7266 7267 } ze_linkage_inspection_ext_flag_t; 7268 7269 /////////////////////////////////////////////////////////////////////////////// 7270 /// @brief Module linkage inspection descriptor 7271 /// 7272 /// @details 7273 /// - This structure may be passed to ::zeModuleInspectLinkageExt. 7274 typedef struct _ze_linkage_inspection_ext_desc_t 7275 { 7276 ze_structure_type_t stype; ///< [in] type of this structure 7277 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 7278 ///< structure (i.e. contains sType and pNext). 7279 ze_linkage_inspection_ext_flags_t flags; ///< [in] flags specifying module linkage inspection. 7280 ///< must be 0 (default) or a valid combination of ::ze_linkage_inspection_ext_flag_t. 7281 7282 } ze_linkage_inspection_ext_desc_t; 7283 7284 /////////////////////////////////////////////////////////////////////////////// 7285 /// @brief List Imports & Exports 7286 /// 7287 /// @details 7288 /// - List all the import & unresolveable import dependencies & exports of a 7289 /// set of modules 7290 /// 7291 /// @remarks 7292 /// _Analogues_ 7293 /// - None 7294 /// 7295 /// @returns 7296 /// - ::ZE_RESULT_SUCCESS 7297 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 7298 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 7299 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 7300 /// + `nullptr == pInspectDesc` 7301 /// + `nullptr == phModules` 7302 /// + `nullptr == phLog` 7303 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 7304 /// + `0x7 < pInspectDesc->flags` 7305 ZE_APIEXPORT ze_result_t ZE_APICALL 7306 zeModuleInspectLinkageExt( 7307 ze_linkage_inspection_ext_desc_t* pInspectDesc, ///< [in] pointer to linkage inspection descriptor structure. 7308 uint32_t numModules, ///< [in] number of modules to be inspected pointed to by phModules. 7309 ze_module_handle_t* phModules, ///< [in][range(0, numModules)] pointer to an array of modules to be 7310 ///< inspected for import dependencies. 7311 ze_module_build_log_handle_t* phLog ///< [out] pointer to handle of linkage inspection log. Log object will 7312 ///< contain separate lists of imports, un-resolvable imports, and exports. 7313 ); 7314 7315 #if !defined(__GNUC__) 7316 #pragma endregion 7317 #endif 7318 // Intel 'oneAPI' Level-Zero Extension for supporting memory compression hints. 7319 #if !defined(__GNUC__) 7320 #pragma region memoryCompressionHints 7321 #endif 7322 /////////////////////////////////////////////////////////////////////////////// 7323 #ifndef ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME 7324 /// @brief Memory Compression Hints Extension Name 7325 #define ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME "ZE_extension_memory_compression_hints" 7326 #endif // ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME 7327 7328 /////////////////////////////////////////////////////////////////////////////// 7329 /// @brief Memory Compression Hints Extension Version(s) 7330 typedef enum _ze_memory_compression_hints_ext_version_t 7331 { 7332 ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 7333 ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 7334 ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 7335 7336 } ze_memory_compression_hints_ext_version_t; 7337 7338 /////////////////////////////////////////////////////////////////////////////// 7339 /// @brief Supported memory compression hints flags 7340 typedef uint32_t ze_memory_compression_hints_ext_flags_t; 7341 typedef enum _ze_memory_compression_hints_ext_flag_t 7342 { 7343 ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_COMPRESSED = ZE_BIT(0),///< Hint Driver implementation to make allocation compressible 7344 ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_UNCOMPRESSED = ZE_BIT(1), ///< Hint Driver implementation to make allocation not compressible 7345 ZE_MEMORY_COMPRESSION_HINTS_EXT_FLAG_FORCE_UINT32 = 0x7fffffff 7346 7347 } ze_memory_compression_hints_ext_flag_t; 7348 7349 /////////////////////////////////////////////////////////////////////////////// 7350 /// @brief Compression hints memory allocation descriptor 7351 /// 7352 /// @details 7353 /// - This structure may be passed to ::zeMemAllocShared or 7354 /// ::zeMemAllocDevice, via `pNext` member of 7355 /// ::ze_device_mem_alloc_desc_t. 7356 /// - This structure may be passed to ::zeMemAllocHost, via `pNext` member 7357 /// of ::ze_host_mem_alloc_desc_t. 7358 /// - This structure may be passed to ::zeImageCreate, via `pNext` member of 7359 /// ::ze_image_desc_t. 7360 typedef struct _ze_memory_compression_hints_ext_desc_t 7361 { 7362 ze_structure_type_t stype; ///< [in] type of this structure 7363 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 7364 ///< structure (i.e. contains sType and pNext). 7365 ze_memory_compression_hints_ext_flags_t flags; ///< [in] flags specifying if allocation should be compressible or not. 7366 ///< Must be set to one of the ::ze_memory_compression_hints_ext_flag_t; 7367 7368 } ze_memory_compression_hints_ext_desc_t; 7369 7370 #if !defined(__GNUC__) 7371 #pragma endregion 7372 #endif 7373 // Intel 'oneAPI' Level-Zero Extension APIs for Memory Free Policies 7374 #if !defined(__GNUC__) 7375 #pragma region memoryFreePolicies 7376 #endif 7377 /////////////////////////////////////////////////////////////////////////////// 7378 #ifndef ZE_MEMORY_FREE_POLICIES_EXT_NAME 7379 /// @brief Memory Free Policies Extension Name 7380 #define ZE_MEMORY_FREE_POLICIES_EXT_NAME "ZE_extension_memory_free_policies" 7381 #endif // ZE_MEMORY_FREE_POLICIES_EXT_NAME 7382 7383 /////////////////////////////////////////////////////////////////////////////// 7384 /// @brief Memory Free Policies Extension Version(s) 7385 typedef enum _ze_memory_free_policies_ext_version_t 7386 { 7387 ZE_MEMORY_FREE_POLICIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 7388 ZE_MEMORY_FREE_POLICIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version 7389 ZE_MEMORY_FREE_POLICIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff 7390 7391 } ze_memory_free_policies_ext_version_t; 7392 7393 /////////////////////////////////////////////////////////////////////////////// 7394 /// @brief Supported memory free policy capability flags 7395 typedef uint32_t ze_driver_memory_free_policy_ext_flags_t; 7396 typedef enum _ze_driver_memory_free_policy_ext_flag_t 7397 { 7398 ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_BLOCKING_FREE = ZE_BIT(0),///< blocks until all commands using the memory are complete before freeing 7399 ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_DEFER_FREE = ZE_BIT(1), ///< schedules the memory to be freed but does not free immediately 7400 ZE_DRIVER_MEMORY_FREE_POLICY_EXT_FLAG_FORCE_UINT32 = 0x7fffffff 7401 7402 } ze_driver_memory_free_policy_ext_flag_t; 7403 7404 /////////////////////////////////////////////////////////////////////////////// 7405 /// @brief Driver memory free properties queried using ::zeDriverGetProperties 7406 /// 7407 /// @details 7408 /// - All drivers must support an immediate free policy, which is the 7409 /// default free policy. 7410 /// - This structure may be returned from ::zeDriverGetProperties, via 7411 /// `pNext` member of ::ze_driver_properties_t. 7412 typedef struct _ze_driver_memory_free_ext_properties_t 7413 { 7414 ze_structure_type_t stype; ///< [in] type of this structure 7415 void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific 7416 ///< structure (i.e. contains sType and pNext). 7417 ze_driver_memory_free_policy_ext_flags_t freePolicies; ///< [out] Supported memory free policies. 7418 ///< must be 0 or a combination of ::ze_driver_memory_free_policy_ext_flag_t. 7419 7420 } ze_driver_memory_free_ext_properties_t; 7421 7422 /////////////////////////////////////////////////////////////////////////////// 7423 /// @brief Memory free descriptor with free policy 7424 typedef struct _ze_memory_free_ext_desc_t 7425 { 7426 ze_structure_type_t stype; ///< [in] type of this structure 7427 const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific 7428 ///< structure (i.e. contains sType and pNext). 7429 ze_driver_memory_free_policy_ext_flags_t freePolicy;///< [in] flags specifying the memory free policy. 7430 ///< must be 0 (default) or a supported ::ze_driver_memory_free_policy_ext_flag_t; 7431 ///< default behavior is to free immediately. 7432 7433 } ze_memory_free_ext_desc_t; 7434 7435 /////////////////////////////////////////////////////////////////////////////// 7436 /// @brief Frees allocated host memory, device memory, or shared memory using the 7437 /// specified free policy. 7438 /// 7439 /// @details 7440 /// - The memory free policy is specified by the memory free descriptor. 7441 /// - The application must **not** call this function from simultaneous 7442 /// threads with the same pointer. 7443 /// - The implementation of this function must be thread-safe. 7444 /// 7445 /// @returns 7446 /// - ::ZE_RESULT_SUCCESS 7447 /// - ::ZE_RESULT_ERROR_UNINITIALIZED 7448 /// - ::ZE_RESULT_ERROR_DEVICE_LOST 7449 /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE 7450 /// + `nullptr == hContext` 7451 /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER 7452 /// + `nullptr == pMemFreeDesc` 7453 /// + `nullptr == ptr` 7454 /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION 7455 /// + `0x3 < pMemFreeDesc->freePolicy` 7456 ZE_APIEXPORT ze_result_t ZE_APICALL 7457 zeMemFreeExt( 7458 ze_context_handle_t hContext, ///< [in] handle of the context object 7459 const ze_memory_free_ext_desc_t* pMemFreeDesc, ///< [in] pointer to memory free descriptor 7460 void* ptr ///< [in][release] pointer to memory to free 7461 ); 7462 7463 #if !defined(__GNUC__) 7464 #pragma endregion 7465 #endif 7466 // Intel 'oneAPI' Level-Zero API Callbacks 7467 #if !defined(__GNUC__) 7468 #pragma region callbacks 7469 #endif 7470 /////////////////////////////////////////////////////////////////////////////// 7471 /// @brief Callback function parameters for zeInit 7472 /// @details Each entry is a pointer to the parameter passed to the function; 7473 /// allowing the callback the ability to modify the parameter's value 7474 typedef struct _ze_init_params_t 7475 { 7476 ze_init_flags_t* pflags; 7477 } ze_init_params_t; 7478 7479 /////////////////////////////////////////////////////////////////////////////// 7480 /// @brief Callback function-pointer for zeInit 7481 /// @param[in] params Parameters passed to this instance 7482 /// @param[in] result Return value 7483 /// @param[in] pTracerUserData Per-Tracer user data 7484 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7485 typedef void (ZE_APICALL *ze_pfnInitCb_t)( 7486 ze_init_params_t* params, 7487 ze_result_t result, 7488 void* pTracerUserData, 7489 void** ppTracerInstanceUserData 7490 ); 7491 7492 /////////////////////////////////////////////////////////////////////////////// 7493 /// @brief Table of Global callback functions pointers 7494 typedef struct _ze_global_callbacks_t 7495 { 7496 ze_pfnInitCb_t pfnInitCb; 7497 } ze_global_callbacks_t; 7498 7499 /////////////////////////////////////////////////////////////////////////////// 7500 /// @brief Callback function parameters for zeDriverGet 7501 /// @details Each entry is a pointer to the parameter passed to the function; 7502 /// allowing the callback the ability to modify the parameter's value 7503 typedef struct _ze_driver_get_params_t 7504 { 7505 uint32_t** ppCount; 7506 ze_driver_handle_t** pphDrivers; 7507 } ze_driver_get_params_t; 7508 7509 /////////////////////////////////////////////////////////////////////////////// 7510 /// @brief Callback function-pointer for zeDriverGet 7511 /// @param[in] params Parameters passed to this instance 7512 /// @param[in] result Return value 7513 /// @param[in] pTracerUserData Per-Tracer user data 7514 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7515 typedef void (ZE_APICALL *ze_pfnDriverGetCb_t)( 7516 ze_driver_get_params_t* params, 7517 ze_result_t result, 7518 void* pTracerUserData, 7519 void** ppTracerInstanceUserData 7520 ); 7521 7522 /////////////////////////////////////////////////////////////////////////////// 7523 /// @brief Callback function parameters for zeDriverGetApiVersion 7524 /// @details Each entry is a pointer to the parameter passed to the function; 7525 /// allowing the callback the ability to modify the parameter's value 7526 typedef struct _ze_driver_get_api_version_params_t 7527 { 7528 ze_driver_handle_t* phDriver; 7529 ze_api_version_t** pversion; 7530 } ze_driver_get_api_version_params_t; 7531 7532 /////////////////////////////////////////////////////////////////////////////// 7533 /// @brief Callback function-pointer for zeDriverGetApiVersion 7534 /// @param[in] params Parameters passed to this instance 7535 /// @param[in] result Return value 7536 /// @param[in] pTracerUserData Per-Tracer user data 7537 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7538 typedef void (ZE_APICALL *ze_pfnDriverGetApiVersionCb_t)( 7539 ze_driver_get_api_version_params_t* params, 7540 ze_result_t result, 7541 void* pTracerUserData, 7542 void** ppTracerInstanceUserData 7543 ); 7544 7545 /////////////////////////////////////////////////////////////////////////////// 7546 /// @brief Callback function parameters for zeDriverGetProperties 7547 /// @details Each entry is a pointer to the parameter passed to the function; 7548 /// allowing the callback the ability to modify the parameter's value 7549 typedef struct _ze_driver_get_properties_params_t 7550 { 7551 ze_driver_handle_t* phDriver; 7552 ze_driver_properties_t** ppDriverProperties; 7553 } ze_driver_get_properties_params_t; 7554 7555 /////////////////////////////////////////////////////////////////////////////// 7556 /// @brief Callback function-pointer for zeDriverGetProperties 7557 /// @param[in] params Parameters passed to this instance 7558 /// @param[in] result Return value 7559 /// @param[in] pTracerUserData Per-Tracer user data 7560 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7561 typedef void (ZE_APICALL *ze_pfnDriverGetPropertiesCb_t)( 7562 ze_driver_get_properties_params_t* params, 7563 ze_result_t result, 7564 void* pTracerUserData, 7565 void** ppTracerInstanceUserData 7566 ); 7567 7568 /////////////////////////////////////////////////////////////////////////////// 7569 /// @brief Callback function parameters for zeDriverGetIpcProperties 7570 /// @details Each entry is a pointer to the parameter passed to the function; 7571 /// allowing the callback the ability to modify the parameter's value 7572 typedef struct _ze_driver_get_ipc_properties_params_t 7573 { 7574 ze_driver_handle_t* phDriver; 7575 ze_driver_ipc_properties_t** ppIpcProperties; 7576 } ze_driver_get_ipc_properties_params_t; 7577 7578 /////////////////////////////////////////////////////////////////////////////// 7579 /// @brief Callback function-pointer for zeDriverGetIpcProperties 7580 /// @param[in] params Parameters passed to this instance 7581 /// @param[in] result Return value 7582 /// @param[in] pTracerUserData Per-Tracer user data 7583 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7584 typedef void (ZE_APICALL *ze_pfnDriverGetIpcPropertiesCb_t)( 7585 ze_driver_get_ipc_properties_params_t* params, 7586 ze_result_t result, 7587 void* pTracerUserData, 7588 void** ppTracerInstanceUserData 7589 ); 7590 7591 /////////////////////////////////////////////////////////////////////////////// 7592 /// @brief Callback function parameters for zeDriverGetExtensionProperties 7593 /// @details Each entry is a pointer to the parameter passed to the function; 7594 /// allowing the callback the ability to modify the parameter's value 7595 typedef struct _ze_driver_get_extension_properties_params_t 7596 { 7597 ze_driver_handle_t* phDriver; 7598 uint32_t** ppCount; 7599 ze_driver_extension_properties_t** ppExtensionProperties; 7600 } ze_driver_get_extension_properties_params_t; 7601 7602 /////////////////////////////////////////////////////////////////////////////// 7603 /// @brief Callback function-pointer for zeDriverGetExtensionProperties 7604 /// @param[in] params Parameters passed to this instance 7605 /// @param[in] result Return value 7606 /// @param[in] pTracerUserData Per-Tracer user data 7607 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7608 typedef void (ZE_APICALL *ze_pfnDriverGetExtensionPropertiesCb_t)( 7609 ze_driver_get_extension_properties_params_t* params, 7610 ze_result_t result, 7611 void* pTracerUserData, 7612 void** ppTracerInstanceUserData 7613 ); 7614 7615 /////////////////////////////////////////////////////////////////////////////// 7616 /// @brief Table of Driver callback functions pointers 7617 typedef struct _ze_driver_callbacks_t 7618 { 7619 ze_pfnDriverGetCb_t pfnGetCb; 7620 ze_pfnDriverGetApiVersionCb_t pfnGetApiVersionCb; 7621 ze_pfnDriverGetPropertiesCb_t pfnGetPropertiesCb; 7622 ze_pfnDriverGetIpcPropertiesCb_t pfnGetIpcPropertiesCb; 7623 ze_pfnDriverGetExtensionPropertiesCb_t pfnGetExtensionPropertiesCb; 7624 } ze_driver_callbacks_t; 7625 7626 /////////////////////////////////////////////////////////////////////////////// 7627 /// @brief Callback function parameters for zeDeviceGet 7628 /// @details Each entry is a pointer to the parameter passed to the function; 7629 /// allowing the callback the ability to modify the parameter's value 7630 typedef struct _ze_device_get_params_t 7631 { 7632 ze_driver_handle_t* phDriver; 7633 uint32_t** ppCount; 7634 ze_device_handle_t** pphDevices; 7635 } ze_device_get_params_t; 7636 7637 /////////////////////////////////////////////////////////////////////////////// 7638 /// @brief Callback function-pointer for zeDeviceGet 7639 /// @param[in] params Parameters passed to this instance 7640 /// @param[in] result Return value 7641 /// @param[in] pTracerUserData Per-Tracer user data 7642 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7643 typedef void (ZE_APICALL *ze_pfnDeviceGetCb_t)( 7644 ze_device_get_params_t* params, 7645 ze_result_t result, 7646 void* pTracerUserData, 7647 void** ppTracerInstanceUserData 7648 ); 7649 7650 /////////////////////////////////////////////////////////////////////////////// 7651 /// @brief Callback function parameters for zeDeviceGetSubDevices 7652 /// @details Each entry is a pointer to the parameter passed to the function; 7653 /// allowing the callback the ability to modify the parameter's value 7654 typedef struct _ze_device_get_sub_devices_params_t 7655 { 7656 ze_device_handle_t* phDevice; 7657 uint32_t** ppCount; 7658 ze_device_handle_t** pphSubdevices; 7659 } ze_device_get_sub_devices_params_t; 7660 7661 /////////////////////////////////////////////////////////////////////////////// 7662 /// @brief Callback function-pointer for zeDeviceGetSubDevices 7663 /// @param[in] params Parameters passed to this instance 7664 /// @param[in] result Return value 7665 /// @param[in] pTracerUserData Per-Tracer user data 7666 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7667 typedef void (ZE_APICALL *ze_pfnDeviceGetSubDevicesCb_t)( 7668 ze_device_get_sub_devices_params_t* params, 7669 ze_result_t result, 7670 void* pTracerUserData, 7671 void** ppTracerInstanceUserData 7672 ); 7673 7674 /////////////////////////////////////////////////////////////////////////////// 7675 /// @brief Callback function parameters for zeDeviceGetProperties 7676 /// @details Each entry is a pointer to the parameter passed to the function; 7677 /// allowing the callback the ability to modify the parameter's value 7678 typedef struct _ze_device_get_properties_params_t 7679 { 7680 ze_device_handle_t* phDevice; 7681 ze_device_properties_t** ppDeviceProperties; 7682 } ze_device_get_properties_params_t; 7683 7684 /////////////////////////////////////////////////////////////////////////////// 7685 /// @brief Callback function-pointer for zeDeviceGetProperties 7686 /// @param[in] params Parameters passed to this instance 7687 /// @param[in] result Return value 7688 /// @param[in] pTracerUserData Per-Tracer user data 7689 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7690 typedef void (ZE_APICALL *ze_pfnDeviceGetPropertiesCb_t)( 7691 ze_device_get_properties_params_t* params, 7692 ze_result_t result, 7693 void* pTracerUserData, 7694 void** ppTracerInstanceUserData 7695 ); 7696 7697 /////////////////////////////////////////////////////////////////////////////// 7698 /// @brief Callback function parameters for zeDeviceGetComputeProperties 7699 /// @details Each entry is a pointer to the parameter passed to the function; 7700 /// allowing the callback the ability to modify the parameter's value 7701 typedef struct _ze_device_get_compute_properties_params_t 7702 { 7703 ze_device_handle_t* phDevice; 7704 ze_device_compute_properties_t** ppComputeProperties; 7705 } ze_device_get_compute_properties_params_t; 7706 7707 /////////////////////////////////////////////////////////////////////////////// 7708 /// @brief Callback function-pointer for zeDeviceGetComputeProperties 7709 /// @param[in] params Parameters passed to this instance 7710 /// @param[in] result Return value 7711 /// @param[in] pTracerUserData Per-Tracer user data 7712 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7713 typedef void (ZE_APICALL *ze_pfnDeviceGetComputePropertiesCb_t)( 7714 ze_device_get_compute_properties_params_t* params, 7715 ze_result_t result, 7716 void* pTracerUserData, 7717 void** ppTracerInstanceUserData 7718 ); 7719 7720 /////////////////////////////////////////////////////////////////////////////// 7721 /// @brief Callback function parameters for zeDeviceGetModuleProperties 7722 /// @details Each entry is a pointer to the parameter passed to the function; 7723 /// allowing the callback the ability to modify the parameter's value 7724 typedef struct _ze_device_get_module_properties_params_t 7725 { 7726 ze_device_handle_t* phDevice; 7727 ze_device_module_properties_t** ppModuleProperties; 7728 } ze_device_get_module_properties_params_t; 7729 7730 /////////////////////////////////////////////////////////////////////////////// 7731 /// @brief Callback function-pointer for zeDeviceGetModuleProperties 7732 /// @param[in] params Parameters passed to this instance 7733 /// @param[in] result Return value 7734 /// @param[in] pTracerUserData Per-Tracer user data 7735 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7736 typedef void (ZE_APICALL *ze_pfnDeviceGetModulePropertiesCb_t)( 7737 ze_device_get_module_properties_params_t* params, 7738 ze_result_t result, 7739 void* pTracerUserData, 7740 void** ppTracerInstanceUserData 7741 ); 7742 7743 /////////////////////////////////////////////////////////////////////////////// 7744 /// @brief Callback function parameters for zeDeviceGetCommandQueueGroupProperties 7745 /// @details Each entry is a pointer to the parameter passed to the function; 7746 /// allowing the callback the ability to modify the parameter's value 7747 typedef struct _ze_device_get_command_queue_group_properties_params_t 7748 { 7749 ze_device_handle_t* phDevice; 7750 uint32_t** ppCount; 7751 ze_command_queue_group_properties_t** ppCommandQueueGroupProperties; 7752 } ze_device_get_command_queue_group_properties_params_t; 7753 7754 /////////////////////////////////////////////////////////////////////////////// 7755 /// @brief Callback function-pointer for zeDeviceGetCommandQueueGroupProperties 7756 /// @param[in] params Parameters passed to this instance 7757 /// @param[in] result Return value 7758 /// @param[in] pTracerUserData Per-Tracer user data 7759 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7760 typedef void (ZE_APICALL *ze_pfnDeviceGetCommandQueueGroupPropertiesCb_t)( 7761 ze_device_get_command_queue_group_properties_params_t* params, 7762 ze_result_t result, 7763 void* pTracerUserData, 7764 void** ppTracerInstanceUserData 7765 ); 7766 7767 /////////////////////////////////////////////////////////////////////////////// 7768 /// @brief Callback function parameters for zeDeviceGetMemoryProperties 7769 /// @details Each entry is a pointer to the parameter passed to the function; 7770 /// allowing the callback the ability to modify the parameter's value 7771 typedef struct _ze_device_get_memory_properties_params_t 7772 { 7773 ze_device_handle_t* phDevice; 7774 uint32_t** ppCount; 7775 ze_device_memory_properties_t** ppMemProperties; 7776 } ze_device_get_memory_properties_params_t; 7777 7778 /////////////////////////////////////////////////////////////////////////////// 7779 /// @brief Callback function-pointer for zeDeviceGetMemoryProperties 7780 /// @param[in] params Parameters passed to this instance 7781 /// @param[in] result Return value 7782 /// @param[in] pTracerUserData Per-Tracer user data 7783 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7784 typedef void (ZE_APICALL *ze_pfnDeviceGetMemoryPropertiesCb_t)( 7785 ze_device_get_memory_properties_params_t* params, 7786 ze_result_t result, 7787 void* pTracerUserData, 7788 void** ppTracerInstanceUserData 7789 ); 7790 7791 /////////////////////////////////////////////////////////////////////////////// 7792 /// @brief Callback function parameters for zeDeviceGetMemoryAccessProperties 7793 /// @details Each entry is a pointer to the parameter passed to the function; 7794 /// allowing the callback the ability to modify the parameter's value 7795 typedef struct _ze_device_get_memory_access_properties_params_t 7796 { 7797 ze_device_handle_t* phDevice; 7798 ze_device_memory_access_properties_t** ppMemAccessProperties; 7799 } ze_device_get_memory_access_properties_params_t; 7800 7801 /////////////////////////////////////////////////////////////////////////////// 7802 /// @brief Callback function-pointer for zeDeviceGetMemoryAccessProperties 7803 /// @param[in] params Parameters passed to this instance 7804 /// @param[in] result Return value 7805 /// @param[in] pTracerUserData Per-Tracer user data 7806 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7807 typedef void (ZE_APICALL *ze_pfnDeviceGetMemoryAccessPropertiesCb_t)( 7808 ze_device_get_memory_access_properties_params_t* params, 7809 ze_result_t result, 7810 void* pTracerUserData, 7811 void** ppTracerInstanceUserData 7812 ); 7813 7814 /////////////////////////////////////////////////////////////////////////////// 7815 /// @brief Callback function parameters for zeDeviceGetCacheProperties 7816 /// @details Each entry is a pointer to the parameter passed to the function; 7817 /// allowing the callback the ability to modify the parameter's value 7818 typedef struct _ze_device_get_cache_properties_params_t 7819 { 7820 ze_device_handle_t* phDevice; 7821 uint32_t** ppCount; 7822 ze_device_cache_properties_t** ppCacheProperties; 7823 } ze_device_get_cache_properties_params_t; 7824 7825 /////////////////////////////////////////////////////////////////////////////// 7826 /// @brief Callback function-pointer for zeDeviceGetCacheProperties 7827 /// @param[in] params Parameters passed to this instance 7828 /// @param[in] result Return value 7829 /// @param[in] pTracerUserData Per-Tracer user data 7830 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7831 typedef void (ZE_APICALL *ze_pfnDeviceGetCachePropertiesCb_t)( 7832 ze_device_get_cache_properties_params_t* params, 7833 ze_result_t result, 7834 void* pTracerUserData, 7835 void** ppTracerInstanceUserData 7836 ); 7837 7838 /////////////////////////////////////////////////////////////////////////////// 7839 /// @brief Callback function parameters for zeDeviceGetImageProperties 7840 /// @details Each entry is a pointer to the parameter passed to the function; 7841 /// allowing the callback the ability to modify the parameter's value 7842 typedef struct _ze_device_get_image_properties_params_t 7843 { 7844 ze_device_handle_t* phDevice; 7845 ze_device_image_properties_t** ppImageProperties; 7846 } ze_device_get_image_properties_params_t; 7847 7848 /////////////////////////////////////////////////////////////////////////////// 7849 /// @brief Callback function-pointer for zeDeviceGetImageProperties 7850 /// @param[in] params Parameters passed to this instance 7851 /// @param[in] result Return value 7852 /// @param[in] pTracerUserData Per-Tracer user data 7853 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7854 typedef void (ZE_APICALL *ze_pfnDeviceGetImagePropertiesCb_t)( 7855 ze_device_get_image_properties_params_t* params, 7856 ze_result_t result, 7857 void* pTracerUserData, 7858 void** ppTracerInstanceUserData 7859 ); 7860 7861 /////////////////////////////////////////////////////////////////////////////// 7862 /// @brief Callback function parameters for zeDeviceGetExternalMemoryProperties 7863 /// @details Each entry is a pointer to the parameter passed to the function; 7864 /// allowing the callback the ability to modify the parameter's value 7865 typedef struct _ze_device_get_external_memory_properties_params_t 7866 { 7867 ze_device_handle_t* phDevice; 7868 ze_device_external_memory_properties_t** ppExternalMemoryProperties; 7869 } ze_device_get_external_memory_properties_params_t; 7870 7871 /////////////////////////////////////////////////////////////////////////////// 7872 /// @brief Callback function-pointer for zeDeviceGetExternalMemoryProperties 7873 /// @param[in] params Parameters passed to this instance 7874 /// @param[in] result Return value 7875 /// @param[in] pTracerUserData Per-Tracer user data 7876 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7877 typedef void (ZE_APICALL *ze_pfnDeviceGetExternalMemoryPropertiesCb_t)( 7878 ze_device_get_external_memory_properties_params_t* params, 7879 ze_result_t result, 7880 void* pTracerUserData, 7881 void** ppTracerInstanceUserData 7882 ); 7883 7884 /////////////////////////////////////////////////////////////////////////////// 7885 /// @brief Callback function parameters for zeDeviceGetP2PProperties 7886 /// @details Each entry is a pointer to the parameter passed to the function; 7887 /// allowing the callback the ability to modify the parameter's value 7888 typedef struct _ze_device_get_p2_p_properties_params_t 7889 { 7890 ze_device_handle_t* phDevice; 7891 ze_device_handle_t* phPeerDevice; 7892 ze_device_p2p_properties_t** ppP2PProperties; 7893 } ze_device_get_p2_p_properties_params_t; 7894 7895 /////////////////////////////////////////////////////////////////////////////// 7896 /// @brief Callback function-pointer for zeDeviceGetP2PProperties 7897 /// @param[in] params Parameters passed to this instance 7898 /// @param[in] result Return value 7899 /// @param[in] pTracerUserData Per-Tracer user data 7900 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7901 typedef void (ZE_APICALL *ze_pfnDeviceGetP2PPropertiesCb_t)( 7902 ze_device_get_p2_p_properties_params_t* params, 7903 ze_result_t result, 7904 void* pTracerUserData, 7905 void** ppTracerInstanceUserData 7906 ); 7907 7908 /////////////////////////////////////////////////////////////////////////////// 7909 /// @brief Callback function parameters for zeDeviceCanAccessPeer 7910 /// @details Each entry is a pointer to the parameter passed to the function; 7911 /// allowing the callback the ability to modify the parameter's value 7912 typedef struct _ze_device_can_access_peer_params_t 7913 { 7914 ze_device_handle_t* phDevice; 7915 ze_device_handle_t* phPeerDevice; 7916 ze_bool_t** pvalue; 7917 } ze_device_can_access_peer_params_t; 7918 7919 /////////////////////////////////////////////////////////////////////////////// 7920 /// @brief Callback function-pointer for zeDeviceCanAccessPeer 7921 /// @param[in] params Parameters passed to this instance 7922 /// @param[in] result Return value 7923 /// @param[in] pTracerUserData Per-Tracer user data 7924 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7925 typedef void (ZE_APICALL *ze_pfnDeviceCanAccessPeerCb_t)( 7926 ze_device_can_access_peer_params_t* params, 7927 ze_result_t result, 7928 void* pTracerUserData, 7929 void** ppTracerInstanceUserData 7930 ); 7931 7932 /////////////////////////////////////////////////////////////////////////////// 7933 /// @brief Callback function parameters for zeDeviceGetStatus 7934 /// @details Each entry is a pointer to the parameter passed to the function; 7935 /// allowing the callback the ability to modify the parameter's value 7936 typedef struct _ze_device_get_status_params_t 7937 { 7938 ze_device_handle_t* phDevice; 7939 } ze_device_get_status_params_t; 7940 7941 /////////////////////////////////////////////////////////////////////////////// 7942 /// @brief Callback function-pointer for zeDeviceGetStatus 7943 /// @param[in] params Parameters passed to this instance 7944 /// @param[in] result Return value 7945 /// @param[in] pTracerUserData Per-Tracer user data 7946 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7947 typedef void (ZE_APICALL *ze_pfnDeviceGetStatusCb_t)( 7948 ze_device_get_status_params_t* params, 7949 ze_result_t result, 7950 void* pTracerUserData, 7951 void** ppTracerInstanceUserData 7952 ); 7953 7954 /////////////////////////////////////////////////////////////////////////////// 7955 /// @brief Table of Device callback functions pointers 7956 typedef struct _ze_device_callbacks_t 7957 { 7958 ze_pfnDeviceGetCb_t pfnGetCb; 7959 ze_pfnDeviceGetSubDevicesCb_t pfnGetSubDevicesCb; 7960 ze_pfnDeviceGetPropertiesCb_t pfnGetPropertiesCb; 7961 ze_pfnDeviceGetComputePropertiesCb_t pfnGetComputePropertiesCb; 7962 ze_pfnDeviceGetModulePropertiesCb_t pfnGetModulePropertiesCb; 7963 ze_pfnDeviceGetCommandQueueGroupPropertiesCb_t pfnGetCommandQueueGroupPropertiesCb; 7964 ze_pfnDeviceGetMemoryPropertiesCb_t pfnGetMemoryPropertiesCb; 7965 ze_pfnDeviceGetMemoryAccessPropertiesCb_t pfnGetMemoryAccessPropertiesCb; 7966 ze_pfnDeviceGetCachePropertiesCb_t pfnGetCachePropertiesCb; 7967 ze_pfnDeviceGetImagePropertiesCb_t pfnGetImagePropertiesCb; 7968 ze_pfnDeviceGetExternalMemoryPropertiesCb_t pfnGetExternalMemoryPropertiesCb; 7969 ze_pfnDeviceGetP2PPropertiesCb_t pfnGetP2PPropertiesCb; 7970 ze_pfnDeviceCanAccessPeerCb_t pfnCanAccessPeerCb; 7971 ze_pfnDeviceGetStatusCb_t pfnGetStatusCb; 7972 } ze_device_callbacks_t; 7973 7974 /////////////////////////////////////////////////////////////////////////////// 7975 /// @brief Callback function parameters for zeContextCreate 7976 /// @details Each entry is a pointer to the parameter passed to the function; 7977 /// allowing the callback the ability to modify the parameter's value 7978 typedef struct _ze_context_create_params_t 7979 { 7980 ze_driver_handle_t* phDriver; 7981 const ze_context_desc_t** pdesc; 7982 ze_context_handle_t** pphContext; 7983 } ze_context_create_params_t; 7984 7985 /////////////////////////////////////////////////////////////////////////////// 7986 /// @brief Callback function-pointer for zeContextCreate 7987 /// @param[in] params Parameters passed to this instance 7988 /// @param[in] result Return value 7989 /// @param[in] pTracerUserData Per-Tracer user data 7990 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 7991 typedef void (ZE_APICALL *ze_pfnContextCreateCb_t)( 7992 ze_context_create_params_t* params, 7993 ze_result_t result, 7994 void* pTracerUserData, 7995 void** ppTracerInstanceUserData 7996 ); 7997 7998 /////////////////////////////////////////////////////////////////////////////// 7999 /// @brief Callback function parameters for zeContextDestroy 8000 /// @details Each entry is a pointer to the parameter passed to the function; 8001 /// allowing the callback the ability to modify the parameter's value 8002 typedef struct _ze_context_destroy_params_t 8003 { 8004 ze_context_handle_t* phContext; 8005 } ze_context_destroy_params_t; 8006 8007 /////////////////////////////////////////////////////////////////////////////// 8008 /// @brief Callback function-pointer for zeContextDestroy 8009 /// @param[in] params Parameters passed to this instance 8010 /// @param[in] result Return value 8011 /// @param[in] pTracerUserData Per-Tracer user data 8012 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8013 typedef void (ZE_APICALL *ze_pfnContextDestroyCb_t)( 8014 ze_context_destroy_params_t* params, 8015 ze_result_t result, 8016 void* pTracerUserData, 8017 void** ppTracerInstanceUserData 8018 ); 8019 8020 /////////////////////////////////////////////////////////////////////////////// 8021 /// @brief Callback function parameters for zeContextGetStatus 8022 /// @details Each entry is a pointer to the parameter passed to the function; 8023 /// allowing the callback the ability to modify the parameter's value 8024 typedef struct _ze_context_get_status_params_t 8025 { 8026 ze_context_handle_t* phContext; 8027 } ze_context_get_status_params_t; 8028 8029 /////////////////////////////////////////////////////////////////////////////// 8030 /// @brief Callback function-pointer for zeContextGetStatus 8031 /// @param[in] params Parameters passed to this instance 8032 /// @param[in] result Return value 8033 /// @param[in] pTracerUserData Per-Tracer user data 8034 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8035 typedef void (ZE_APICALL *ze_pfnContextGetStatusCb_t)( 8036 ze_context_get_status_params_t* params, 8037 ze_result_t result, 8038 void* pTracerUserData, 8039 void** ppTracerInstanceUserData 8040 ); 8041 8042 /////////////////////////////////////////////////////////////////////////////// 8043 /// @brief Callback function parameters for zeContextSystemBarrier 8044 /// @details Each entry is a pointer to the parameter passed to the function; 8045 /// allowing the callback the ability to modify the parameter's value 8046 typedef struct _ze_context_system_barrier_params_t 8047 { 8048 ze_context_handle_t* phContext; 8049 ze_device_handle_t* phDevice; 8050 } ze_context_system_barrier_params_t; 8051 8052 /////////////////////////////////////////////////////////////////////////////// 8053 /// @brief Callback function-pointer for zeContextSystemBarrier 8054 /// @param[in] params Parameters passed to this instance 8055 /// @param[in] result Return value 8056 /// @param[in] pTracerUserData Per-Tracer user data 8057 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8058 typedef void (ZE_APICALL *ze_pfnContextSystemBarrierCb_t)( 8059 ze_context_system_barrier_params_t* params, 8060 ze_result_t result, 8061 void* pTracerUserData, 8062 void** ppTracerInstanceUserData 8063 ); 8064 8065 /////////////////////////////////////////////////////////////////////////////// 8066 /// @brief Callback function parameters for zeContextMakeMemoryResident 8067 /// @details Each entry is a pointer to the parameter passed to the function; 8068 /// allowing the callback the ability to modify the parameter's value 8069 typedef struct _ze_context_make_memory_resident_params_t 8070 { 8071 ze_context_handle_t* phContext; 8072 ze_device_handle_t* phDevice; 8073 void** pptr; 8074 size_t* psize; 8075 } ze_context_make_memory_resident_params_t; 8076 8077 /////////////////////////////////////////////////////////////////////////////// 8078 /// @brief Callback function-pointer for zeContextMakeMemoryResident 8079 /// @param[in] params Parameters passed to this instance 8080 /// @param[in] result Return value 8081 /// @param[in] pTracerUserData Per-Tracer user data 8082 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8083 typedef void (ZE_APICALL *ze_pfnContextMakeMemoryResidentCb_t)( 8084 ze_context_make_memory_resident_params_t* params, 8085 ze_result_t result, 8086 void* pTracerUserData, 8087 void** ppTracerInstanceUserData 8088 ); 8089 8090 /////////////////////////////////////////////////////////////////////////////// 8091 /// @brief Callback function parameters for zeContextEvictMemory 8092 /// @details Each entry is a pointer to the parameter passed to the function; 8093 /// allowing the callback the ability to modify the parameter's value 8094 typedef struct _ze_context_evict_memory_params_t 8095 { 8096 ze_context_handle_t* phContext; 8097 ze_device_handle_t* phDevice; 8098 void** pptr; 8099 size_t* psize; 8100 } ze_context_evict_memory_params_t; 8101 8102 /////////////////////////////////////////////////////////////////////////////// 8103 /// @brief Callback function-pointer for zeContextEvictMemory 8104 /// @param[in] params Parameters passed to this instance 8105 /// @param[in] result Return value 8106 /// @param[in] pTracerUserData Per-Tracer user data 8107 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8108 typedef void (ZE_APICALL *ze_pfnContextEvictMemoryCb_t)( 8109 ze_context_evict_memory_params_t* params, 8110 ze_result_t result, 8111 void* pTracerUserData, 8112 void** ppTracerInstanceUserData 8113 ); 8114 8115 /////////////////////////////////////////////////////////////////////////////// 8116 /// @brief Callback function parameters for zeContextMakeImageResident 8117 /// @details Each entry is a pointer to the parameter passed to the function; 8118 /// allowing the callback the ability to modify the parameter's value 8119 typedef struct _ze_context_make_image_resident_params_t 8120 { 8121 ze_context_handle_t* phContext; 8122 ze_device_handle_t* phDevice; 8123 ze_image_handle_t* phImage; 8124 } ze_context_make_image_resident_params_t; 8125 8126 /////////////////////////////////////////////////////////////////////////////// 8127 /// @brief Callback function-pointer for zeContextMakeImageResident 8128 /// @param[in] params Parameters passed to this instance 8129 /// @param[in] result Return value 8130 /// @param[in] pTracerUserData Per-Tracer user data 8131 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8132 typedef void (ZE_APICALL *ze_pfnContextMakeImageResidentCb_t)( 8133 ze_context_make_image_resident_params_t* params, 8134 ze_result_t result, 8135 void* pTracerUserData, 8136 void** ppTracerInstanceUserData 8137 ); 8138 8139 /////////////////////////////////////////////////////////////////////////////// 8140 /// @brief Callback function parameters for zeContextEvictImage 8141 /// @details Each entry is a pointer to the parameter passed to the function; 8142 /// allowing the callback the ability to modify the parameter's value 8143 typedef struct _ze_context_evict_image_params_t 8144 { 8145 ze_context_handle_t* phContext; 8146 ze_device_handle_t* phDevice; 8147 ze_image_handle_t* phImage; 8148 } ze_context_evict_image_params_t; 8149 8150 /////////////////////////////////////////////////////////////////////////////// 8151 /// @brief Callback function-pointer for zeContextEvictImage 8152 /// @param[in] params Parameters passed to this instance 8153 /// @param[in] result Return value 8154 /// @param[in] pTracerUserData Per-Tracer user data 8155 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8156 typedef void (ZE_APICALL *ze_pfnContextEvictImageCb_t)( 8157 ze_context_evict_image_params_t* params, 8158 ze_result_t result, 8159 void* pTracerUserData, 8160 void** ppTracerInstanceUserData 8161 ); 8162 8163 /////////////////////////////////////////////////////////////////////////////// 8164 /// @brief Table of Context callback functions pointers 8165 typedef struct _ze_context_callbacks_t 8166 { 8167 ze_pfnContextCreateCb_t pfnCreateCb; 8168 ze_pfnContextDestroyCb_t pfnDestroyCb; 8169 ze_pfnContextGetStatusCb_t pfnGetStatusCb; 8170 ze_pfnContextSystemBarrierCb_t pfnSystemBarrierCb; 8171 ze_pfnContextMakeMemoryResidentCb_t pfnMakeMemoryResidentCb; 8172 ze_pfnContextEvictMemoryCb_t pfnEvictMemoryCb; 8173 ze_pfnContextMakeImageResidentCb_t pfnMakeImageResidentCb; 8174 ze_pfnContextEvictImageCb_t pfnEvictImageCb; 8175 } ze_context_callbacks_t; 8176 8177 /////////////////////////////////////////////////////////////////////////////// 8178 /// @brief Callback function parameters for zeCommandQueueCreate 8179 /// @details Each entry is a pointer to the parameter passed to the function; 8180 /// allowing the callback the ability to modify the parameter's value 8181 typedef struct _ze_command_queue_create_params_t 8182 { 8183 ze_context_handle_t* phContext; 8184 ze_device_handle_t* phDevice; 8185 const ze_command_queue_desc_t** pdesc; 8186 ze_command_queue_handle_t** pphCommandQueue; 8187 } ze_command_queue_create_params_t; 8188 8189 /////////////////////////////////////////////////////////////////////////////// 8190 /// @brief Callback function-pointer for zeCommandQueueCreate 8191 /// @param[in] params Parameters passed to this instance 8192 /// @param[in] result Return value 8193 /// @param[in] pTracerUserData Per-Tracer user data 8194 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8195 typedef void (ZE_APICALL *ze_pfnCommandQueueCreateCb_t)( 8196 ze_command_queue_create_params_t* params, 8197 ze_result_t result, 8198 void* pTracerUserData, 8199 void** ppTracerInstanceUserData 8200 ); 8201 8202 /////////////////////////////////////////////////////////////////////////////// 8203 /// @brief Callback function parameters for zeCommandQueueDestroy 8204 /// @details Each entry is a pointer to the parameter passed to the function; 8205 /// allowing the callback the ability to modify the parameter's value 8206 typedef struct _ze_command_queue_destroy_params_t 8207 { 8208 ze_command_queue_handle_t* phCommandQueue; 8209 } ze_command_queue_destroy_params_t; 8210 8211 /////////////////////////////////////////////////////////////////////////////// 8212 /// @brief Callback function-pointer for zeCommandQueueDestroy 8213 /// @param[in] params Parameters passed to this instance 8214 /// @param[in] result Return value 8215 /// @param[in] pTracerUserData Per-Tracer user data 8216 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8217 typedef void (ZE_APICALL *ze_pfnCommandQueueDestroyCb_t)( 8218 ze_command_queue_destroy_params_t* params, 8219 ze_result_t result, 8220 void* pTracerUserData, 8221 void** ppTracerInstanceUserData 8222 ); 8223 8224 /////////////////////////////////////////////////////////////////////////////// 8225 /// @brief Callback function parameters for zeCommandQueueExecuteCommandLists 8226 /// @details Each entry is a pointer to the parameter passed to the function; 8227 /// allowing the callback the ability to modify the parameter's value 8228 typedef struct _ze_command_queue_execute_command_lists_params_t 8229 { 8230 ze_command_queue_handle_t* phCommandQueue; 8231 uint32_t* pnumCommandLists; 8232 ze_command_list_handle_t** pphCommandLists; 8233 ze_fence_handle_t* phFence; 8234 } ze_command_queue_execute_command_lists_params_t; 8235 8236 /////////////////////////////////////////////////////////////////////////////// 8237 /// @brief Callback function-pointer for zeCommandQueueExecuteCommandLists 8238 /// @param[in] params Parameters passed to this instance 8239 /// @param[in] result Return value 8240 /// @param[in] pTracerUserData Per-Tracer user data 8241 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8242 typedef void (ZE_APICALL *ze_pfnCommandQueueExecuteCommandListsCb_t)( 8243 ze_command_queue_execute_command_lists_params_t* params, 8244 ze_result_t result, 8245 void* pTracerUserData, 8246 void** ppTracerInstanceUserData 8247 ); 8248 8249 /////////////////////////////////////////////////////////////////////////////// 8250 /// @brief Callback function parameters for zeCommandQueueSynchronize 8251 /// @details Each entry is a pointer to the parameter passed to the function; 8252 /// allowing the callback the ability to modify the parameter's value 8253 typedef struct _ze_command_queue_synchronize_params_t 8254 { 8255 ze_command_queue_handle_t* phCommandQueue; 8256 uint64_t* ptimeout; 8257 } ze_command_queue_synchronize_params_t; 8258 8259 /////////////////////////////////////////////////////////////////////////////// 8260 /// @brief Callback function-pointer for zeCommandQueueSynchronize 8261 /// @param[in] params Parameters passed to this instance 8262 /// @param[in] result Return value 8263 /// @param[in] pTracerUserData Per-Tracer user data 8264 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8265 typedef void (ZE_APICALL *ze_pfnCommandQueueSynchronizeCb_t)( 8266 ze_command_queue_synchronize_params_t* params, 8267 ze_result_t result, 8268 void* pTracerUserData, 8269 void** ppTracerInstanceUserData 8270 ); 8271 8272 /////////////////////////////////////////////////////////////////////////////// 8273 /// @brief Table of CommandQueue callback functions pointers 8274 typedef struct _ze_command_queue_callbacks_t 8275 { 8276 ze_pfnCommandQueueCreateCb_t pfnCreateCb; 8277 ze_pfnCommandQueueDestroyCb_t pfnDestroyCb; 8278 ze_pfnCommandQueueExecuteCommandListsCb_t pfnExecuteCommandListsCb; 8279 ze_pfnCommandQueueSynchronizeCb_t pfnSynchronizeCb; 8280 } ze_command_queue_callbacks_t; 8281 8282 /////////////////////////////////////////////////////////////////////////////// 8283 /// @brief Callback function parameters for zeCommandListCreate 8284 /// @details Each entry is a pointer to the parameter passed to the function; 8285 /// allowing the callback the ability to modify the parameter's value 8286 typedef struct _ze_command_list_create_params_t 8287 { 8288 ze_context_handle_t* phContext; 8289 ze_device_handle_t* phDevice; 8290 const ze_command_list_desc_t** pdesc; 8291 ze_command_list_handle_t** pphCommandList; 8292 } ze_command_list_create_params_t; 8293 8294 /////////////////////////////////////////////////////////////////////////////// 8295 /// @brief Callback function-pointer for zeCommandListCreate 8296 /// @param[in] params Parameters passed to this instance 8297 /// @param[in] result Return value 8298 /// @param[in] pTracerUserData Per-Tracer user data 8299 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8300 typedef void (ZE_APICALL *ze_pfnCommandListCreateCb_t)( 8301 ze_command_list_create_params_t* params, 8302 ze_result_t result, 8303 void* pTracerUserData, 8304 void** ppTracerInstanceUserData 8305 ); 8306 8307 /////////////////////////////////////////////////////////////////////////////// 8308 /// @brief Callback function parameters for zeCommandListCreateImmediate 8309 /// @details Each entry is a pointer to the parameter passed to the function; 8310 /// allowing the callback the ability to modify the parameter's value 8311 typedef struct _ze_command_list_create_immediate_params_t 8312 { 8313 ze_context_handle_t* phContext; 8314 ze_device_handle_t* phDevice; 8315 const ze_command_queue_desc_t** paltdesc; 8316 ze_command_list_handle_t** pphCommandList; 8317 } ze_command_list_create_immediate_params_t; 8318 8319 /////////////////////////////////////////////////////////////////////////////// 8320 /// @brief Callback function-pointer for zeCommandListCreateImmediate 8321 /// @param[in] params Parameters passed to this instance 8322 /// @param[in] result Return value 8323 /// @param[in] pTracerUserData Per-Tracer user data 8324 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8325 typedef void (ZE_APICALL *ze_pfnCommandListCreateImmediateCb_t)( 8326 ze_command_list_create_immediate_params_t* params, 8327 ze_result_t result, 8328 void* pTracerUserData, 8329 void** ppTracerInstanceUserData 8330 ); 8331 8332 /////////////////////////////////////////////////////////////////////////////// 8333 /// @brief Callback function parameters for zeCommandListDestroy 8334 /// @details Each entry is a pointer to the parameter passed to the function; 8335 /// allowing the callback the ability to modify the parameter's value 8336 typedef struct _ze_command_list_destroy_params_t 8337 { 8338 ze_command_list_handle_t* phCommandList; 8339 } ze_command_list_destroy_params_t; 8340 8341 /////////////////////////////////////////////////////////////////////////////// 8342 /// @brief Callback function-pointer for zeCommandListDestroy 8343 /// @param[in] params Parameters passed to this instance 8344 /// @param[in] result Return value 8345 /// @param[in] pTracerUserData Per-Tracer user data 8346 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8347 typedef void (ZE_APICALL *ze_pfnCommandListDestroyCb_t)( 8348 ze_command_list_destroy_params_t* params, 8349 ze_result_t result, 8350 void* pTracerUserData, 8351 void** ppTracerInstanceUserData 8352 ); 8353 8354 /////////////////////////////////////////////////////////////////////////////// 8355 /// @brief Callback function parameters for zeCommandListClose 8356 /// @details Each entry is a pointer to the parameter passed to the function; 8357 /// allowing the callback the ability to modify the parameter's value 8358 typedef struct _ze_command_list_close_params_t 8359 { 8360 ze_command_list_handle_t* phCommandList; 8361 } ze_command_list_close_params_t; 8362 8363 /////////////////////////////////////////////////////////////////////////////// 8364 /// @brief Callback function-pointer for zeCommandListClose 8365 /// @param[in] params Parameters passed to this instance 8366 /// @param[in] result Return value 8367 /// @param[in] pTracerUserData Per-Tracer user data 8368 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8369 typedef void (ZE_APICALL *ze_pfnCommandListCloseCb_t)( 8370 ze_command_list_close_params_t* params, 8371 ze_result_t result, 8372 void* pTracerUserData, 8373 void** ppTracerInstanceUserData 8374 ); 8375 8376 /////////////////////////////////////////////////////////////////////////////// 8377 /// @brief Callback function parameters for zeCommandListReset 8378 /// @details Each entry is a pointer to the parameter passed to the function; 8379 /// allowing the callback the ability to modify the parameter's value 8380 typedef struct _ze_command_list_reset_params_t 8381 { 8382 ze_command_list_handle_t* phCommandList; 8383 } ze_command_list_reset_params_t; 8384 8385 /////////////////////////////////////////////////////////////////////////////// 8386 /// @brief Callback function-pointer for zeCommandListReset 8387 /// @param[in] params Parameters passed to this instance 8388 /// @param[in] result Return value 8389 /// @param[in] pTracerUserData Per-Tracer user data 8390 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8391 typedef void (ZE_APICALL *ze_pfnCommandListResetCb_t)( 8392 ze_command_list_reset_params_t* params, 8393 ze_result_t result, 8394 void* pTracerUserData, 8395 void** ppTracerInstanceUserData 8396 ); 8397 8398 /////////////////////////////////////////////////////////////////////////////// 8399 /// @brief Callback function parameters for zeCommandListAppendWriteGlobalTimestamp 8400 /// @details Each entry is a pointer to the parameter passed to the function; 8401 /// allowing the callback the ability to modify the parameter's value 8402 typedef struct _ze_command_list_append_write_global_timestamp_params_t 8403 { 8404 ze_command_list_handle_t* phCommandList; 8405 uint64_t** pdstptr; 8406 ze_event_handle_t* phSignalEvent; 8407 uint32_t* pnumWaitEvents; 8408 ze_event_handle_t** pphWaitEvents; 8409 } ze_command_list_append_write_global_timestamp_params_t; 8410 8411 /////////////////////////////////////////////////////////////////////////////// 8412 /// @brief Callback function-pointer for zeCommandListAppendWriteGlobalTimestamp 8413 /// @param[in] params Parameters passed to this instance 8414 /// @param[in] result Return value 8415 /// @param[in] pTracerUserData Per-Tracer user data 8416 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8417 typedef void (ZE_APICALL *ze_pfnCommandListAppendWriteGlobalTimestampCb_t)( 8418 ze_command_list_append_write_global_timestamp_params_t* params, 8419 ze_result_t result, 8420 void* pTracerUserData, 8421 void** ppTracerInstanceUserData 8422 ); 8423 8424 /////////////////////////////////////////////////////////////////////////////// 8425 /// @brief Callback function parameters for zeCommandListAppendBarrier 8426 /// @details Each entry is a pointer to the parameter passed to the function; 8427 /// allowing the callback the ability to modify the parameter's value 8428 typedef struct _ze_command_list_append_barrier_params_t 8429 { 8430 ze_command_list_handle_t* phCommandList; 8431 ze_event_handle_t* phSignalEvent; 8432 uint32_t* pnumWaitEvents; 8433 ze_event_handle_t** pphWaitEvents; 8434 } ze_command_list_append_barrier_params_t; 8435 8436 /////////////////////////////////////////////////////////////////////////////// 8437 /// @brief Callback function-pointer for zeCommandListAppendBarrier 8438 /// @param[in] params Parameters passed to this instance 8439 /// @param[in] result Return value 8440 /// @param[in] pTracerUserData Per-Tracer user data 8441 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8442 typedef void (ZE_APICALL *ze_pfnCommandListAppendBarrierCb_t)( 8443 ze_command_list_append_barrier_params_t* params, 8444 ze_result_t result, 8445 void* pTracerUserData, 8446 void** ppTracerInstanceUserData 8447 ); 8448 8449 /////////////////////////////////////////////////////////////////////////////// 8450 /// @brief Callback function parameters for zeCommandListAppendMemoryRangesBarrier 8451 /// @details Each entry is a pointer to the parameter passed to the function; 8452 /// allowing the callback the ability to modify the parameter's value 8453 typedef struct _ze_command_list_append_memory_ranges_barrier_params_t 8454 { 8455 ze_command_list_handle_t* phCommandList; 8456 uint32_t* pnumRanges; 8457 const size_t** ppRangeSizes; 8458 const void*** ppRanges; 8459 ze_event_handle_t* phSignalEvent; 8460 uint32_t* pnumWaitEvents; 8461 ze_event_handle_t** pphWaitEvents; 8462 } ze_command_list_append_memory_ranges_barrier_params_t; 8463 8464 /////////////////////////////////////////////////////////////////////////////// 8465 /// @brief Callback function-pointer for zeCommandListAppendMemoryRangesBarrier 8466 /// @param[in] params Parameters passed to this instance 8467 /// @param[in] result Return value 8468 /// @param[in] pTracerUserData Per-Tracer user data 8469 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8470 typedef void (ZE_APICALL *ze_pfnCommandListAppendMemoryRangesBarrierCb_t)( 8471 ze_command_list_append_memory_ranges_barrier_params_t* params, 8472 ze_result_t result, 8473 void* pTracerUserData, 8474 void** ppTracerInstanceUserData 8475 ); 8476 8477 /////////////////////////////////////////////////////////////////////////////// 8478 /// @brief Callback function parameters for zeCommandListAppendMemoryCopy 8479 /// @details Each entry is a pointer to the parameter passed to the function; 8480 /// allowing the callback the ability to modify the parameter's value 8481 typedef struct _ze_command_list_append_memory_copy_params_t 8482 { 8483 ze_command_list_handle_t* phCommandList; 8484 void** pdstptr; 8485 const void** psrcptr; 8486 size_t* psize; 8487 ze_event_handle_t* phSignalEvent; 8488 uint32_t* pnumWaitEvents; 8489 ze_event_handle_t** pphWaitEvents; 8490 } ze_command_list_append_memory_copy_params_t; 8491 8492 /////////////////////////////////////////////////////////////////////////////// 8493 /// @brief Callback function-pointer for zeCommandListAppendMemoryCopy 8494 /// @param[in] params Parameters passed to this instance 8495 /// @param[in] result Return value 8496 /// @param[in] pTracerUserData Per-Tracer user data 8497 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8498 typedef void (ZE_APICALL *ze_pfnCommandListAppendMemoryCopyCb_t)( 8499 ze_command_list_append_memory_copy_params_t* params, 8500 ze_result_t result, 8501 void* pTracerUserData, 8502 void** ppTracerInstanceUserData 8503 ); 8504 8505 /////////////////////////////////////////////////////////////////////////////// 8506 /// @brief Callback function parameters for zeCommandListAppendMemoryFill 8507 /// @details Each entry is a pointer to the parameter passed to the function; 8508 /// allowing the callback the ability to modify the parameter's value 8509 typedef struct _ze_command_list_append_memory_fill_params_t 8510 { 8511 ze_command_list_handle_t* phCommandList; 8512 void** pptr; 8513 const void** ppattern; 8514 size_t* ppattern_size; 8515 size_t* psize; 8516 ze_event_handle_t* phSignalEvent; 8517 uint32_t* pnumWaitEvents; 8518 ze_event_handle_t** pphWaitEvents; 8519 } ze_command_list_append_memory_fill_params_t; 8520 8521 /////////////////////////////////////////////////////////////////////////////// 8522 /// @brief Callback function-pointer for zeCommandListAppendMemoryFill 8523 /// @param[in] params Parameters passed to this instance 8524 /// @param[in] result Return value 8525 /// @param[in] pTracerUserData Per-Tracer user data 8526 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8527 typedef void (ZE_APICALL *ze_pfnCommandListAppendMemoryFillCb_t)( 8528 ze_command_list_append_memory_fill_params_t* params, 8529 ze_result_t result, 8530 void* pTracerUserData, 8531 void** ppTracerInstanceUserData 8532 ); 8533 8534 /////////////////////////////////////////////////////////////////////////////// 8535 /// @brief Callback function parameters for zeCommandListAppendMemoryCopyRegion 8536 /// @details Each entry is a pointer to the parameter passed to the function; 8537 /// allowing the callback the ability to modify the parameter's value 8538 typedef struct _ze_command_list_append_memory_copy_region_params_t 8539 { 8540 ze_command_list_handle_t* phCommandList; 8541 void** pdstptr; 8542 const ze_copy_region_t** pdstRegion; 8543 uint32_t* pdstPitch; 8544 uint32_t* pdstSlicePitch; 8545 const void** psrcptr; 8546 const ze_copy_region_t** psrcRegion; 8547 uint32_t* psrcPitch; 8548 uint32_t* psrcSlicePitch; 8549 ze_event_handle_t* phSignalEvent; 8550 uint32_t* pnumWaitEvents; 8551 ze_event_handle_t** pphWaitEvents; 8552 } ze_command_list_append_memory_copy_region_params_t; 8553 8554 /////////////////////////////////////////////////////////////////////////////// 8555 /// @brief Callback function-pointer for zeCommandListAppendMemoryCopyRegion 8556 /// @param[in] params Parameters passed to this instance 8557 /// @param[in] result Return value 8558 /// @param[in] pTracerUserData Per-Tracer user data 8559 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8560 typedef void (ZE_APICALL *ze_pfnCommandListAppendMemoryCopyRegionCb_t)( 8561 ze_command_list_append_memory_copy_region_params_t* params, 8562 ze_result_t result, 8563 void* pTracerUserData, 8564 void** ppTracerInstanceUserData 8565 ); 8566 8567 /////////////////////////////////////////////////////////////////////////////// 8568 /// @brief Callback function parameters for zeCommandListAppendMemoryCopyFromContext 8569 /// @details Each entry is a pointer to the parameter passed to the function; 8570 /// allowing the callback the ability to modify the parameter's value 8571 typedef struct _ze_command_list_append_memory_copy_from_context_params_t 8572 { 8573 ze_command_list_handle_t* phCommandList; 8574 void** pdstptr; 8575 ze_context_handle_t* phContextSrc; 8576 const void** psrcptr; 8577 size_t* psize; 8578 ze_event_handle_t* phSignalEvent; 8579 uint32_t* pnumWaitEvents; 8580 ze_event_handle_t** pphWaitEvents; 8581 } ze_command_list_append_memory_copy_from_context_params_t; 8582 8583 /////////////////////////////////////////////////////////////////////////////// 8584 /// @brief Callback function-pointer for zeCommandListAppendMemoryCopyFromContext 8585 /// @param[in] params Parameters passed to this instance 8586 /// @param[in] result Return value 8587 /// @param[in] pTracerUserData Per-Tracer user data 8588 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8589 typedef void (ZE_APICALL *ze_pfnCommandListAppendMemoryCopyFromContextCb_t)( 8590 ze_command_list_append_memory_copy_from_context_params_t* params, 8591 ze_result_t result, 8592 void* pTracerUserData, 8593 void** ppTracerInstanceUserData 8594 ); 8595 8596 /////////////////////////////////////////////////////////////////////////////// 8597 /// @brief Callback function parameters for zeCommandListAppendImageCopy 8598 /// @details Each entry is a pointer to the parameter passed to the function; 8599 /// allowing the callback the ability to modify the parameter's value 8600 typedef struct _ze_command_list_append_image_copy_params_t 8601 { 8602 ze_command_list_handle_t* phCommandList; 8603 ze_image_handle_t* phDstImage; 8604 ze_image_handle_t* phSrcImage; 8605 ze_event_handle_t* phSignalEvent; 8606 uint32_t* pnumWaitEvents; 8607 ze_event_handle_t** pphWaitEvents; 8608 } ze_command_list_append_image_copy_params_t; 8609 8610 /////////////////////////////////////////////////////////////////////////////// 8611 /// @brief Callback function-pointer for zeCommandListAppendImageCopy 8612 /// @param[in] params Parameters passed to this instance 8613 /// @param[in] result Return value 8614 /// @param[in] pTracerUserData Per-Tracer user data 8615 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8616 typedef void (ZE_APICALL *ze_pfnCommandListAppendImageCopyCb_t)( 8617 ze_command_list_append_image_copy_params_t* params, 8618 ze_result_t result, 8619 void* pTracerUserData, 8620 void** ppTracerInstanceUserData 8621 ); 8622 8623 /////////////////////////////////////////////////////////////////////////////// 8624 /// @brief Callback function parameters for zeCommandListAppendImageCopyRegion 8625 /// @details Each entry is a pointer to the parameter passed to the function; 8626 /// allowing the callback the ability to modify the parameter's value 8627 typedef struct _ze_command_list_append_image_copy_region_params_t 8628 { 8629 ze_command_list_handle_t* phCommandList; 8630 ze_image_handle_t* phDstImage; 8631 ze_image_handle_t* phSrcImage; 8632 const ze_image_region_t** ppDstRegion; 8633 const ze_image_region_t** ppSrcRegion; 8634 ze_event_handle_t* phSignalEvent; 8635 uint32_t* pnumWaitEvents; 8636 ze_event_handle_t** pphWaitEvents; 8637 } ze_command_list_append_image_copy_region_params_t; 8638 8639 /////////////////////////////////////////////////////////////////////////////// 8640 /// @brief Callback function-pointer for zeCommandListAppendImageCopyRegion 8641 /// @param[in] params Parameters passed to this instance 8642 /// @param[in] result Return value 8643 /// @param[in] pTracerUserData Per-Tracer user data 8644 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8645 typedef void (ZE_APICALL *ze_pfnCommandListAppendImageCopyRegionCb_t)( 8646 ze_command_list_append_image_copy_region_params_t* params, 8647 ze_result_t result, 8648 void* pTracerUserData, 8649 void** ppTracerInstanceUserData 8650 ); 8651 8652 /////////////////////////////////////////////////////////////////////////////// 8653 /// @brief Callback function parameters for zeCommandListAppendImageCopyToMemory 8654 /// @details Each entry is a pointer to the parameter passed to the function; 8655 /// allowing the callback the ability to modify the parameter's value 8656 typedef struct _ze_command_list_append_image_copy_to_memory_params_t 8657 { 8658 ze_command_list_handle_t* phCommandList; 8659 void** pdstptr; 8660 ze_image_handle_t* phSrcImage; 8661 const ze_image_region_t** ppSrcRegion; 8662 ze_event_handle_t* phSignalEvent; 8663 uint32_t* pnumWaitEvents; 8664 ze_event_handle_t** pphWaitEvents; 8665 } ze_command_list_append_image_copy_to_memory_params_t; 8666 8667 /////////////////////////////////////////////////////////////////////////////// 8668 /// @brief Callback function-pointer for zeCommandListAppendImageCopyToMemory 8669 /// @param[in] params Parameters passed to this instance 8670 /// @param[in] result Return value 8671 /// @param[in] pTracerUserData Per-Tracer user data 8672 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8673 typedef void (ZE_APICALL *ze_pfnCommandListAppendImageCopyToMemoryCb_t)( 8674 ze_command_list_append_image_copy_to_memory_params_t* params, 8675 ze_result_t result, 8676 void* pTracerUserData, 8677 void** ppTracerInstanceUserData 8678 ); 8679 8680 /////////////////////////////////////////////////////////////////////////////// 8681 /// @brief Callback function parameters for zeCommandListAppendImageCopyFromMemory 8682 /// @details Each entry is a pointer to the parameter passed to the function; 8683 /// allowing the callback the ability to modify the parameter's value 8684 typedef struct _ze_command_list_append_image_copy_from_memory_params_t 8685 { 8686 ze_command_list_handle_t* phCommandList; 8687 ze_image_handle_t* phDstImage; 8688 const void** psrcptr; 8689 const ze_image_region_t** ppDstRegion; 8690 ze_event_handle_t* phSignalEvent; 8691 uint32_t* pnumWaitEvents; 8692 ze_event_handle_t** pphWaitEvents; 8693 } ze_command_list_append_image_copy_from_memory_params_t; 8694 8695 /////////////////////////////////////////////////////////////////////////////// 8696 /// @brief Callback function-pointer for zeCommandListAppendImageCopyFromMemory 8697 /// @param[in] params Parameters passed to this instance 8698 /// @param[in] result Return value 8699 /// @param[in] pTracerUserData Per-Tracer user data 8700 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8701 typedef void (ZE_APICALL *ze_pfnCommandListAppendImageCopyFromMemoryCb_t)( 8702 ze_command_list_append_image_copy_from_memory_params_t* params, 8703 ze_result_t result, 8704 void* pTracerUserData, 8705 void** ppTracerInstanceUserData 8706 ); 8707 8708 /////////////////////////////////////////////////////////////////////////////// 8709 /// @brief Callback function parameters for zeCommandListAppendMemoryPrefetch 8710 /// @details Each entry is a pointer to the parameter passed to the function; 8711 /// allowing the callback the ability to modify the parameter's value 8712 typedef struct _ze_command_list_append_memory_prefetch_params_t 8713 { 8714 ze_command_list_handle_t* phCommandList; 8715 const void** pptr; 8716 size_t* psize; 8717 } ze_command_list_append_memory_prefetch_params_t; 8718 8719 /////////////////////////////////////////////////////////////////////////////// 8720 /// @brief Callback function-pointer for zeCommandListAppendMemoryPrefetch 8721 /// @param[in] params Parameters passed to this instance 8722 /// @param[in] result Return value 8723 /// @param[in] pTracerUserData Per-Tracer user data 8724 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8725 typedef void (ZE_APICALL *ze_pfnCommandListAppendMemoryPrefetchCb_t)( 8726 ze_command_list_append_memory_prefetch_params_t* params, 8727 ze_result_t result, 8728 void* pTracerUserData, 8729 void** ppTracerInstanceUserData 8730 ); 8731 8732 /////////////////////////////////////////////////////////////////////////////// 8733 /// @brief Callback function parameters for zeCommandListAppendMemAdvise 8734 /// @details Each entry is a pointer to the parameter passed to the function; 8735 /// allowing the callback the ability to modify the parameter's value 8736 typedef struct _ze_command_list_append_mem_advise_params_t 8737 { 8738 ze_command_list_handle_t* phCommandList; 8739 ze_device_handle_t* phDevice; 8740 const void** pptr; 8741 size_t* psize; 8742 ze_memory_advice_t* padvice; 8743 } ze_command_list_append_mem_advise_params_t; 8744 8745 /////////////////////////////////////////////////////////////////////////////// 8746 /// @brief Callback function-pointer for zeCommandListAppendMemAdvise 8747 /// @param[in] params Parameters passed to this instance 8748 /// @param[in] result Return value 8749 /// @param[in] pTracerUserData Per-Tracer user data 8750 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8751 typedef void (ZE_APICALL *ze_pfnCommandListAppendMemAdviseCb_t)( 8752 ze_command_list_append_mem_advise_params_t* params, 8753 ze_result_t result, 8754 void* pTracerUserData, 8755 void** ppTracerInstanceUserData 8756 ); 8757 8758 /////////////////////////////////////////////////////////////////////////////// 8759 /// @brief Callback function parameters for zeCommandListAppendSignalEvent 8760 /// @details Each entry is a pointer to the parameter passed to the function; 8761 /// allowing the callback the ability to modify the parameter's value 8762 typedef struct _ze_command_list_append_signal_event_params_t 8763 { 8764 ze_command_list_handle_t* phCommandList; 8765 ze_event_handle_t* phEvent; 8766 } ze_command_list_append_signal_event_params_t; 8767 8768 /////////////////////////////////////////////////////////////////////////////// 8769 /// @brief Callback function-pointer for zeCommandListAppendSignalEvent 8770 /// @param[in] params Parameters passed to this instance 8771 /// @param[in] result Return value 8772 /// @param[in] pTracerUserData Per-Tracer user data 8773 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8774 typedef void (ZE_APICALL *ze_pfnCommandListAppendSignalEventCb_t)( 8775 ze_command_list_append_signal_event_params_t* params, 8776 ze_result_t result, 8777 void* pTracerUserData, 8778 void** ppTracerInstanceUserData 8779 ); 8780 8781 /////////////////////////////////////////////////////////////////////////////// 8782 /// @brief Callback function parameters for zeCommandListAppendWaitOnEvents 8783 /// @details Each entry is a pointer to the parameter passed to the function; 8784 /// allowing the callback the ability to modify the parameter's value 8785 typedef struct _ze_command_list_append_wait_on_events_params_t 8786 { 8787 ze_command_list_handle_t* phCommandList; 8788 uint32_t* pnumEvents; 8789 ze_event_handle_t** pphEvents; 8790 } ze_command_list_append_wait_on_events_params_t; 8791 8792 /////////////////////////////////////////////////////////////////////////////// 8793 /// @brief Callback function-pointer for zeCommandListAppendWaitOnEvents 8794 /// @param[in] params Parameters passed to this instance 8795 /// @param[in] result Return value 8796 /// @param[in] pTracerUserData Per-Tracer user data 8797 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8798 typedef void (ZE_APICALL *ze_pfnCommandListAppendWaitOnEventsCb_t)( 8799 ze_command_list_append_wait_on_events_params_t* params, 8800 ze_result_t result, 8801 void* pTracerUserData, 8802 void** ppTracerInstanceUserData 8803 ); 8804 8805 /////////////////////////////////////////////////////////////////////////////// 8806 /// @brief Callback function parameters for zeCommandListAppendEventReset 8807 /// @details Each entry is a pointer to the parameter passed to the function; 8808 /// allowing the callback the ability to modify the parameter's value 8809 typedef struct _ze_command_list_append_event_reset_params_t 8810 { 8811 ze_command_list_handle_t* phCommandList; 8812 ze_event_handle_t* phEvent; 8813 } ze_command_list_append_event_reset_params_t; 8814 8815 /////////////////////////////////////////////////////////////////////////////// 8816 /// @brief Callback function-pointer for zeCommandListAppendEventReset 8817 /// @param[in] params Parameters passed to this instance 8818 /// @param[in] result Return value 8819 /// @param[in] pTracerUserData Per-Tracer user data 8820 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8821 typedef void (ZE_APICALL *ze_pfnCommandListAppendEventResetCb_t)( 8822 ze_command_list_append_event_reset_params_t* params, 8823 ze_result_t result, 8824 void* pTracerUserData, 8825 void** ppTracerInstanceUserData 8826 ); 8827 8828 /////////////////////////////////////////////////////////////////////////////// 8829 /// @brief Callback function parameters for zeCommandListAppendQueryKernelTimestamps 8830 /// @details Each entry is a pointer to the parameter passed to the function; 8831 /// allowing the callback the ability to modify the parameter's value 8832 typedef struct _ze_command_list_append_query_kernel_timestamps_params_t 8833 { 8834 ze_command_list_handle_t* phCommandList; 8835 uint32_t* pnumEvents; 8836 ze_event_handle_t** pphEvents; 8837 void** pdstptr; 8838 const size_t** ppOffsets; 8839 ze_event_handle_t* phSignalEvent; 8840 uint32_t* pnumWaitEvents; 8841 ze_event_handle_t** pphWaitEvents; 8842 } ze_command_list_append_query_kernel_timestamps_params_t; 8843 8844 /////////////////////////////////////////////////////////////////////////////// 8845 /// @brief Callback function-pointer for zeCommandListAppendQueryKernelTimestamps 8846 /// @param[in] params Parameters passed to this instance 8847 /// @param[in] result Return value 8848 /// @param[in] pTracerUserData Per-Tracer user data 8849 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8850 typedef void (ZE_APICALL *ze_pfnCommandListAppendQueryKernelTimestampsCb_t)( 8851 ze_command_list_append_query_kernel_timestamps_params_t* params, 8852 ze_result_t result, 8853 void* pTracerUserData, 8854 void** ppTracerInstanceUserData 8855 ); 8856 8857 /////////////////////////////////////////////////////////////////////////////// 8858 /// @brief Callback function parameters for zeCommandListAppendLaunchKernel 8859 /// @details Each entry is a pointer to the parameter passed to the function; 8860 /// allowing the callback the ability to modify the parameter's value 8861 typedef struct _ze_command_list_append_launch_kernel_params_t 8862 { 8863 ze_command_list_handle_t* phCommandList; 8864 ze_kernel_handle_t* phKernel; 8865 const ze_group_count_t** ppLaunchFuncArgs; 8866 ze_event_handle_t* phSignalEvent; 8867 uint32_t* pnumWaitEvents; 8868 ze_event_handle_t** pphWaitEvents; 8869 } ze_command_list_append_launch_kernel_params_t; 8870 8871 /////////////////////////////////////////////////////////////////////////////// 8872 /// @brief Callback function-pointer for zeCommandListAppendLaunchKernel 8873 /// @param[in] params Parameters passed to this instance 8874 /// @param[in] result Return value 8875 /// @param[in] pTracerUserData Per-Tracer user data 8876 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8877 typedef void (ZE_APICALL *ze_pfnCommandListAppendLaunchKernelCb_t)( 8878 ze_command_list_append_launch_kernel_params_t* params, 8879 ze_result_t result, 8880 void* pTracerUserData, 8881 void** ppTracerInstanceUserData 8882 ); 8883 8884 /////////////////////////////////////////////////////////////////////////////// 8885 /// @brief Callback function parameters for zeCommandListAppendLaunchCooperativeKernel 8886 /// @details Each entry is a pointer to the parameter passed to the function; 8887 /// allowing the callback the ability to modify the parameter's value 8888 typedef struct _ze_command_list_append_launch_cooperative_kernel_params_t 8889 { 8890 ze_command_list_handle_t* phCommandList; 8891 ze_kernel_handle_t* phKernel; 8892 const ze_group_count_t** ppLaunchFuncArgs; 8893 ze_event_handle_t* phSignalEvent; 8894 uint32_t* pnumWaitEvents; 8895 ze_event_handle_t** pphWaitEvents; 8896 } ze_command_list_append_launch_cooperative_kernel_params_t; 8897 8898 /////////////////////////////////////////////////////////////////////////////// 8899 /// @brief Callback function-pointer for zeCommandListAppendLaunchCooperativeKernel 8900 /// @param[in] params Parameters passed to this instance 8901 /// @param[in] result Return value 8902 /// @param[in] pTracerUserData Per-Tracer user data 8903 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8904 typedef void (ZE_APICALL *ze_pfnCommandListAppendLaunchCooperativeKernelCb_t)( 8905 ze_command_list_append_launch_cooperative_kernel_params_t* params, 8906 ze_result_t result, 8907 void* pTracerUserData, 8908 void** ppTracerInstanceUserData 8909 ); 8910 8911 /////////////////////////////////////////////////////////////////////////////// 8912 /// @brief Callback function parameters for zeCommandListAppendLaunchKernelIndirect 8913 /// @details Each entry is a pointer to the parameter passed to the function; 8914 /// allowing the callback the ability to modify the parameter's value 8915 typedef struct _ze_command_list_append_launch_kernel_indirect_params_t 8916 { 8917 ze_command_list_handle_t* phCommandList; 8918 ze_kernel_handle_t* phKernel; 8919 const ze_group_count_t** ppLaunchArgumentsBuffer; 8920 ze_event_handle_t* phSignalEvent; 8921 uint32_t* pnumWaitEvents; 8922 ze_event_handle_t** pphWaitEvents; 8923 } ze_command_list_append_launch_kernel_indirect_params_t; 8924 8925 /////////////////////////////////////////////////////////////////////////////// 8926 /// @brief Callback function-pointer for zeCommandListAppendLaunchKernelIndirect 8927 /// @param[in] params Parameters passed to this instance 8928 /// @param[in] result Return value 8929 /// @param[in] pTracerUserData Per-Tracer user data 8930 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8931 typedef void (ZE_APICALL *ze_pfnCommandListAppendLaunchKernelIndirectCb_t)( 8932 ze_command_list_append_launch_kernel_indirect_params_t* params, 8933 ze_result_t result, 8934 void* pTracerUserData, 8935 void** ppTracerInstanceUserData 8936 ); 8937 8938 /////////////////////////////////////////////////////////////////////////////// 8939 /// @brief Callback function parameters for zeCommandListAppendLaunchMultipleKernelsIndirect 8940 /// @details Each entry is a pointer to the parameter passed to the function; 8941 /// allowing the callback the ability to modify the parameter's value 8942 typedef struct _ze_command_list_append_launch_multiple_kernels_indirect_params_t 8943 { 8944 ze_command_list_handle_t* phCommandList; 8945 uint32_t* pnumKernels; 8946 ze_kernel_handle_t** pphKernels; 8947 const uint32_t** ppCountBuffer; 8948 const ze_group_count_t** ppLaunchArgumentsBuffer; 8949 ze_event_handle_t* phSignalEvent; 8950 uint32_t* pnumWaitEvents; 8951 ze_event_handle_t** pphWaitEvents; 8952 } ze_command_list_append_launch_multiple_kernels_indirect_params_t; 8953 8954 /////////////////////////////////////////////////////////////////////////////// 8955 /// @brief Callback function-pointer for zeCommandListAppendLaunchMultipleKernelsIndirect 8956 /// @param[in] params Parameters passed to this instance 8957 /// @param[in] result Return value 8958 /// @param[in] pTracerUserData Per-Tracer user data 8959 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 8960 typedef void (ZE_APICALL *ze_pfnCommandListAppendLaunchMultipleKernelsIndirectCb_t)( 8961 ze_command_list_append_launch_multiple_kernels_indirect_params_t* params, 8962 ze_result_t result, 8963 void* pTracerUserData, 8964 void** ppTracerInstanceUserData 8965 ); 8966 8967 /////////////////////////////////////////////////////////////////////////////// 8968 /// @brief Table of CommandList callback functions pointers 8969 typedef struct _ze_command_list_callbacks_t 8970 { 8971 ze_pfnCommandListCreateCb_t pfnCreateCb; 8972 ze_pfnCommandListCreateImmediateCb_t pfnCreateImmediateCb; 8973 ze_pfnCommandListDestroyCb_t pfnDestroyCb; 8974 ze_pfnCommandListCloseCb_t pfnCloseCb; 8975 ze_pfnCommandListResetCb_t pfnResetCb; 8976 ze_pfnCommandListAppendWriteGlobalTimestampCb_t pfnAppendWriteGlobalTimestampCb; 8977 ze_pfnCommandListAppendBarrierCb_t pfnAppendBarrierCb; 8978 ze_pfnCommandListAppendMemoryRangesBarrierCb_t pfnAppendMemoryRangesBarrierCb; 8979 ze_pfnCommandListAppendMemoryCopyCb_t pfnAppendMemoryCopyCb; 8980 ze_pfnCommandListAppendMemoryFillCb_t pfnAppendMemoryFillCb; 8981 ze_pfnCommandListAppendMemoryCopyRegionCb_t pfnAppendMemoryCopyRegionCb; 8982 ze_pfnCommandListAppendMemoryCopyFromContextCb_t pfnAppendMemoryCopyFromContextCb; 8983 ze_pfnCommandListAppendImageCopyCb_t pfnAppendImageCopyCb; 8984 ze_pfnCommandListAppendImageCopyRegionCb_t pfnAppendImageCopyRegionCb; 8985 ze_pfnCommandListAppendImageCopyToMemoryCb_t pfnAppendImageCopyToMemoryCb; 8986 ze_pfnCommandListAppendImageCopyFromMemoryCb_t pfnAppendImageCopyFromMemoryCb; 8987 ze_pfnCommandListAppendMemoryPrefetchCb_t pfnAppendMemoryPrefetchCb; 8988 ze_pfnCommandListAppendMemAdviseCb_t pfnAppendMemAdviseCb; 8989 ze_pfnCommandListAppendSignalEventCb_t pfnAppendSignalEventCb; 8990 ze_pfnCommandListAppendWaitOnEventsCb_t pfnAppendWaitOnEventsCb; 8991 ze_pfnCommandListAppendEventResetCb_t pfnAppendEventResetCb; 8992 ze_pfnCommandListAppendQueryKernelTimestampsCb_t pfnAppendQueryKernelTimestampsCb; 8993 ze_pfnCommandListAppendLaunchKernelCb_t pfnAppendLaunchKernelCb; 8994 ze_pfnCommandListAppendLaunchCooperativeKernelCb_t pfnAppendLaunchCooperativeKernelCb; 8995 ze_pfnCommandListAppendLaunchKernelIndirectCb_t pfnAppendLaunchKernelIndirectCb; 8996 ze_pfnCommandListAppendLaunchMultipleKernelsIndirectCb_t pfnAppendLaunchMultipleKernelsIndirectCb; 8997 } ze_command_list_callbacks_t; 8998 8999 /////////////////////////////////////////////////////////////////////////////// 9000 /// @brief Callback function parameters for zeImageGetProperties 9001 /// @details Each entry is a pointer to the parameter passed to the function; 9002 /// allowing the callback the ability to modify the parameter's value 9003 typedef struct _ze_image_get_properties_params_t 9004 { 9005 ze_device_handle_t* phDevice; 9006 const ze_image_desc_t** pdesc; 9007 ze_image_properties_t** ppImageProperties; 9008 } ze_image_get_properties_params_t; 9009 9010 /////////////////////////////////////////////////////////////////////////////// 9011 /// @brief Callback function-pointer for zeImageGetProperties 9012 /// @param[in] params Parameters passed to this instance 9013 /// @param[in] result Return value 9014 /// @param[in] pTracerUserData Per-Tracer user data 9015 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9016 typedef void (ZE_APICALL *ze_pfnImageGetPropertiesCb_t)( 9017 ze_image_get_properties_params_t* params, 9018 ze_result_t result, 9019 void* pTracerUserData, 9020 void** ppTracerInstanceUserData 9021 ); 9022 9023 /////////////////////////////////////////////////////////////////////////////// 9024 /// @brief Callback function parameters for zeImageCreate 9025 /// @details Each entry is a pointer to the parameter passed to the function; 9026 /// allowing the callback the ability to modify the parameter's value 9027 typedef struct _ze_image_create_params_t 9028 { 9029 ze_context_handle_t* phContext; 9030 ze_device_handle_t* phDevice; 9031 const ze_image_desc_t** pdesc; 9032 ze_image_handle_t** pphImage; 9033 } ze_image_create_params_t; 9034 9035 /////////////////////////////////////////////////////////////////////////////// 9036 /// @brief Callback function-pointer for zeImageCreate 9037 /// @param[in] params Parameters passed to this instance 9038 /// @param[in] result Return value 9039 /// @param[in] pTracerUserData Per-Tracer user data 9040 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9041 typedef void (ZE_APICALL *ze_pfnImageCreateCb_t)( 9042 ze_image_create_params_t* params, 9043 ze_result_t result, 9044 void* pTracerUserData, 9045 void** ppTracerInstanceUserData 9046 ); 9047 9048 /////////////////////////////////////////////////////////////////////////////// 9049 /// @brief Callback function parameters for zeImageDestroy 9050 /// @details Each entry is a pointer to the parameter passed to the function; 9051 /// allowing the callback the ability to modify the parameter's value 9052 typedef struct _ze_image_destroy_params_t 9053 { 9054 ze_image_handle_t* phImage; 9055 } ze_image_destroy_params_t; 9056 9057 /////////////////////////////////////////////////////////////////////////////// 9058 /// @brief Callback function-pointer for zeImageDestroy 9059 /// @param[in] params Parameters passed to this instance 9060 /// @param[in] result Return value 9061 /// @param[in] pTracerUserData Per-Tracer user data 9062 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9063 typedef void (ZE_APICALL *ze_pfnImageDestroyCb_t)( 9064 ze_image_destroy_params_t* params, 9065 ze_result_t result, 9066 void* pTracerUserData, 9067 void** ppTracerInstanceUserData 9068 ); 9069 9070 /////////////////////////////////////////////////////////////////////////////// 9071 /// @brief Table of Image callback functions pointers 9072 typedef struct _ze_image_callbacks_t 9073 { 9074 ze_pfnImageGetPropertiesCb_t pfnGetPropertiesCb; 9075 ze_pfnImageCreateCb_t pfnCreateCb; 9076 ze_pfnImageDestroyCb_t pfnDestroyCb; 9077 } ze_image_callbacks_t; 9078 9079 /////////////////////////////////////////////////////////////////////////////// 9080 /// @brief Callback function parameters for zeFenceCreate 9081 /// @details Each entry is a pointer to the parameter passed to the function; 9082 /// allowing the callback the ability to modify the parameter's value 9083 typedef struct _ze_fence_create_params_t 9084 { 9085 ze_command_queue_handle_t* phCommandQueue; 9086 const ze_fence_desc_t** pdesc; 9087 ze_fence_handle_t** pphFence; 9088 } ze_fence_create_params_t; 9089 9090 /////////////////////////////////////////////////////////////////////////////// 9091 /// @brief Callback function-pointer for zeFenceCreate 9092 /// @param[in] params Parameters passed to this instance 9093 /// @param[in] result Return value 9094 /// @param[in] pTracerUserData Per-Tracer user data 9095 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9096 typedef void (ZE_APICALL *ze_pfnFenceCreateCb_t)( 9097 ze_fence_create_params_t* params, 9098 ze_result_t result, 9099 void* pTracerUserData, 9100 void** ppTracerInstanceUserData 9101 ); 9102 9103 /////////////////////////////////////////////////////////////////////////////// 9104 /// @brief Callback function parameters for zeFenceDestroy 9105 /// @details Each entry is a pointer to the parameter passed to the function; 9106 /// allowing the callback the ability to modify the parameter's value 9107 typedef struct _ze_fence_destroy_params_t 9108 { 9109 ze_fence_handle_t* phFence; 9110 } ze_fence_destroy_params_t; 9111 9112 /////////////////////////////////////////////////////////////////////////////// 9113 /// @brief Callback function-pointer for zeFenceDestroy 9114 /// @param[in] params Parameters passed to this instance 9115 /// @param[in] result Return value 9116 /// @param[in] pTracerUserData Per-Tracer user data 9117 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9118 typedef void (ZE_APICALL *ze_pfnFenceDestroyCb_t)( 9119 ze_fence_destroy_params_t* params, 9120 ze_result_t result, 9121 void* pTracerUserData, 9122 void** ppTracerInstanceUserData 9123 ); 9124 9125 /////////////////////////////////////////////////////////////////////////////// 9126 /// @brief Callback function parameters for zeFenceHostSynchronize 9127 /// @details Each entry is a pointer to the parameter passed to the function; 9128 /// allowing the callback the ability to modify the parameter's value 9129 typedef struct _ze_fence_host_synchronize_params_t 9130 { 9131 ze_fence_handle_t* phFence; 9132 uint64_t* ptimeout; 9133 } ze_fence_host_synchronize_params_t; 9134 9135 /////////////////////////////////////////////////////////////////////////////// 9136 /// @brief Callback function-pointer for zeFenceHostSynchronize 9137 /// @param[in] params Parameters passed to this instance 9138 /// @param[in] result Return value 9139 /// @param[in] pTracerUserData Per-Tracer user data 9140 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9141 typedef void (ZE_APICALL *ze_pfnFenceHostSynchronizeCb_t)( 9142 ze_fence_host_synchronize_params_t* params, 9143 ze_result_t result, 9144 void* pTracerUserData, 9145 void** ppTracerInstanceUserData 9146 ); 9147 9148 /////////////////////////////////////////////////////////////////////////////// 9149 /// @brief Callback function parameters for zeFenceQueryStatus 9150 /// @details Each entry is a pointer to the parameter passed to the function; 9151 /// allowing the callback the ability to modify the parameter's value 9152 typedef struct _ze_fence_query_status_params_t 9153 { 9154 ze_fence_handle_t* phFence; 9155 } ze_fence_query_status_params_t; 9156 9157 /////////////////////////////////////////////////////////////////////////////// 9158 /// @brief Callback function-pointer for zeFenceQueryStatus 9159 /// @param[in] params Parameters passed to this instance 9160 /// @param[in] result Return value 9161 /// @param[in] pTracerUserData Per-Tracer user data 9162 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9163 typedef void (ZE_APICALL *ze_pfnFenceQueryStatusCb_t)( 9164 ze_fence_query_status_params_t* params, 9165 ze_result_t result, 9166 void* pTracerUserData, 9167 void** ppTracerInstanceUserData 9168 ); 9169 9170 /////////////////////////////////////////////////////////////////////////////// 9171 /// @brief Callback function parameters for zeFenceReset 9172 /// @details Each entry is a pointer to the parameter passed to the function; 9173 /// allowing the callback the ability to modify the parameter's value 9174 typedef struct _ze_fence_reset_params_t 9175 { 9176 ze_fence_handle_t* phFence; 9177 } ze_fence_reset_params_t; 9178 9179 /////////////////////////////////////////////////////////////////////////////// 9180 /// @brief Callback function-pointer for zeFenceReset 9181 /// @param[in] params Parameters passed to this instance 9182 /// @param[in] result Return value 9183 /// @param[in] pTracerUserData Per-Tracer user data 9184 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9185 typedef void (ZE_APICALL *ze_pfnFenceResetCb_t)( 9186 ze_fence_reset_params_t* params, 9187 ze_result_t result, 9188 void* pTracerUserData, 9189 void** ppTracerInstanceUserData 9190 ); 9191 9192 /////////////////////////////////////////////////////////////////////////////// 9193 /// @brief Table of Fence callback functions pointers 9194 typedef struct _ze_fence_callbacks_t 9195 { 9196 ze_pfnFenceCreateCb_t pfnCreateCb; 9197 ze_pfnFenceDestroyCb_t pfnDestroyCb; 9198 ze_pfnFenceHostSynchronizeCb_t pfnHostSynchronizeCb; 9199 ze_pfnFenceQueryStatusCb_t pfnQueryStatusCb; 9200 ze_pfnFenceResetCb_t pfnResetCb; 9201 } ze_fence_callbacks_t; 9202 9203 /////////////////////////////////////////////////////////////////////////////// 9204 /// @brief Callback function parameters for zeEventPoolCreate 9205 /// @details Each entry is a pointer to the parameter passed to the function; 9206 /// allowing the callback the ability to modify the parameter's value 9207 typedef struct _ze_event_pool_create_params_t 9208 { 9209 ze_context_handle_t* phContext; 9210 const ze_event_pool_desc_t** pdesc; 9211 uint32_t* pnumDevices; 9212 ze_device_handle_t** pphDevices; 9213 ze_event_pool_handle_t** pphEventPool; 9214 } ze_event_pool_create_params_t; 9215 9216 /////////////////////////////////////////////////////////////////////////////// 9217 /// @brief Callback function-pointer for zeEventPoolCreate 9218 /// @param[in] params Parameters passed to this instance 9219 /// @param[in] result Return value 9220 /// @param[in] pTracerUserData Per-Tracer user data 9221 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9222 typedef void (ZE_APICALL *ze_pfnEventPoolCreateCb_t)( 9223 ze_event_pool_create_params_t* params, 9224 ze_result_t result, 9225 void* pTracerUserData, 9226 void** ppTracerInstanceUserData 9227 ); 9228 9229 /////////////////////////////////////////////////////////////////////////////// 9230 /// @brief Callback function parameters for zeEventPoolDestroy 9231 /// @details Each entry is a pointer to the parameter passed to the function; 9232 /// allowing the callback the ability to modify the parameter's value 9233 typedef struct _ze_event_pool_destroy_params_t 9234 { 9235 ze_event_pool_handle_t* phEventPool; 9236 } ze_event_pool_destroy_params_t; 9237 9238 /////////////////////////////////////////////////////////////////////////////// 9239 /// @brief Callback function-pointer for zeEventPoolDestroy 9240 /// @param[in] params Parameters passed to this instance 9241 /// @param[in] result Return value 9242 /// @param[in] pTracerUserData Per-Tracer user data 9243 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9244 typedef void (ZE_APICALL *ze_pfnEventPoolDestroyCb_t)( 9245 ze_event_pool_destroy_params_t* params, 9246 ze_result_t result, 9247 void* pTracerUserData, 9248 void** ppTracerInstanceUserData 9249 ); 9250 9251 /////////////////////////////////////////////////////////////////////////////// 9252 /// @brief Callback function parameters for zeEventPoolGetIpcHandle 9253 /// @details Each entry is a pointer to the parameter passed to the function; 9254 /// allowing the callback the ability to modify the parameter's value 9255 typedef struct _ze_event_pool_get_ipc_handle_params_t 9256 { 9257 ze_event_pool_handle_t* phEventPool; 9258 ze_ipc_event_pool_handle_t** pphIpc; 9259 } ze_event_pool_get_ipc_handle_params_t; 9260 9261 /////////////////////////////////////////////////////////////////////////////// 9262 /// @brief Callback function-pointer for zeEventPoolGetIpcHandle 9263 /// @param[in] params Parameters passed to this instance 9264 /// @param[in] result Return value 9265 /// @param[in] pTracerUserData Per-Tracer user data 9266 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9267 typedef void (ZE_APICALL *ze_pfnEventPoolGetIpcHandleCb_t)( 9268 ze_event_pool_get_ipc_handle_params_t* params, 9269 ze_result_t result, 9270 void* pTracerUserData, 9271 void** ppTracerInstanceUserData 9272 ); 9273 9274 /////////////////////////////////////////////////////////////////////////////// 9275 /// @brief Callback function parameters for zeEventPoolOpenIpcHandle 9276 /// @details Each entry is a pointer to the parameter passed to the function; 9277 /// allowing the callback the ability to modify the parameter's value 9278 typedef struct _ze_event_pool_open_ipc_handle_params_t 9279 { 9280 ze_context_handle_t* phContext; 9281 ze_ipc_event_pool_handle_t* phIpc; 9282 ze_event_pool_handle_t** pphEventPool; 9283 } ze_event_pool_open_ipc_handle_params_t; 9284 9285 /////////////////////////////////////////////////////////////////////////////// 9286 /// @brief Callback function-pointer for zeEventPoolOpenIpcHandle 9287 /// @param[in] params Parameters passed to this instance 9288 /// @param[in] result Return value 9289 /// @param[in] pTracerUserData Per-Tracer user data 9290 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9291 typedef void (ZE_APICALL *ze_pfnEventPoolOpenIpcHandleCb_t)( 9292 ze_event_pool_open_ipc_handle_params_t* params, 9293 ze_result_t result, 9294 void* pTracerUserData, 9295 void** ppTracerInstanceUserData 9296 ); 9297 9298 /////////////////////////////////////////////////////////////////////////////// 9299 /// @brief Callback function parameters for zeEventPoolCloseIpcHandle 9300 /// @details Each entry is a pointer to the parameter passed to the function; 9301 /// allowing the callback the ability to modify the parameter's value 9302 typedef struct _ze_event_pool_close_ipc_handle_params_t 9303 { 9304 ze_event_pool_handle_t* phEventPool; 9305 } ze_event_pool_close_ipc_handle_params_t; 9306 9307 /////////////////////////////////////////////////////////////////////////////// 9308 /// @brief Callback function-pointer for zeEventPoolCloseIpcHandle 9309 /// @param[in] params Parameters passed to this instance 9310 /// @param[in] result Return value 9311 /// @param[in] pTracerUserData Per-Tracer user data 9312 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9313 typedef void (ZE_APICALL *ze_pfnEventPoolCloseIpcHandleCb_t)( 9314 ze_event_pool_close_ipc_handle_params_t* params, 9315 ze_result_t result, 9316 void* pTracerUserData, 9317 void** ppTracerInstanceUserData 9318 ); 9319 9320 /////////////////////////////////////////////////////////////////////////////// 9321 /// @brief Table of EventPool callback functions pointers 9322 typedef struct _ze_event_pool_callbacks_t 9323 { 9324 ze_pfnEventPoolCreateCb_t pfnCreateCb; 9325 ze_pfnEventPoolDestroyCb_t pfnDestroyCb; 9326 ze_pfnEventPoolGetIpcHandleCb_t pfnGetIpcHandleCb; 9327 ze_pfnEventPoolOpenIpcHandleCb_t pfnOpenIpcHandleCb; 9328 ze_pfnEventPoolCloseIpcHandleCb_t pfnCloseIpcHandleCb; 9329 } ze_event_pool_callbacks_t; 9330 9331 /////////////////////////////////////////////////////////////////////////////// 9332 /// @brief Callback function parameters for zeEventCreate 9333 /// @details Each entry is a pointer to the parameter passed to the function; 9334 /// allowing the callback the ability to modify the parameter's value 9335 typedef struct _ze_event_create_params_t 9336 { 9337 ze_event_pool_handle_t* phEventPool; 9338 const ze_event_desc_t** pdesc; 9339 ze_event_handle_t** pphEvent; 9340 } ze_event_create_params_t; 9341 9342 /////////////////////////////////////////////////////////////////////////////// 9343 /// @brief Callback function-pointer for zeEventCreate 9344 /// @param[in] params Parameters passed to this instance 9345 /// @param[in] result Return value 9346 /// @param[in] pTracerUserData Per-Tracer user data 9347 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9348 typedef void (ZE_APICALL *ze_pfnEventCreateCb_t)( 9349 ze_event_create_params_t* params, 9350 ze_result_t result, 9351 void* pTracerUserData, 9352 void** ppTracerInstanceUserData 9353 ); 9354 9355 /////////////////////////////////////////////////////////////////////////////// 9356 /// @brief Callback function parameters for zeEventDestroy 9357 /// @details Each entry is a pointer to the parameter passed to the function; 9358 /// allowing the callback the ability to modify the parameter's value 9359 typedef struct _ze_event_destroy_params_t 9360 { 9361 ze_event_handle_t* phEvent; 9362 } ze_event_destroy_params_t; 9363 9364 /////////////////////////////////////////////////////////////////////////////// 9365 /// @brief Callback function-pointer for zeEventDestroy 9366 /// @param[in] params Parameters passed to this instance 9367 /// @param[in] result Return value 9368 /// @param[in] pTracerUserData Per-Tracer user data 9369 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9370 typedef void (ZE_APICALL *ze_pfnEventDestroyCb_t)( 9371 ze_event_destroy_params_t* params, 9372 ze_result_t result, 9373 void* pTracerUserData, 9374 void** ppTracerInstanceUserData 9375 ); 9376 9377 /////////////////////////////////////////////////////////////////////////////// 9378 /// @brief Callback function parameters for zeEventHostSignal 9379 /// @details Each entry is a pointer to the parameter passed to the function; 9380 /// allowing the callback the ability to modify the parameter's value 9381 typedef struct _ze_event_host_signal_params_t 9382 { 9383 ze_event_handle_t* phEvent; 9384 } ze_event_host_signal_params_t; 9385 9386 /////////////////////////////////////////////////////////////////////////////// 9387 /// @brief Callback function-pointer for zeEventHostSignal 9388 /// @param[in] params Parameters passed to this instance 9389 /// @param[in] result Return value 9390 /// @param[in] pTracerUserData Per-Tracer user data 9391 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9392 typedef void (ZE_APICALL *ze_pfnEventHostSignalCb_t)( 9393 ze_event_host_signal_params_t* params, 9394 ze_result_t result, 9395 void* pTracerUserData, 9396 void** ppTracerInstanceUserData 9397 ); 9398 9399 /////////////////////////////////////////////////////////////////////////////// 9400 /// @brief Callback function parameters for zeEventHostSynchronize 9401 /// @details Each entry is a pointer to the parameter passed to the function; 9402 /// allowing the callback the ability to modify the parameter's value 9403 typedef struct _ze_event_host_synchronize_params_t 9404 { 9405 ze_event_handle_t* phEvent; 9406 uint64_t* ptimeout; 9407 } ze_event_host_synchronize_params_t; 9408 9409 /////////////////////////////////////////////////////////////////////////////// 9410 /// @brief Callback function-pointer for zeEventHostSynchronize 9411 /// @param[in] params Parameters passed to this instance 9412 /// @param[in] result Return value 9413 /// @param[in] pTracerUserData Per-Tracer user data 9414 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9415 typedef void (ZE_APICALL *ze_pfnEventHostSynchronizeCb_t)( 9416 ze_event_host_synchronize_params_t* params, 9417 ze_result_t result, 9418 void* pTracerUserData, 9419 void** ppTracerInstanceUserData 9420 ); 9421 9422 /////////////////////////////////////////////////////////////////////////////// 9423 /// @brief Callback function parameters for zeEventQueryStatus 9424 /// @details Each entry is a pointer to the parameter passed to the function; 9425 /// allowing the callback the ability to modify the parameter's value 9426 typedef struct _ze_event_query_status_params_t 9427 { 9428 ze_event_handle_t* phEvent; 9429 } ze_event_query_status_params_t; 9430 9431 /////////////////////////////////////////////////////////////////////////////// 9432 /// @brief Callback function-pointer for zeEventQueryStatus 9433 /// @param[in] params Parameters passed to this instance 9434 /// @param[in] result Return value 9435 /// @param[in] pTracerUserData Per-Tracer user data 9436 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9437 typedef void (ZE_APICALL *ze_pfnEventQueryStatusCb_t)( 9438 ze_event_query_status_params_t* params, 9439 ze_result_t result, 9440 void* pTracerUserData, 9441 void** ppTracerInstanceUserData 9442 ); 9443 9444 /////////////////////////////////////////////////////////////////////////////// 9445 /// @brief Callback function parameters for zeEventHostReset 9446 /// @details Each entry is a pointer to the parameter passed to the function; 9447 /// allowing the callback the ability to modify the parameter's value 9448 typedef struct _ze_event_host_reset_params_t 9449 { 9450 ze_event_handle_t* phEvent; 9451 } ze_event_host_reset_params_t; 9452 9453 /////////////////////////////////////////////////////////////////////////////// 9454 /// @brief Callback function-pointer for zeEventHostReset 9455 /// @param[in] params Parameters passed to this instance 9456 /// @param[in] result Return value 9457 /// @param[in] pTracerUserData Per-Tracer user data 9458 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9459 typedef void (ZE_APICALL *ze_pfnEventHostResetCb_t)( 9460 ze_event_host_reset_params_t* params, 9461 ze_result_t result, 9462 void* pTracerUserData, 9463 void** ppTracerInstanceUserData 9464 ); 9465 9466 /////////////////////////////////////////////////////////////////////////////// 9467 /// @brief Callback function parameters for zeEventQueryKernelTimestamp 9468 /// @details Each entry is a pointer to the parameter passed to the function; 9469 /// allowing the callback the ability to modify the parameter's value 9470 typedef struct _ze_event_query_kernel_timestamp_params_t 9471 { 9472 ze_event_handle_t* phEvent; 9473 ze_kernel_timestamp_result_t** pdstptr; 9474 } ze_event_query_kernel_timestamp_params_t; 9475 9476 /////////////////////////////////////////////////////////////////////////////// 9477 /// @brief Callback function-pointer for zeEventQueryKernelTimestamp 9478 /// @param[in] params Parameters passed to this instance 9479 /// @param[in] result Return value 9480 /// @param[in] pTracerUserData Per-Tracer user data 9481 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9482 typedef void (ZE_APICALL *ze_pfnEventQueryKernelTimestampCb_t)( 9483 ze_event_query_kernel_timestamp_params_t* params, 9484 ze_result_t result, 9485 void* pTracerUserData, 9486 void** ppTracerInstanceUserData 9487 ); 9488 9489 /////////////////////////////////////////////////////////////////////////////// 9490 /// @brief Table of Event callback functions pointers 9491 typedef struct _ze_event_callbacks_t 9492 { 9493 ze_pfnEventCreateCb_t pfnCreateCb; 9494 ze_pfnEventDestroyCb_t pfnDestroyCb; 9495 ze_pfnEventHostSignalCb_t pfnHostSignalCb; 9496 ze_pfnEventHostSynchronizeCb_t pfnHostSynchronizeCb; 9497 ze_pfnEventQueryStatusCb_t pfnQueryStatusCb; 9498 ze_pfnEventHostResetCb_t pfnHostResetCb; 9499 ze_pfnEventQueryKernelTimestampCb_t pfnQueryKernelTimestampCb; 9500 } ze_event_callbacks_t; 9501 9502 /////////////////////////////////////////////////////////////////////////////// 9503 /// @brief Callback function parameters for zeModuleCreate 9504 /// @details Each entry is a pointer to the parameter passed to the function; 9505 /// allowing the callback the ability to modify the parameter's value 9506 typedef struct _ze_module_create_params_t 9507 { 9508 ze_context_handle_t* phContext; 9509 ze_device_handle_t* phDevice; 9510 const ze_module_desc_t** pdesc; 9511 ze_module_handle_t** pphModule; 9512 ze_module_build_log_handle_t** pphBuildLog; 9513 } ze_module_create_params_t; 9514 9515 /////////////////////////////////////////////////////////////////////////////// 9516 /// @brief Callback function-pointer for zeModuleCreate 9517 /// @param[in] params Parameters passed to this instance 9518 /// @param[in] result Return value 9519 /// @param[in] pTracerUserData Per-Tracer user data 9520 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9521 typedef void (ZE_APICALL *ze_pfnModuleCreateCb_t)( 9522 ze_module_create_params_t* params, 9523 ze_result_t result, 9524 void* pTracerUserData, 9525 void** ppTracerInstanceUserData 9526 ); 9527 9528 /////////////////////////////////////////////////////////////////////////////// 9529 /// @brief Callback function parameters for zeModuleDestroy 9530 /// @details Each entry is a pointer to the parameter passed to the function; 9531 /// allowing the callback the ability to modify the parameter's value 9532 typedef struct _ze_module_destroy_params_t 9533 { 9534 ze_module_handle_t* phModule; 9535 } ze_module_destroy_params_t; 9536 9537 /////////////////////////////////////////////////////////////////////////////// 9538 /// @brief Callback function-pointer for zeModuleDestroy 9539 /// @param[in] params Parameters passed to this instance 9540 /// @param[in] result Return value 9541 /// @param[in] pTracerUserData Per-Tracer user data 9542 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9543 typedef void (ZE_APICALL *ze_pfnModuleDestroyCb_t)( 9544 ze_module_destroy_params_t* params, 9545 ze_result_t result, 9546 void* pTracerUserData, 9547 void** ppTracerInstanceUserData 9548 ); 9549 9550 /////////////////////////////////////////////////////////////////////////////// 9551 /// @brief Callback function parameters for zeModuleDynamicLink 9552 /// @details Each entry is a pointer to the parameter passed to the function; 9553 /// allowing the callback the ability to modify the parameter's value 9554 typedef struct _ze_module_dynamic_link_params_t 9555 { 9556 uint32_t* pnumModules; 9557 ze_module_handle_t** pphModules; 9558 ze_module_build_log_handle_t** pphLinkLog; 9559 } ze_module_dynamic_link_params_t; 9560 9561 /////////////////////////////////////////////////////////////////////////////// 9562 /// @brief Callback function-pointer for zeModuleDynamicLink 9563 /// @param[in] params Parameters passed to this instance 9564 /// @param[in] result Return value 9565 /// @param[in] pTracerUserData Per-Tracer user data 9566 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9567 typedef void (ZE_APICALL *ze_pfnModuleDynamicLinkCb_t)( 9568 ze_module_dynamic_link_params_t* params, 9569 ze_result_t result, 9570 void* pTracerUserData, 9571 void** ppTracerInstanceUserData 9572 ); 9573 9574 /////////////////////////////////////////////////////////////////////////////// 9575 /// @brief Callback function parameters for zeModuleGetNativeBinary 9576 /// @details Each entry is a pointer to the parameter passed to the function; 9577 /// allowing the callback the ability to modify the parameter's value 9578 typedef struct _ze_module_get_native_binary_params_t 9579 { 9580 ze_module_handle_t* phModule; 9581 size_t** ppSize; 9582 uint8_t** ppModuleNativeBinary; 9583 } ze_module_get_native_binary_params_t; 9584 9585 /////////////////////////////////////////////////////////////////////////////// 9586 /// @brief Callback function-pointer for zeModuleGetNativeBinary 9587 /// @param[in] params Parameters passed to this instance 9588 /// @param[in] result Return value 9589 /// @param[in] pTracerUserData Per-Tracer user data 9590 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9591 typedef void (ZE_APICALL *ze_pfnModuleGetNativeBinaryCb_t)( 9592 ze_module_get_native_binary_params_t* params, 9593 ze_result_t result, 9594 void* pTracerUserData, 9595 void** ppTracerInstanceUserData 9596 ); 9597 9598 /////////////////////////////////////////////////////////////////////////////// 9599 /// @brief Callback function parameters for zeModuleGetGlobalPointer 9600 /// @details Each entry is a pointer to the parameter passed to the function; 9601 /// allowing the callback the ability to modify the parameter's value 9602 typedef struct _ze_module_get_global_pointer_params_t 9603 { 9604 ze_module_handle_t* phModule; 9605 const char** ppGlobalName; 9606 size_t** ppSize; 9607 void*** ppptr; 9608 } ze_module_get_global_pointer_params_t; 9609 9610 /////////////////////////////////////////////////////////////////////////////// 9611 /// @brief Callback function-pointer for zeModuleGetGlobalPointer 9612 /// @param[in] params Parameters passed to this instance 9613 /// @param[in] result Return value 9614 /// @param[in] pTracerUserData Per-Tracer user data 9615 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9616 typedef void (ZE_APICALL *ze_pfnModuleGetGlobalPointerCb_t)( 9617 ze_module_get_global_pointer_params_t* params, 9618 ze_result_t result, 9619 void* pTracerUserData, 9620 void** ppTracerInstanceUserData 9621 ); 9622 9623 /////////////////////////////////////////////////////////////////////////////// 9624 /// @brief Callback function parameters for zeModuleGetKernelNames 9625 /// @details Each entry is a pointer to the parameter passed to the function; 9626 /// allowing the callback the ability to modify the parameter's value 9627 typedef struct _ze_module_get_kernel_names_params_t 9628 { 9629 ze_module_handle_t* phModule; 9630 uint32_t** ppCount; 9631 const char*** ppNames; 9632 } ze_module_get_kernel_names_params_t; 9633 9634 /////////////////////////////////////////////////////////////////////////////// 9635 /// @brief Callback function-pointer for zeModuleGetKernelNames 9636 /// @param[in] params Parameters passed to this instance 9637 /// @param[in] result Return value 9638 /// @param[in] pTracerUserData Per-Tracer user data 9639 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9640 typedef void (ZE_APICALL *ze_pfnModuleGetKernelNamesCb_t)( 9641 ze_module_get_kernel_names_params_t* params, 9642 ze_result_t result, 9643 void* pTracerUserData, 9644 void** ppTracerInstanceUserData 9645 ); 9646 9647 /////////////////////////////////////////////////////////////////////////////// 9648 /// @brief Callback function parameters for zeModuleGetProperties 9649 /// @details Each entry is a pointer to the parameter passed to the function; 9650 /// allowing the callback the ability to modify the parameter's value 9651 typedef struct _ze_module_get_properties_params_t 9652 { 9653 ze_module_handle_t* phModule; 9654 ze_module_properties_t** ppModuleProperties; 9655 } ze_module_get_properties_params_t; 9656 9657 /////////////////////////////////////////////////////////////////////////////// 9658 /// @brief Callback function-pointer for zeModuleGetProperties 9659 /// @param[in] params Parameters passed to this instance 9660 /// @param[in] result Return value 9661 /// @param[in] pTracerUserData Per-Tracer user data 9662 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9663 typedef void (ZE_APICALL *ze_pfnModuleGetPropertiesCb_t)( 9664 ze_module_get_properties_params_t* params, 9665 ze_result_t result, 9666 void* pTracerUserData, 9667 void** ppTracerInstanceUserData 9668 ); 9669 9670 /////////////////////////////////////////////////////////////////////////////// 9671 /// @brief Callback function parameters for zeModuleGetFunctionPointer 9672 /// @details Each entry is a pointer to the parameter passed to the function; 9673 /// allowing the callback the ability to modify the parameter's value 9674 typedef struct _ze_module_get_function_pointer_params_t 9675 { 9676 ze_module_handle_t* phModule; 9677 const char** ppFunctionName; 9678 void*** ppfnFunction; 9679 } ze_module_get_function_pointer_params_t; 9680 9681 /////////////////////////////////////////////////////////////////////////////// 9682 /// @brief Callback function-pointer for zeModuleGetFunctionPointer 9683 /// @param[in] params Parameters passed to this instance 9684 /// @param[in] result Return value 9685 /// @param[in] pTracerUserData Per-Tracer user data 9686 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9687 typedef void (ZE_APICALL *ze_pfnModuleGetFunctionPointerCb_t)( 9688 ze_module_get_function_pointer_params_t* params, 9689 ze_result_t result, 9690 void* pTracerUserData, 9691 void** ppTracerInstanceUserData 9692 ); 9693 9694 /////////////////////////////////////////////////////////////////////////////// 9695 /// @brief Table of Module callback functions pointers 9696 typedef struct _ze_module_callbacks_t 9697 { 9698 ze_pfnModuleCreateCb_t pfnCreateCb; 9699 ze_pfnModuleDestroyCb_t pfnDestroyCb; 9700 ze_pfnModuleDynamicLinkCb_t pfnDynamicLinkCb; 9701 ze_pfnModuleGetNativeBinaryCb_t pfnGetNativeBinaryCb; 9702 ze_pfnModuleGetGlobalPointerCb_t pfnGetGlobalPointerCb; 9703 ze_pfnModuleGetKernelNamesCb_t pfnGetKernelNamesCb; 9704 ze_pfnModuleGetPropertiesCb_t pfnGetPropertiesCb; 9705 ze_pfnModuleGetFunctionPointerCb_t pfnGetFunctionPointerCb; 9706 } ze_module_callbacks_t; 9707 9708 /////////////////////////////////////////////////////////////////////////////// 9709 /// @brief Callback function parameters for zeModuleBuildLogDestroy 9710 /// @details Each entry is a pointer to the parameter passed to the function; 9711 /// allowing the callback the ability to modify the parameter's value 9712 typedef struct _ze_module_build_log_destroy_params_t 9713 { 9714 ze_module_build_log_handle_t* phModuleBuildLog; 9715 } ze_module_build_log_destroy_params_t; 9716 9717 /////////////////////////////////////////////////////////////////////////////// 9718 /// @brief Callback function-pointer for zeModuleBuildLogDestroy 9719 /// @param[in] params Parameters passed to this instance 9720 /// @param[in] result Return value 9721 /// @param[in] pTracerUserData Per-Tracer user data 9722 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9723 typedef void (ZE_APICALL *ze_pfnModuleBuildLogDestroyCb_t)( 9724 ze_module_build_log_destroy_params_t* params, 9725 ze_result_t result, 9726 void* pTracerUserData, 9727 void** ppTracerInstanceUserData 9728 ); 9729 9730 /////////////////////////////////////////////////////////////////////////////// 9731 /// @brief Callback function parameters for zeModuleBuildLogGetString 9732 /// @details Each entry is a pointer to the parameter passed to the function; 9733 /// allowing the callback the ability to modify the parameter's value 9734 typedef struct _ze_module_build_log_get_string_params_t 9735 { 9736 ze_module_build_log_handle_t* phModuleBuildLog; 9737 size_t** ppSize; 9738 char** ppBuildLog; 9739 } ze_module_build_log_get_string_params_t; 9740 9741 /////////////////////////////////////////////////////////////////////////////// 9742 /// @brief Callback function-pointer for zeModuleBuildLogGetString 9743 /// @param[in] params Parameters passed to this instance 9744 /// @param[in] result Return value 9745 /// @param[in] pTracerUserData Per-Tracer user data 9746 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9747 typedef void (ZE_APICALL *ze_pfnModuleBuildLogGetStringCb_t)( 9748 ze_module_build_log_get_string_params_t* params, 9749 ze_result_t result, 9750 void* pTracerUserData, 9751 void** ppTracerInstanceUserData 9752 ); 9753 9754 /////////////////////////////////////////////////////////////////////////////// 9755 /// @brief Table of ModuleBuildLog callback functions pointers 9756 typedef struct _ze_module_build_log_callbacks_t 9757 { 9758 ze_pfnModuleBuildLogDestroyCb_t pfnDestroyCb; 9759 ze_pfnModuleBuildLogGetStringCb_t pfnGetStringCb; 9760 } ze_module_build_log_callbacks_t; 9761 9762 /////////////////////////////////////////////////////////////////////////////// 9763 /// @brief Callback function parameters for zeKernelCreate 9764 /// @details Each entry is a pointer to the parameter passed to the function; 9765 /// allowing the callback the ability to modify the parameter's value 9766 typedef struct _ze_kernel_create_params_t 9767 { 9768 ze_module_handle_t* phModule; 9769 const ze_kernel_desc_t** pdesc; 9770 ze_kernel_handle_t** pphKernel; 9771 } ze_kernel_create_params_t; 9772 9773 /////////////////////////////////////////////////////////////////////////////// 9774 /// @brief Callback function-pointer for zeKernelCreate 9775 /// @param[in] params Parameters passed to this instance 9776 /// @param[in] result Return value 9777 /// @param[in] pTracerUserData Per-Tracer user data 9778 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9779 typedef void (ZE_APICALL *ze_pfnKernelCreateCb_t)( 9780 ze_kernel_create_params_t* params, 9781 ze_result_t result, 9782 void* pTracerUserData, 9783 void** ppTracerInstanceUserData 9784 ); 9785 9786 /////////////////////////////////////////////////////////////////////////////// 9787 /// @brief Callback function parameters for zeKernelDestroy 9788 /// @details Each entry is a pointer to the parameter passed to the function; 9789 /// allowing the callback the ability to modify the parameter's value 9790 typedef struct _ze_kernel_destroy_params_t 9791 { 9792 ze_kernel_handle_t* phKernel; 9793 } ze_kernel_destroy_params_t; 9794 9795 /////////////////////////////////////////////////////////////////////////////// 9796 /// @brief Callback function-pointer for zeKernelDestroy 9797 /// @param[in] params Parameters passed to this instance 9798 /// @param[in] result Return value 9799 /// @param[in] pTracerUserData Per-Tracer user data 9800 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9801 typedef void (ZE_APICALL *ze_pfnKernelDestroyCb_t)( 9802 ze_kernel_destroy_params_t* params, 9803 ze_result_t result, 9804 void* pTracerUserData, 9805 void** ppTracerInstanceUserData 9806 ); 9807 9808 /////////////////////////////////////////////////////////////////////////////// 9809 /// @brief Callback function parameters for zeKernelSetCacheConfig 9810 /// @details Each entry is a pointer to the parameter passed to the function; 9811 /// allowing the callback the ability to modify the parameter's value 9812 typedef struct _ze_kernel_set_cache_config_params_t 9813 { 9814 ze_kernel_handle_t* phKernel; 9815 ze_cache_config_flags_t* pflags; 9816 } ze_kernel_set_cache_config_params_t; 9817 9818 /////////////////////////////////////////////////////////////////////////////// 9819 /// @brief Callback function-pointer for zeKernelSetCacheConfig 9820 /// @param[in] params Parameters passed to this instance 9821 /// @param[in] result Return value 9822 /// @param[in] pTracerUserData Per-Tracer user data 9823 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9824 typedef void (ZE_APICALL *ze_pfnKernelSetCacheConfigCb_t)( 9825 ze_kernel_set_cache_config_params_t* params, 9826 ze_result_t result, 9827 void* pTracerUserData, 9828 void** ppTracerInstanceUserData 9829 ); 9830 9831 /////////////////////////////////////////////////////////////////////////////// 9832 /// @brief Callback function parameters for zeKernelSetGroupSize 9833 /// @details Each entry is a pointer to the parameter passed to the function; 9834 /// allowing the callback the ability to modify the parameter's value 9835 typedef struct _ze_kernel_set_group_size_params_t 9836 { 9837 ze_kernel_handle_t* phKernel; 9838 uint32_t* pgroupSizeX; 9839 uint32_t* pgroupSizeY; 9840 uint32_t* pgroupSizeZ; 9841 } ze_kernel_set_group_size_params_t; 9842 9843 /////////////////////////////////////////////////////////////////////////////// 9844 /// @brief Callback function-pointer for zeKernelSetGroupSize 9845 /// @param[in] params Parameters passed to this instance 9846 /// @param[in] result Return value 9847 /// @param[in] pTracerUserData Per-Tracer user data 9848 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9849 typedef void (ZE_APICALL *ze_pfnKernelSetGroupSizeCb_t)( 9850 ze_kernel_set_group_size_params_t* params, 9851 ze_result_t result, 9852 void* pTracerUserData, 9853 void** ppTracerInstanceUserData 9854 ); 9855 9856 /////////////////////////////////////////////////////////////////////////////// 9857 /// @brief Callback function parameters for zeKernelSuggestGroupSize 9858 /// @details Each entry is a pointer to the parameter passed to the function; 9859 /// allowing the callback the ability to modify the parameter's value 9860 typedef struct _ze_kernel_suggest_group_size_params_t 9861 { 9862 ze_kernel_handle_t* phKernel; 9863 uint32_t* pglobalSizeX; 9864 uint32_t* pglobalSizeY; 9865 uint32_t* pglobalSizeZ; 9866 uint32_t** pgroupSizeX; 9867 uint32_t** pgroupSizeY; 9868 uint32_t** pgroupSizeZ; 9869 } ze_kernel_suggest_group_size_params_t; 9870 9871 /////////////////////////////////////////////////////////////////////////////// 9872 /// @brief Callback function-pointer for zeKernelSuggestGroupSize 9873 /// @param[in] params Parameters passed to this instance 9874 /// @param[in] result Return value 9875 /// @param[in] pTracerUserData Per-Tracer user data 9876 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9877 typedef void (ZE_APICALL *ze_pfnKernelSuggestGroupSizeCb_t)( 9878 ze_kernel_suggest_group_size_params_t* params, 9879 ze_result_t result, 9880 void* pTracerUserData, 9881 void** ppTracerInstanceUserData 9882 ); 9883 9884 /////////////////////////////////////////////////////////////////////////////// 9885 /// @brief Callback function parameters for zeKernelSuggestMaxCooperativeGroupCount 9886 /// @details Each entry is a pointer to the parameter passed to the function; 9887 /// allowing the callback the ability to modify the parameter's value 9888 typedef struct _ze_kernel_suggest_max_cooperative_group_count_params_t 9889 { 9890 ze_kernel_handle_t* phKernel; 9891 uint32_t** ptotalGroupCount; 9892 } ze_kernel_suggest_max_cooperative_group_count_params_t; 9893 9894 /////////////////////////////////////////////////////////////////////////////// 9895 /// @brief Callback function-pointer for zeKernelSuggestMaxCooperativeGroupCount 9896 /// @param[in] params Parameters passed to this instance 9897 /// @param[in] result Return value 9898 /// @param[in] pTracerUserData Per-Tracer user data 9899 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9900 typedef void (ZE_APICALL *ze_pfnKernelSuggestMaxCooperativeGroupCountCb_t)( 9901 ze_kernel_suggest_max_cooperative_group_count_params_t* params, 9902 ze_result_t result, 9903 void* pTracerUserData, 9904 void** ppTracerInstanceUserData 9905 ); 9906 9907 /////////////////////////////////////////////////////////////////////////////// 9908 /// @brief Callback function parameters for zeKernelSetArgumentValue 9909 /// @details Each entry is a pointer to the parameter passed to the function; 9910 /// allowing the callback the ability to modify the parameter's value 9911 typedef struct _ze_kernel_set_argument_value_params_t 9912 { 9913 ze_kernel_handle_t* phKernel; 9914 uint32_t* pargIndex; 9915 size_t* pargSize; 9916 const void** ppArgValue; 9917 } ze_kernel_set_argument_value_params_t; 9918 9919 /////////////////////////////////////////////////////////////////////////////// 9920 /// @brief Callback function-pointer for zeKernelSetArgumentValue 9921 /// @param[in] params Parameters passed to this instance 9922 /// @param[in] result Return value 9923 /// @param[in] pTracerUserData Per-Tracer user data 9924 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9925 typedef void (ZE_APICALL *ze_pfnKernelSetArgumentValueCb_t)( 9926 ze_kernel_set_argument_value_params_t* params, 9927 ze_result_t result, 9928 void* pTracerUserData, 9929 void** ppTracerInstanceUserData 9930 ); 9931 9932 /////////////////////////////////////////////////////////////////////////////// 9933 /// @brief Callback function parameters for zeKernelSetIndirectAccess 9934 /// @details Each entry is a pointer to the parameter passed to the function; 9935 /// allowing the callback the ability to modify the parameter's value 9936 typedef struct _ze_kernel_set_indirect_access_params_t 9937 { 9938 ze_kernel_handle_t* phKernel; 9939 ze_kernel_indirect_access_flags_t* pflags; 9940 } ze_kernel_set_indirect_access_params_t; 9941 9942 /////////////////////////////////////////////////////////////////////////////// 9943 /// @brief Callback function-pointer for zeKernelSetIndirectAccess 9944 /// @param[in] params Parameters passed to this instance 9945 /// @param[in] result Return value 9946 /// @param[in] pTracerUserData Per-Tracer user data 9947 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9948 typedef void (ZE_APICALL *ze_pfnKernelSetIndirectAccessCb_t)( 9949 ze_kernel_set_indirect_access_params_t* params, 9950 ze_result_t result, 9951 void* pTracerUserData, 9952 void** ppTracerInstanceUserData 9953 ); 9954 9955 /////////////////////////////////////////////////////////////////////////////// 9956 /// @brief Callback function parameters for zeKernelGetIndirectAccess 9957 /// @details Each entry is a pointer to the parameter passed to the function; 9958 /// allowing the callback the ability to modify the parameter's value 9959 typedef struct _ze_kernel_get_indirect_access_params_t 9960 { 9961 ze_kernel_handle_t* phKernel; 9962 ze_kernel_indirect_access_flags_t** ppFlags; 9963 } ze_kernel_get_indirect_access_params_t; 9964 9965 /////////////////////////////////////////////////////////////////////////////// 9966 /// @brief Callback function-pointer for zeKernelGetIndirectAccess 9967 /// @param[in] params Parameters passed to this instance 9968 /// @param[in] result Return value 9969 /// @param[in] pTracerUserData Per-Tracer user data 9970 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9971 typedef void (ZE_APICALL *ze_pfnKernelGetIndirectAccessCb_t)( 9972 ze_kernel_get_indirect_access_params_t* params, 9973 ze_result_t result, 9974 void* pTracerUserData, 9975 void** ppTracerInstanceUserData 9976 ); 9977 9978 /////////////////////////////////////////////////////////////////////////////// 9979 /// @brief Callback function parameters for zeKernelGetSourceAttributes 9980 /// @details Each entry is a pointer to the parameter passed to the function; 9981 /// allowing the callback the ability to modify the parameter's value 9982 typedef struct _ze_kernel_get_source_attributes_params_t 9983 { 9984 ze_kernel_handle_t* phKernel; 9985 uint32_t** ppSize; 9986 char*** ppString; 9987 } ze_kernel_get_source_attributes_params_t; 9988 9989 /////////////////////////////////////////////////////////////////////////////// 9990 /// @brief Callback function-pointer for zeKernelGetSourceAttributes 9991 /// @param[in] params Parameters passed to this instance 9992 /// @param[in] result Return value 9993 /// @param[in] pTracerUserData Per-Tracer user data 9994 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 9995 typedef void (ZE_APICALL *ze_pfnKernelGetSourceAttributesCb_t)( 9996 ze_kernel_get_source_attributes_params_t* params, 9997 ze_result_t result, 9998 void* pTracerUserData, 9999 void** ppTracerInstanceUserData 10000 ); 10001 10002 /////////////////////////////////////////////////////////////////////////////// 10003 /// @brief Callback function parameters for zeKernelGetProperties 10004 /// @details Each entry is a pointer to the parameter passed to the function; 10005 /// allowing the callback the ability to modify the parameter's value 10006 typedef struct _ze_kernel_get_properties_params_t 10007 { 10008 ze_kernel_handle_t* phKernel; 10009 ze_kernel_properties_t** ppKernelProperties; 10010 } ze_kernel_get_properties_params_t; 10011 10012 /////////////////////////////////////////////////////////////////////////////// 10013 /// @brief Callback function-pointer for zeKernelGetProperties 10014 /// @param[in] params Parameters passed to this instance 10015 /// @param[in] result Return value 10016 /// @param[in] pTracerUserData Per-Tracer user data 10017 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10018 typedef void (ZE_APICALL *ze_pfnKernelGetPropertiesCb_t)( 10019 ze_kernel_get_properties_params_t* params, 10020 ze_result_t result, 10021 void* pTracerUserData, 10022 void** ppTracerInstanceUserData 10023 ); 10024 10025 /////////////////////////////////////////////////////////////////////////////// 10026 /// @brief Callback function parameters for zeKernelGetName 10027 /// @details Each entry is a pointer to the parameter passed to the function; 10028 /// allowing the callback the ability to modify the parameter's value 10029 typedef struct _ze_kernel_get_name_params_t 10030 { 10031 ze_kernel_handle_t* phKernel; 10032 size_t** ppSize; 10033 char** ppName; 10034 } ze_kernel_get_name_params_t; 10035 10036 /////////////////////////////////////////////////////////////////////////////// 10037 /// @brief Callback function-pointer for zeKernelGetName 10038 /// @param[in] params Parameters passed to this instance 10039 /// @param[in] result Return value 10040 /// @param[in] pTracerUserData Per-Tracer user data 10041 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10042 typedef void (ZE_APICALL *ze_pfnKernelGetNameCb_t)( 10043 ze_kernel_get_name_params_t* params, 10044 ze_result_t result, 10045 void* pTracerUserData, 10046 void** ppTracerInstanceUserData 10047 ); 10048 10049 /////////////////////////////////////////////////////////////////////////////// 10050 /// @brief Table of Kernel callback functions pointers 10051 typedef struct _ze_kernel_callbacks_t 10052 { 10053 ze_pfnKernelCreateCb_t pfnCreateCb; 10054 ze_pfnKernelDestroyCb_t pfnDestroyCb; 10055 ze_pfnKernelSetCacheConfigCb_t pfnSetCacheConfigCb; 10056 ze_pfnKernelSetGroupSizeCb_t pfnSetGroupSizeCb; 10057 ze_pfnKernelSuggestGroupSizeCb_t pfnSuggestGroupSizeCb; 10058 ze_pfnKernelSuggestMaxCooperativeGroupCountCb_t pfnSuggestMaxCooperativeGroupCountCb; 10059 ze_pfnKernelSetArgumentValueCb_t pfnSetArgumentValueCb; 10060 ze_pfnKernelSetIndirectAccessCb_t pfnSetIndirectAccessCb; 10061 ze_pfnKernelGetIndirectAccessCb_t pfnGetIndirectAccessCb; 10062 ze_pfnKernelGetSourceAttributesCb_t pfnGetSourceAttributesCb; 10063 ze_pfnKernelGetPropertiesCb_t pfnGetPropertiesCb; 10064 ze_pfnKernelGetNameCb_t pfnGetNameCb; 10065 } ze_kernel_callbacks_t; 10066 10067 /////////////////////////////////////////////////////////////////////////////// 10068 /// @brief Callback function parameters for zeSamplerCreate 10069 /// @details Each entry is a pointer to the parameter passed to the function; 10070 /// allowing the callback the ability to modify the parameter's value 10071 typedef struct _ze_sampler_create_params_t 10072 { 10073 ze_context_handle_t* phContext; 10074 ze_device_handle_t* phDevice; 10075 const ze_sampler_desc_t** pdesc; 10076 ze_sampler_handle_t** pphSampler; 10077 } ze_sampler_create_params_t; 10078 10079 /////////////////////////////////////////////////////////////////////////////// 10080 /// @brief Callback function-pointer for zeSamplerCreate 10081 /// @param[in] params Parameters passed to this instance 10082 /// @param[in] result Return value 10083 /// @param[in] pTracerUserData Per-Tracer user data 10084 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10085 typedef void (ZE_APICALL *ze_pfnSamplerCreateCb_t)( 10086 ze_sampler_create_params_t* params, 10087 ze_result_t result, 10088 void* pTracerUserData, 10089 void** ppTracerInstanceUserData 10090 ); 10091 10092 /////////////////////////////////////////////////////////////////////////////// 10093 /// @brief Callback function parameters for zeSamplerDestroy 10094 /// @details Each entry is a pointer to the parameter passed to the function; 10095 /// allowing the callback the ability to modify the parameter's value 10096 typedef struct _ze_sampler_destroy_params_t 10097 { 10098 ze_sampler_handle_t* phSampler; 10099 } ze_sampler_destroy_params_t; 10100 10101 /////////////////////////////////////////////////////////////////////////////// 10102 /// @brief Callback function-pointer for zeSamplerDestroy 10103 /// @param[in] params Parameters passed to this instance 10104 /// @param[in] result Return value 10105 /// @param[in] pTracerUserData Per-Tracer user data 10106 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10107 typedef void (ZE_APICALL *ze_pfnSamplerDestroyCb_t)( 10108 ze_sampler_destroy_params_t* params, 10109 ze_result_t result, 10110 void* pTracerUserData, 10111 void** ppTracerInstanceUserData 10112 ); 10113 10114 /////////////////////////////////////////////////////////////////////////////// 10115 /// @brief Table of Sampler callback functions pointers 10116 typedef struct _ze_sampler_callbacks_t 10117 { 10118 ze_pfnSamplerCreateCb_t pfnCreateCb; 10119 ze_pfnSamplerDestroyCb_t pfnDestroyCb; 10120 } ze_sampler_callbacks_t; 10121 10122 /////////////////////////////////////////////////////////////////////////////// 10123 /// @brief Callback function parameters for zePhysicalMemCreate 10124 /// @details Each entry is a pointer to the parameter passed to the function; 10125 /// allowing the callback the ability to modify the parameter's value 10126 typedef struct _ze_physical_mem_create_params_t 10127 { 10128 ze_context_handle_t* phContext; 10129 ze_device_handle_t* phDevice; 10130 ze_physical_mem_desc_t** pdesc; 10131 ze_physical_mem_handle_t** pphPhysicalMemory; 10132 } ze_physical_mem_create_params_t; 10133 10134 /////////////////////////////////////////////////////////////////////////////// 10135 /// @brief Callback function-pointer for zePhysicalMemCreate 10136 /// @param[in] params Parameters passed to this instance 10137 /// @param[in] result Return value 10138 /// @param[in] pTracerUserData Per-Tracer user data 10139 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10140 typedef void (ZE_APICALL *ze_pfnPhysicalMemCreateCb_t)( 10141 ze_physical_mem_create_params_t* params, 10142 ze_result_t result, 10143 void* pTracerUserData, 10144 void** ppTracerInstanceUserData 10145 ); 10146 10147 /////////////////////////////////////////////////////////////////////////////// 10148 /// @brief Callback function parameters for zePhysicalMemDestroy 10149 /// @details Each entry is a pointer to the parameter passed to the function; 10150 /// allowing the callback the ability to modify the parameter's value 10151 typedef struct _ze_physical_mem_destroy_params_t 10152 { 10153 ze_context_handle_t* phContext; 10154 ze_physical_mem_handle_t* phPhysicalMemory; 10155 } ze_physical_mem_destroy_params_t; 10156 10157 /////////////////////////////////////////////////////////////////////////////// 10158 /// @brief Callback function-pointer for zePhysicalMemDestroy 10159 /// @param[in] params Parameters passed to this instance 10160 /// @param[in] result Return value 10161 /// @param[in] pTracerUserData Per-Tracer user data 10162 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10163 typedef void (ZE_APICALL *ze_pfnPhysicalMemDestroyCb_t)( 10164 ze_physical_mem_destroy_params_t* params, 10165 ze_result_t result, 10166 void* pTracerUserData, 10167 void** ppTracerInstanceUserData 10168 ); 10169 10170 /////////////////////////////////////////////////////////////////////////////// 10171 /// @brief Table of PhysicalMem callback functions pointers 10172 typedef struct _ze_physical_mem_callbacks_t 10173 { 10174 ze_pfnPhysicalMemCreateCb_t pfnCreateCb; 10175 ze_pfnPhysicalMemDestroyCb_t pfnDestroyCb; 10176 } ze_physical_mem_callbacks_t; 10177 10178 /////////////////////////////////////////////////////////////////////////////// 10179 /// @brief Callback function parameters for zeMemAllocShared 10180 /// @details Each entry is a pointer to the parameter passed to the function; 10181 /// allowing the callback the ability to modify the parameter's value 10182 typedef struct _ze_mem_alloc_shared_params_t 10183 { 10184 ze_context_handle_t* phContext; 10185 const ze_device_mem_alloc_desc_t** pdevice_desc; 10186 const ze_host_mem_alloc_desc_t** phost_desc; 10187 size_t* psize; 10188 size_t* palignment; 10189 ze_device_handle_t* phDevice; 10190 void*** ppptr; 10191 } ze_mem_alloc_shared_params_t; 10192 10193 /////////////////////////////////////////////////////////////////////////////// 10194 /// @brief Callback function-pointer for zeMemAllocShared 10195 /// @param[in] params Parameters passed to this instance 10196 /// @param[in] result Return value 10197 /// @param[in] pTracerUserData Per-Tracer user data 10198 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10199 typedef void (ZE_APICALL *ze_pfnMemAllocSharedCb_t)( 10200 ze_mem_alloc_shared_params_t* params, 10201 ze_result_t result, 10202 void* pTracerUserData, 10203 void** ppTracerInstanceUserData 10204 ); 10205 10206 /////////////////////////////////////////////////////////////////////////////// 10207 /// @brief Callback function parameters for zeMemAllocDevice 10208 /// @details Each entry is a pointer to the parameter passed to the function; 10209 /// allowing the callback the ability to modify the parameter's value 10210 typedef struct _ze_mem_alloc_device_params_t 10211 { 10212 ze_context_handle_t* phContext; 10213 const ze_device_mem_alloc_desc_t** pdevice_desc; 10214 size_t* psize; 10215 size_t* palignment; 10216 ze_device_handle_t* phDevice; 10217 void*** ppptr; 10218 } ze_mem_alloc_device_params_t; 10219 10220 /////////////////////////////////////////////////////////////////////////////// 10221 /// @brief Callback function-pointer for zeMemAllocDevice 10222 /// @param[in] params Parameters passed to this instance 10223 /// @param[in] result Return value 10224 /// @param[in] pTracerUserData Per-Tracer user data 10225 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10226 typedef void (ZE_APICALL *ze_pfnMemAllocDeviceCb_t)( 10227 ze_mem_alloc_device_params_t* params, 10228 ze_result_t result, 10229 void* pTracerUserData, 10230 void** ppTracerInstanceUserData 10231 ); 10232 10233 /////////////////////////////////////////////////////////////////////////////// 10234 /// @brief Callback function parameters for zeMemAllocHost 10235 /// @details Each entry is a pointer to the parameter passed to the function; 10236 /// allowing the callback the ability to modify the parameter's value 10237 typedef struct _ze_mem_alloc_host_params_t 10238 { 10239 ze_context_handle_t* phContext; 10240 const ze_host_mem_alloc_desc_t** phost_desc; 10241 size_t* psize; 10242 size_t* palignment; 10243 void*** ppptr; 10244 } ze_mem_alloc_host_params_t; 10245 10246 /////////////////////////////////////////////////////////////////////////////// 10247 /// @brief Callback function-pointer for zeMemAllocHost 10248 /// @param[in] params Parameters passed to this instance 10249 /// @param[in] result Return value 10250 /// @param[in] pTracerUserData Per-Tracer user data 10251 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10252 typedef void (ZE_APICALL *ze_pfnMemAllocHostCb_t)( 10253 ze_mem_alloc_host_params_t* params, 10254 ze_result_t result, 10255 void* pTracerUserData, 10256 void** ppTracerInstanceUserData 10257 ); 10258 10259 /////////////////////////////////////////////////////////////////////////////// 10260 /// @brief Callback function parameters for zeMemFree 10261 /// @details Each entry is a pointer to the parameter passed to the function; 10262 /// allowing the callback the ability to modify the parameter's value 10263 typedef struct _ze_mem_free_params_t 10264 { 10265 ze_context_handle_t* phContext; 10266 void** pptr; 10267 } ze_mem_free_params_t; 10268 10269 /////////////////////////////////////////////////////////////////////////////// 10270 /// @brief Callback function-pointer for zeMemFree 10271 /// @param[in] params Parameters passed to this instance 10272 /// @param[in] result Return value 10273 /// @param[in] pTracerUserData Per-Tracer user data 10274 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10275 typedef void (ZE_APICALL *ze_pfnMemFreeCb_t)( 10276 ze_mem_free_params_t* params, 10277 ze_result_t result, 10278 void* pTracerUserData, 10279 void** ppTracerInstanceUserData 10280 ); 10281 10282 /////////////////////////////////////////////////////////////////////////////// 10283 /// @brief Callback function parameters for zeMemGetAllocProperties 10284 /// @details Each entry is a pointer to the parameter passed to the function; 10285 /// allowing the callback the ability to modify the parameter's value 10286 typedef struct _ze_mem_get_alloc_properties_params_t 10287 { 10288 ze_context_handle_t* phContext; 10289 const void** pptr; 10290 ze_memory_allocation_properties_t** ppMemAllocProperties; 10291 ze_device_handle_t** pphDevice; 10292 } ze_mem_get_alloc_properties_params_t; 10293 10294 /////////////////////////////////////////////////////////////////////////////// 10295 /// @brief Callback function-pointer for zeMemGetAllocProperties 10296 /// @param[in] params Parameters passed to this instance 10297 /// @param[in] result Return value 10298 /// @param[in] pTracerUserData Per-Tracer user data 10299 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10300 typedef void (ZE_APICALL *ze_pfnMemGetAllocPropertiesCb_t)( 10301 ze_mem_get_alloc_properties_params_t* params, 10302 ze_result_t result, 10303 void* pTracerUserData, 10304 void** ppTracerInstanceUserData 10305 ); 10306 10307 /////////////////////////////////////////////////////////////////////////////// 10308 /// @brief Callback function parameters for zeMemGetAddressRange 10309 /// @details Each entry is a pointer to the parameter passed to the function; 10310 /// allowing the callback the ability to modify the parameter's value 10311 typedef struct _ze_mem_get_address_range_params_t 10312 { 10313 ze_context_handle_t* phContext; 10314 const void** pptr; 10315 void*** ppBase; 10316 size_t** ppSize; 10317 } ze_mem_get_address_range_params_t; 10318 10319 /////////////////////////////////////////////////////////////////////////////// 10320 /// @brief Callback function-pointer for zeMemGetAddressRange 10321 /// @param[in] params Parameters passed to this instance 10322 /// @param[in] result Return value 10323 /// @param[in] pTracerUserData Per-Tracer user data 10324 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10325 typedef void (ZE_APICALL *ze_pfnMemGetAddressRangeCb_t)( 10326 ze_mem_get_address_range_params_t* params, 10327 ze_result_t result, 10328 void* pTracerUserData, 10329 void** ppTracerInstanceUserData 10330 ); 10331 10332 /////////////////////////////////////////////////////////////////////////////// 10333 /// @brief Callback function parameters for zeMemGetIpcHandle 10334 /// @details Each entry is a pointer to the parameter passed to the function; 10335 /// allowing the callback the ability to modify the parameter's value 10336 typedef struct _ze_mem_get_ipc_handle_params_t 10337 { 10338 ze_context_handle_t* phContext; 10339 const void** pptr; 10340 ze_ipc_mem_handle_t** ppIpcHandle; 10341 } ze_mem_get_ipc_handle_params_t; 10342 10343 /////////////////////////////////////////////////////////////////////////////// 10344 /// @brief Callback function-pointer for zeMemGetIpcHandle 10345 /// @param[in] params Parameters passed to this instance 10346 /// @param[in] result Return value 10347 /// @param[in] pTracerUserData Per-Tracer user data 10348 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10349 typedef void (ZE_APICALL *ze_pfnMemGetIpcHandleCb_t)( 10350 ze_mem_get_ipc_handle_params_t* params, 10351 ze_result_t result, 10352 void* pTracerUserData, 10353 void** ppTracerInstanceUserData 10354 ); 10355 10356 /////////////////////////////////////////////////////////////////////////////// 10357 /// @brief Callback function parameters for zeMemOpenIpcHandle 10358 /// @details Each entry is a pointer to the parameter passed to the function; 10359 /// allowing the callback the ability to modify the parameter's value 10360 typedef struct _ze_mem_open_ipc_handle_params_t 10361 { 10362 ze_context_handle_t* phContext; 10363 ze_device_handle_t* phDevice; 10364 ze_ipc_mem_handle_t* phandle; 10365 ze_ipc_memory_flags_t* pflags; 10366 void*** ppptr; 10367 } ze_mem_open_ipc_handle_params_t; 10368 10369 /////////////////////////////////////////////////////////////////////////////// 10370 /// @brief Callback function-pointer for zeMemOpenIpcHandle 10371 /// @param[in] params Parameters passed to this instance 10372 /// @param[in] result Return value 10373 /// @param[in] pTracerUserData Per-Tracer user data 10374 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10375 typedef void (ZE_APICALL *ze_pfnMemOpenIpcHandleCb_t)( 10376 ze_mem_open_ipc_handle_params_t* params, 10377 ze_result_t result, 10378 void* pTracerUserData, 10379 void** ppTracerInstanceUserData 10380 ); 10381 10382 /////////////////////////////////////////////////////////////////////////////// 10383 /// @brief Callback function parameters for zeMemCloseIpcHandle 10384 /// @details Each entry is a pointer to the parameter passed to the function; 10385 /// allowing the callback the ability to modify the parameter's value 10386 typedef struct _ze_mem_close_ipc_handle_params_t 10387 { 10388 ze_context_handle_t* phContext; 10389 const void** pptr; 10390 } ze_mem_close_ipc_handle_params_t; 10391 10392 /////////////////////////////////////////////////////////////////////////////// 10393 /// @brief Callback function-pointer for zeMemCloseIpcHandle 10394 /// @param[in] params Parameters passed to this instance 10395 /// @param[in] result Return value 10396 /// @param[in] pTracerUserData Per-Tracer user data 10397 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10398 typedef void (ZE_APICALL *ze_pfnMemCloseIpcHandleCb_t)( 10399 ze_mem_close_ipc_handle_params_t* params, 10400 ze_result_t result, 10401 void* pTracerUserData, 10402 void** ppTracerInstanceUserData 10403 ); 10404 10405 /////////////////////////////////////////////////////////////////////////////// 10406 /// @brief Table of Mem callback functions pointers 10407 typedef struct _ze_mem_callbacks_t 10408 { 10409 ze_pfnMemAllocSharedCb_t pfnAllocSharedCb; 10410 ze_pfnMemAllocDeviceCb_t pfnAllocDeviceCb; 10411 ze_pfnMemAllocHostCb_t pfnAllocHostCb; 10412 ze_pfnMemFreeCb_t pfnFreeCb; 10413 ze_pfnMemGetAllocPropertiesCb_t pfnGetAllocPropertiesCb; 10414 ze_pfnMemGetAddressRangeCb_t pfnGetAddressRangeCb; 10415 ze_pfnMemGetIpcHandleCb_t pfnGetIpcHandleCb; 10416 ze_pfnMemOpenIpcHandleCb_t pfnOpenIpcHandleCb; 10417 ze_pfnMemCloseIpcHandleCb_t pfnCloseIpcHandleCb; 10418 } ze_mem_callbacks_t; 10419 10420 /////////////////////////////////////////////////////////////////////////////// 10421 /// @brief Callback function parameters for zeVirtualMemReserve 10422 /// @details Each entry is a pointer to the parameter passed to the function; 10423 /// allowing the callback the ability to modify the parameter's value 10424 typedef struct _ze_virtual_mem_reserve_params_t 10425 { 10426 ze_context_handle_t* phContext; 10427 const void** ppStart; 10428 size_t* psize; 10429 void*** ppptr; 10430 } ze_virtual_mem_reserve_params_t; 10431 10432 /////////////////////////////////////////////////////////////////////////////// 10433 /// @brief Callback function-pointer for zeVirtualMemReserve 10434 /// @param[in] params Parameters passed to this instance 10435 /// @param[in] result Return value 10436 /// @param[in] pTracerUserData Per-Tracer user data 10437 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10438 typedef void (ZE_APICALL *ze_pfnVirtualMemReserveCb_t)( 10439 ze_virtual_mem_reserve_params_t* params, 10440 ze_result_t result, 10441 void* pTracerUserData, 10442 void** ppTracerInstanceUserData 10443 ); 10444 10445 /////////////////////////////////////////////////////////////////////////////// 10446 /// @brief Callback function parameters for zeVirtualMemFree 10447 /// @details Each entry is a pointer to the parameter passed to the function; 10448 /// allowing the callback the ability to modify the parameter's value 10449 typedef struct _ze_virtual_mem_free_params_t 10450 { 10451 ze_context_handle_t* phContext; 10452 const void** pptr; 10453 size_t* psize; 10454 } ze_virtual_mem_free_params_t; 10455 10456 /////////////////////////////////////////////////////////////////////////////// 10457 /// @brief Callback function-pointer for zeVirtualMemFree 10458 /// @param[in] params Parameters passed to this instance 10459 /// @param[in] result Return value 10460 /// @param[in] pTracerUserData Per-Tracer user data 10461 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10462 typedef void (ZE_APICALL *ze_pfnVirtualMemFreeCb_t)( 10463 ze_virtual_mem_free_params_t* params, 10464 ze_result_t result, 10465 void* pTracerUserData, 10466 void** ppTracerInstanceUserData 10467 ); 10468 10469 /////////////////////////////////////////////////////////////////////////////// 10470 /// @brief Callback function parameters for zeVirtualMemQueryPageSize 10471 /// @details Each entry is a pointer to the parameter passed to the function; 10472 /// allowing the callback the ability to modify the parameter's value 10473 typedef struct _ze_virtual_mem_query_page_size_params_t 10474 { 10475 ze_context_handle_t* phContext; 10476 ze_device_handle_t* phDevice; 10477 size_t* psize; 10478 size_t** ppagesize; 10479 } ze_virtual_mem_query_page_size_params_t; 10480 10481 /////////////////////////////////////////////////////////////////////////////// 10482 /// @brief Callback function-pointer for zeVirtualMemQueryPageSize 10483 /// @param[in] params Parameters passed to this instance 10484 /// @param[in] result Return value 10485 /// @param[in] pTracerUserData Per-Tracer user data 10486 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10487 typedef void (ZE_APICALL *ze_pfnVirtualMemQueryPageSizeCb_t)( 10488 ze_virtual_mem_query_page_size_params_t* params, 10489 ze_result_t result, 10490 void* pTracerUserData, 10491 void** ppTracerInstanceUserData 10492 ); 10493 10494 /////////////////////////////////////////////////////////////////////////////// 10495 /// @brief Callback function parameters for zeVirtualMemMap 10496 /// @details Each entry is a pointer to the parameter passed to the function; 10497 /// allowing the callback the ability to modify the parameter's value 10498 typedef struct _ze_virtual_mem_map_params_t 10499 { 10500 ze_context_handle_t* phContext; 10501 const void** pptr; 10502 size_t* psize; 10503 ze_physical_mem_handle_t* phPhysicalMemory; 10504 size_t* poffset; 10505 ze_memory_access_attribute_t* paccess; 10506 } ze_virtual_mem_map_params_t; 10507 10508 /////////////////////////////////////////////////////////////////////////////// 10509 /// @brief Callback function-pointer for zeVirtualMemMap 10510 /// @param[in] params Parameters passed to this instance 10511 /// @param[in] result Return value 10512 /// @param[in] pTracerUserData Per-Tracer user data 10513 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10514 typedef void (ZE_APICALL *ze_pfnVirtualMemMapCb_t)( 10515 ze_virtual_mem_map_params_t* params, 10516 ze_result_t result, 10517 void* pTracerUserData, 10518 void** ppTracerInstanceUserData 10519 ); 10520 10521 /////////////////////////////////////////////////////////////////////////////// 10522 /// @brief Callback function parameters for zeVirtualMemUnmap 10523 /// @details Each entry is a pointer to the parameter passed to the function; 10524 /// allowing the callback the ability to modify the parameter's value 10525 typedef struct _ze_virtual_mem_unmap_params_t 10526 { 10527 ze_context_handle_t* phContext; 10528 const void** pptr; 10529 size_t* psize; 10530 } ze_virtual_mem_unmap_params_t; 10531 10532 /////////////////////////////////////////////////////////////////////////////// 10533 /// @brief Callback function-pointer for zeVirtualMemUnmap 10534 /// @param[in] params Parameters passed to this instance 10535 /// @param[in] result Return value 10536 /// @param[in] pTracerUserData Per-Tracer user data 10537 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10538 typedef void (ZE_APICALL *ze_pfnVirtualMemUnmapCb_t)( 10539 ze_virtual_mem_unmap_params_t* params, 10540 ze_result_t result, 10541 void* pTracerUserData, 10542 void** ppTracerInstanceUserData 10543 ); 10544 10545 /////////////////////////////////////////////////////////////////////////////// 10546 /// @brief Callback function parameters for zeVirtualMemSetAccessAttribute 10547 /// @details Each entry is a pointer to the parameter passed to the function; 10548 /// allowing the callback the ability to modify the parameter's value 10549 typedef struct _ze_virtual_mem_set_access_attribute_params_t 10550 { 10551 ze_context_handle_t* phContext; 10552 const void** pptr; 10553 size_t* psize; 10554 ze_memory_access_attribute_t* paccess; 10555 } ze_virtual_mem_set_access_attribute_params_t; 10556 10557 /////////////////////////////////////////////////////////////////////////////// 10558 /// @brief Callback function-pointer for zeVirtualMemSetAccessAttribute 10559 /// @param[in] params Parameters passed to this instance 10560 /// @param[in] result Return value 10561 /// @param[in] pTracerUserData Per-Tracer user data 10562 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10563 typedef void (ZE_APICALL *ze_pfnVirtualMemSetAccessAttributeCb_t)( 10564 ze_virtual_mem_set_access_attribute_params_t* params, 10565 ze_result_t result, 10566 void* pTracerUserData, 10567 void** ppTracerInstanceUserData 10568 ); 10569 10570 /////////////////////////////////////////////////////////////////////////////// 10571 /// @brief Callback function parameters for zeVirtualMemGetAccessAttribute 10572 /// @details Each entry is a pointer to the parameter passed to the function; 10573 /// allowing the callback the ability to modify the parameter's value 10574 typedef struct _ze_virtual_mem_get_access_attribute_params_t 10575 { 10576 ze_context_handle_t* phContext; 10577 const void** pptr; 10578 size_t* psize; 10579 ze_memory_access_attribute_t** paccess; 10580 size_t** poutSize; 10581 } ze_virtual_mem_get_access_attribute_params_t; 10582 10583 /////////////////////////////////////////////////////////////////////////////// 10584 /// @brief Callback function-pointer for zeVirtualMemGetAccessAttribute 10585 /// @param[in] params Parameters passed to this instance 10586 /// @param[in] result Return value 10587 /// @param[in] pTracerUserData Per-Tracer user data 10588 /// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data 10589 typedef void (ZE_APICALL *ze_pfnVirtualMemGetAccessAttributeCb_t)( 10590 ze_virtual_mem_get_access_attribute_params_t* params, 10591 ze_result_t result, 10592 void* pTracerUserData, 10593 void** ppTracerInstanceUserData 10594 ); 10595 10596 /////////////////////////////////////////////////////////////////////////////// 10597 /// @brief Table of VirtualMem callback functions pointers 10598 typedef struct _ze_virtual_mem_callbacks_t 10599 { 10600 ze_pfnVirtualMemReserveCb_t pfnReserveCb; 10601 ze_pfnVirtualMemFreeCb_t pfnFreeCb; 10602 ze_pfnVirtualMemQueryPageSizeCb_t pfnQueryPageSizeCb; 10603 ze_pfnVirtualMemMapCb_t pfnMapCb; 10604 ze_pfnVirtualMemUnmapCb_t pfnUnmapCb; 10605 ze_pfnVirtualMemSetAccessAttributeCb_t pfnSetAccessAttributeCb; 10606 ze_pfnVirtualMemGetAccessAttributeCb_t pfnGetAccessAttributeCb; 10607 } ze_virtual_mem_callbacks_t; 10608 10609 /////////////////////////////////////////////////////////////////////////////// 10610 /// @brief Container for all callbacks 10611 typedef struct _ze_callbacks_t 10612 { 10613 ze_global_callbacks_t Global; 10614 ze_driver_callbacks_t Driver; 10615 ze_device_callbacks_t Device; 10616 ze_context_callbacks_t Context; 10617 ze_command_queue_callbacks_t CommandQueue; 10618 ze_command_list_callbacks_t CommandList; 10619 ze_fence_callbacks_t Fence; 10620 ze_event_pool_callbacks_t EventPool; 10621 ze_event_callbacks_t Event; 10622 ze_image_callbacks_t Image; 10623 ze_module_callbacks_t Module; 10624 ze_module_build_log_callbacks_t ModuleBuildLog; 10625 ze_kernel_callbacks_t Kernel; 10626 ze_sampler_callbacks_t Sampler; 10627 ze_physical_mem_callbacks_t PhysicalMem; 10628 ze_mem_callbacks_t Mem; 10629 ze_virtual_mem_callbacks_t VirtualMem; 10630 } ze_callbacks_t; 10631 #if !defined(__GNUC__) 10632 #pragma endregion 10633 #endif 10634 10635 #if defined(__cplusplus) 10636 } // extern "C" 10637 #endif 10638 10639 #endif // _ZE_API_H