diff options
-rw-r--r-- | level_zero-sys/Cargo.toml | 2 | ||||
-rw-r--r-- | level_zero-sys/src/lib.rs | 4 | ||||
-rw-r--r-- | level_zero-sys/src/ze_api.rs (renamed from level_zero-sys/src/zex_api.rs) | 4378 | ||||
-rw-r--r-- | level_zero-sys/src/ze_loader.lib | bin | 0 -> 70198 bytes |
4 files changed, 1991 insertions, 2393 deletions
diff --git a/level_zero-sys/Cargo.toml b/level_zero-sys/Cargo.toml index a2e25e1..c88db5d 100644 --- a/level_zero-sys/Cargo.toml +++ b/level_zero-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "level_zero-sys" -version = "0.4.1" +version = "0.91.0" authors = ["Andrzej Janik <[email protected]>"] edition = "2018" links = "ze_loader" diff --git a/level_zero-sys/src/lib.rs b/level_zero-sys/src/lib.rs index b6ed5a9..f7a7feb 100644 --- a/level_zero-sys/src/lib.rs +++ b/level_zero-sys/src/lib.rs @@ -1,3 +1,3 @@ #![allow(warnings)] -pub mod zex_api; -pub use zex_api::*;
\ No newline at end of file +pub mod ze_api; +pub use ze_api::*;
\ No newline at end of file diff --git a/level_zero-sys/src/zex_api.rs b/level_zero-sys/src/ze_api.rs index bcdf079..06c971c 100644 --- a/level_zero-sys/src/zex_api.rs +++ b/level_zero-sys/src/ze_api.rs @@ -1,8 +1,5 @@ /* automatically generated by rust-bindgen */ -pub type __uint8_t = ::std::os::raw::c_uchar; -pub type __uint32_t = ::std::os::raw::c_uint; -pub type __uint64_t = ::std::os::raw::c_ulong; #[doc = ""] #[doc = " @brief compiler-independent type"] pub type ze_bool_t = u8; @@ -134,7 +131,7 @@ fn bindgen_test_layout__ze_ipc_mem_handle_t() { ); } #[doc = ""] -#[doc = " @brief Forward-declare ze_ipc_mem_handle_t"] +#[doc = " @brief IPC handle to a memory allocation"] pub type ze_ipc_mem_handle_t = _ze_ipc_mem_handle_t; #[doc = ""] #[doc = " @brief IPC handle to a event pool allocation"] @@ -170,15 +167,11 @@ fn bindgen_test_layout__ze_ipc_event_pool_handle_t() { ); } #[doc = ""] -#[doc = " @brief Forward-declare ze_ipc_event_pool_handle_t"] +#[doc = " @brief IPC handle to a event pool allocation"] pub type ze_ipc_event_pool_handle_t = _ze_ipc_event_pool_handle_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Defines Return/Error codes"] -#[doc = ""] -#[doc = " @remarks"] -#[doc = " _Analogues_"] -#[doc = " - **CUresult**"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] #[must_use] pub enum _ze_result_t { @@ -257,6 +250,8 @@ pub enum _ze_result_t { #[doc = "< [Core] unknown or internal error"] ZE_RESULT_ERROR_UNKNOWN = 2147483647, } +#[doc = ""] +#[doc = " @brief Defines Return/Error codes"] pub use self::_ze_result_t as ze_result_t; #[doc = ""] #[doc = " @brief Forward-declare ze_driver_uuid_t"] @@ -304,21 +299,6 @@ pub type ze_command_queue_desc_t = _ze_command_queue_desc_t; #[doc = " @brief Forward-declare ze_command_list_desc_t"] pub type ze_command_list_desc_t = _ze_command_list_desc_t; #[doc = ""] -#[doc = " @brief Forward-declare ze_copy_region_t"] -pub type ze_copy_region_t = _ze_copy_region_t; -#[doc = ""] -#[doc = " @brief Forward-declare ze_image_region_t"] -pub type ze_image_region_t = _ze_image_region_t; -#[doc = ""] -#[doc = " @brief Forward-declare ze_event_pool_desc_t"] -pub type ze_event_pool_desc_t = _ze_event_pool_desc_t; -#[doc = ""] -#[doc = " @brief Forward-declare ze_event_desc_t"] -pub type ze_event_desc_t = _ze_event_desc_t; -#[doc = ""] -#[doc = " @brief Forward-declare ze_fence_desc_t"] -pub type ze_fence_desc_t = _ze_fence_desc_t; -#[doc = ""] #[doc = " @brief Forward-declare ze_image_format_desc_t"] pub type ze_image_format_desc_t = _ze_image_format_desc_t; #[doc = ""] @@ -328,15 +308,6 @@ pub type ze_image_desc_t = _ze_image_desc_t; #[doc = " @brief Forward-declare ze_image_properties_t"] pub type ze_image_properties_t = _ze_image_properties_t; #[doc = ""] -#[doc = " @brief Forward-declare ze_device_mem_alloc_desc_t"] -pub type ze_device_mem_alloc_desc_t = _ze_device_mem_alloc_desc_t; -#[doc = ""] -#[doc = " @brief Forward-declare ze_host_mem_alloc_desc_t"] -pub type ze_host_mem_alloc_desc_t = _ze_host_mem_alloc_desc_t; -#[doc = ""] -#[doc = " @brief Forward-declare ze_memory_allocation_properties_t"] -pub type ze_memory_allocation_properties_t = _ze_memory_allocation_properties_t; -#[doc = ""] #[doc = " @brief Forward-declare ze_module_constants_t"] pub type ze_module_constants_t = _ze_module_constants_t; #[doc = ""] @@ -352,9 +323,33 @@ pub type ze_kernel_properties_t = _ze_kernel_properties_t; #[doc = " @brief Forward-declare ze_group_count_t"] pub type ze_group_count_t = _ze_group_count_t; #[doc = ""] +#[doc = " @brief Forward-declare ze_event_pool_desc_t"] +pub type ze_event_pool_desc_t = _ze_event_pool_desc_t; +#[doc = ""] +#[doc = " @brief Forward-declare ze_event_desc_t"] +pub type ze_event_desc_t = _ze_event_desc_t; +#[doc = ""] #[doc = " @brief Forward-declare ze_sampler_desc_t"] pub type ze_sampler_desc_t = _ze_sampler_desc_t; -#[repr(u32)] +#[doc = ""] +#[doc = " @brief Forward-declare ze_device_mem_alloc_desc_t"] +pub type ze_device_mem_alloc_desc_t = _ze_device_mem_alloc_desc_t; +#[doc = ""] +#[doc = " @brief Forward-declare ze_host_mem_alloc_desc_t"] +pub type ze_host_mem_alloc_desc_t = _ze_host_mem_alloc_desc_t; +#[doc = ""] +#[doc = " @brief Forward-declare ze_memory_allocation_properties_t"] +pub type ze_memory_allocation_properties_t = _ze_memory_allocation_properties_t; +#[doc = ""] +#[doc = " @brief Forward-declare ze_fence_desc_t"] +pub type ze_fence_desc_t = _ze_fence_desc_t; +#[doc = ""] +#[doc = " @brief Forward-declare ze_copy_region_t"] +pub type ze_copy_region_t = _ze_copy_region_t; +#[doc = ""] +#[doc = " @brief Forward-declare ze_image_region_t"] +pub type ze_image_region_t = _ze_image_region_t; +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported initialization flags"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -364,6 +359,8 @@ pub enum _ze_init_flag_t { #[doc = "< only initialize GPU drivers"] ZE_INIT_FLAG_GPU_ONLY = 1, } +#[doc = ""] +#[doc = " @brief Supported initialization flags"] pub use self::_ze_init_flag_t as ze_init_flag_t; extern "C" { #[doc = ""] @@ -377,10 +374,6 @@ extern "C" { #[doc = " - This function is thread-safe for scenarios where multiple libraries"] #[doc = " may initialize the driver simultaneously."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuInit**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -413,7 +406,7 @@ extern "C" { #[doc = " + `nullptr == pCount`"] pub fn zeDriverGet(pCount: *mut u32, phDrivers: *mut ze_driver_handle_t) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported API versions"] #[doc = ""] @@ -422,9 +415,15 @@ extern "C" { #[doc = " ::ZE_MAJOR_VERSION and ::ZE_MINOR_VERSION"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_api_version_t { - #[doc = "< 1.0"] - ZE_API_VERSION_1_0 = 65536, + #[doc = "< 0.91"] + ZE_API_VERSION_1_0 = 91, } +#[doc = ""] +#[doc = " @brief Supported API versions"] +#[doc = ""] +#[doc = " @details"] +#[doc = " - API versions contain major and minor attributes, use"] +#[doc = " ::ZE_MAJOR_VERSION and ::ZE_MINOR_VERSION"] pub use self::_ze_api_version_t as ze_api_version_t; extern "C" { #[doc = ""] @@ -434,10 +433,6 @@ extern "C" { #[doc = " - The application may call this function from simultaneous threads."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuCtxGetApiVersion**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -451,14 +446,16 @@ extern "C" { version: *mut ze_api_version_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_driver_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_driver_properties_version_t { - #[doc = "< version 1.0"] - ZE_DRIVER_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_DRIVER_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_driver_properties_t"] pub use self::_ze_driver_properties_version_t as ze_driver_properties_version_t; #[doc = ""] #[doc = " @brief Driver universal unique id (UUID)"] @@ -560,7 +557,6 @@ extern "C" { #[doc = ""] #[doc = " @remarks"] #[doc = " _Analogues_"] - #[doc = " - **cuDriverGetVersion**"] #[doc = " - **clGetPlatformInfo**"] #[doc = ""] #[doc = " @returns"] @@ -576,14 +572,16 @@ extern "C" { pDriverProperties: *mut ze_driver_properties_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_driver_ipc_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_driver_ipc_properties_version_t { - #[doc = "< version 1.0"] - ZE_DRIVER_IPC_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_DRIVER_IPC_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_driver_ipc_properties_t"] pub use self::_ze_driver_ipc_properties_version_t as ze_driver_ipc_properties_version_t; #[doc = ""] #[doc = " @brief IPC properties queried using ::zeDriverGetIPCProperties"] @@ -658,10 +656,6 @@ extern "C" { #[doc = " - The application may call this function from simultaneous threads."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuDeviceGetAttribute**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -710,10 +704,6 @@ extern "C" { #[doc = " - The application may call this function from simultaneous threads."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuDeviceGet**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -754,16 +744,18 @@ extern "C" { phSubdevices: *mut ze_device_handle_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_device_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_device_properties_version_t { - #[doc = "< version 1.0"] - ZE_DEVICE_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_DEVICE_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_device_properties_t"] pub use self::_ze_device_properties_version_t as ze_device_properties_version_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported device types"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -773,6 +765,8 @@ pub enum _ze_device_type_t { #[doc = "< Field Programmable Gate Array"] ZE_DEVICE_TYPE_FPGA = 2, } +#[doc = ""] +#[doc = " @brief Supported device types"] pub use self::_ze_device_type_t as ze_device_type_t; #[doc = ""] #[doc = " @brief Device universal unique id (UUID)"] @@ -849,11 +843,10 @@ pub struct _ze_device_properties_t { pub numEUsPerSubslice: u32, #[doc = "< [out] Number of sub-slices per slice."] pub numSubslicesPerSlice: u32, - #[doc = "< [out] Number of slices per tile."] - pub numSlicesPerTile: u32, - #[doc = "< [out] Number of tiles."] - pub numTiles: u32, - #[doc = "< [out] Returns the resolution of device timer in nanoseconds."] + #[doc = "< [out] Number of slices."] + pub numSlices: u32, + #[doc = "< [out] Returns the resolution of device timer in nanoseconds used for"] + #[doc = "< profiling, timestamps, etc."] pub timerResolution: u64, #[doc = "< [out] Device name"] pub name: [::std::os::raw::c_char; 256usize], @@ -1104,27 +1097,14 @@ fn bindgen_test_layout__ze_device_properties_t() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<_ze_device_properties_t>())).numSlicesPerTile as *const _ - as usize + &(*(::std::ptr::null::<_ze_device_properties_t>())).numSlices as *const _ as usize }, 80usize, concat!( "Offset of field: ", stringify!(_ze_device_properties_t), "::", - stringify!(numSlicesPerTile) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_ze_device_properties_t>())).numTiles as *const _ as usize - }, - 84usize, - concat!( - "Offset of field: ", - stringify!(_ze_device_properties_t), - "::", - stringify!(numTiles) + stringify!(numSlices) ) ); assert_eq!( @@ -1160,8 +1140,6 @@ extern "C" { #[doc = ""] #[doc = " @remarks"] #[doc = " _Analogues_"] - #[doc = " - **cuDeviceGetAttribute**"] - #[doc = " - cuDeviceGetName"] #[doc = " - clGetDeviceInfo"] #[doc = ""] #[doc = " @returns"] @@ -1177,14 +1155,16 @@ extern "C" { pDeviceProperties: *mut ze_device_properties_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_device_compute_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_device_compute_properties_version_t { - #[doc = "< version 1.0"] - ZE_DEVICE_COMPUTE_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_DEVICE_COMPUTE_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_device_compute_properties_t"] pub use self::_ze_device_compute_properties_version_t as ze_device_compute_properties_version_t; #[doc = ""] #[doc = " @brief Device compute properties queried using ::zeDeviceGetComputeProperties"] @@ -1381,7 +1361,6 @@ extern "C" { #[doc = ""] #[doc = " @remarks"] #[doc = " _Analogues_"] - #[doc = " - **cuDeviceGetAttribute**"] #[doc = " - clGetDeviceInfo"] #[doc = ""] #[doc = " @returns"] @@ -1397,14 +1376,16 @@ extern "C" { pComputeProperties: *mut ze_device_compute_properties_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_device_kernel_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_device_kernel_properties_version_t { - #[doc = "< version 1.0"] - ZE_DEVICE_KERNEL_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_DEVICE_KERNEL_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_device_kernel_properties_t"] pub use self::_ze_device_kernel_properties_version_t as ze_device_kernel_properties_version_t; #[doc = ""] #[doc = " @brief Native kernel universal unique id (UUID)"] @@ -1437,14 +1418,14 @@ fn bindgen_test_layout__ze_native_kernel_uuid_t() { ) ); } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Floating Point capabilities"] #[doc = ""] #[doc = " @details"] #[doc = " - floating-point capabilities of the device."] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_floating_point_capabilities_t { +pub enum _ze_fp_capabilities_t { #[doc = "< None"] ZE_FP_CAPS_NONE = 0, #[doc = "< Supports denorms"] @@ -1465,7 +1446,12 @@ pub enum _ze_floating_point_capabilities_t { #[doc = "< Uses software implementation for basic floating-point operations."] ZE_FP_CAPS_SOFT_FLOAT = 128, } -pub use self::_ze_floating_point_capabilities_t as ze_floating_point_capabilities_t; +#[doc = ""] +#[doc = " @brief Floating Point capabilities"] +#[doc = ""] +#[doc = " @details"] +#[doc = " - floating-point capabilities of the device."] +pub use self::_ze_fp_capabilities_t as ze_fp_capabilities_t; #[doc = ""] #[doc = " @brief Device properties queried using ::zeDeviceGetKernelProperties"] #[repr(C)] @@ -1492,10 +1478,12 @@ pub struct _ze_device_kernel_properties_t { pub int64AtomicsSupported: ze_bool_t, #[doc = "< [out] Supports four component dot product and accumulate operations"] pub dp4aSupported: ze_bool_t, + #[doc = "< [out] Capabilities for half-precision floating-point operations."] + pub halfFpCapabilities: ze_fp_capabilities_t, #[doc = "< [out] Capabilities for single-precision floating-point operations."] - pub singleFpCapabilities: ze_floating_point_capabilities_t, + pub singleFpCapabilities: ze_fp_capabilities_t, #[doc = "< [out] Capabilities for double-precision floating-point operations."] - pub doubleFpCapabilities: ze_floating_point_capabilities_t, + pub doubleFpCapabilities: ze_fp_capabilities_t, #[doc = "< [out] Maximum kernel argument size that is supported."] pub maxArgumentsSize: u32, #[doc = "< [out] Maximum size of internal buffer that holds output of printf"] @@ -1506,7 +1494,7 @@ pub struct _ze_device_kernel_properties_t { fn bindgen_test_layout__ze_device_kernel_properties_t() { assert_eq!( ::std::mem::size_of::<_ze_device_kernel_properties_t>(), - 44usize, + 48usize, concat!("Size of: ", stringify!(_ze_device_kernel_properties_t)) ); assert_eq!( @@ -1606,7 +1594,7 @@ fn bindgen_test_layout__ze_device_kernel_properties_t() { ); assert_eq!( unsafe { - &(*(::std::ptr::null::<_ze_device_kernel_properties_t>())).singleFpCapabilities + &(*(::std::ptr::null::<_ze_device_kernel_properties_t>())).halfFpCapabilities as *const _ as usize }, 28usize, @@ -1614,6 +1602,19 @@ fn bindgen_test_layout__ze_device_kernel_properties_t() { "Offset of field: ", stringify!(_ze_device_kernel_properties_t), "::", + stringify!(halfFpCapabilities) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_ze_device_kernel_properties_t>())).singleFpCapabilities + as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_ze_device_kernel_properties_t), + "::", stringify!(singleFpCapabilities) ) ); @@ -1622,7 +1623,7 @@ fn bindgen_test_layout__ze_device_kernel_properties_t() { &(*(::std::ptr::null::<_ze_device_kernel_properties_t>())).doubleFpCapabilities as *const _ as usize }, - 32usize, + 36usize, concat!( "Offset of field: ", stringify!(_ze_device_kernel_properties_t), @@ -1635,7 +1636,7 @@ fn bindgen_test_layout__ze_device_kernel_properties_t() { &(*(::std::ptr::null::<_ze_device_kernel_properties_t>())).maxArgumentsSize as *const _ as usize }, - 36usize, + 40usize, concat!( "Offset of field: ", stringify!(_ze_device_kernel_properties_t), @@ -1648,7 +1649,7 @@ fn bindgen_test_layout__ze_device_kernel_properties_t() { &(*(::std::ptr::null::<_ze_device_kernel_properties_t>())).printfBufferSize as *const _ as usize }, - 40usize, + 44usize, concat!( "Offset of field: ", stringify!(_ze_device_kernel_properties_t), @@ -1678,14 +1679,16 @@ extern "C" { pKernelProperties: *mut ze_device_kernel_properties_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_device_memory_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_device_memory_properties_version_t { - #[doc = "< version 1.0"] - ZE_DEVICE_MEMORY_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_DEVICE_MEMORY_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_device_memory_properties_t"] pub use self::_ze_device_memory_properties_version_t as ze_device_memory_properties_version_t; #[doc = ""] #[doc = " @brief Device local memory properties queried using"] @@ -1778,8 +1781,6 @@ extern "C" { #[doc = ""] #[doc = " @remarks"] #[doc = " _Analogues_"] - #[doc = " - **cuDeviceGetAttribute**"] - #[doc = " - cuDeviceTotalMem"] #[doc = " - clGetDeviceInfo"] #[doc = ""] #[doc = " @returns"] @@ -1796,16 +1797,18 @@ extern "C" { pMemProperties: *mut ze_device_memory_properties_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_device_memory_access_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_device_memory_access_properties_version_t { - #[doc = "< version 1.0"] - ZE_DEVICE_MEMORY_ACCESS_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_DEVICE_MEMORY_ACCESS_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_device_memory_access_properties_t"] pub use self::_ze_device_memory_access_properties_version_t as ze_device_memory_access_properties_version_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Memory access capabilities"] #[doc = ""] @@ -1825,6 +1828,12 @@ pub enum _ze_memory_access_capabilities_t { #[doc = "< Supports concurrent atomic access"] ZE_MEMORY_CONCURRENT_ATOMIC_ACCESS = 8, } +#[doc = ""] +#[doc = " @brief Memory access capabilities"] +#[doc = ""] +#[doc = " @details"] +#[doc = " - Supported access capabilities for different types of memory"] +#[doc = " allocations"] pub use self::_ze_memory_access_capabilities_t as ze_memory_access_capabilities_t; #[doc = ""] #[doc = " @brief Device memory access properties queried using"] @@ -1952,8 +1961,6 @@ extern "C" { #[doc = ""] #[doc = " @remarks"] #[doc = " _Analogues_"] - #[doc = " - **cuDeviceGetAttribute**"] - #[doc = " - cuDeviceTotalMem"] #[doc = " - clGetDeviceInfo"] #[doc = ""] #[doc = " @returns"] @@ -1969,14 +1976,16 @@ extern "C" { pMemAccessProperties: *mut ze_device_memory_access_properties_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_device_cache_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_device_cache_properties_version_t { - #[doc = "< version 1.0"] - ZE_DEVICE_CACHE_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_DEVICE_CACHE_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_device_cache_properties_t"] pub use self::_ze_device_cache_properties_version_t as ze_device_cache_properties_version_t; #[doc = ""] #[doc = " @brief Device cache properties queried using ::zeDeviceGetCacheProperties"] @@ -2113,8 +2122,6 @@ extern "C" { #[doc = ""] #[doc = " @remarks"] #[doc = " _Analogues_"] - #[doc = " - **cuDeviceGetAttribute**"] - #[doc = " - cuDeviceTotalMem"] #[doc = " - clGetDeviceInfo"] #[doc = ""] #[doc = " @returns"] @@ -2130,14 +2137,16 @@ extern "C" { pCacheProperties: *mut ze_device_cache_properties_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_device_image_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_device_image_properties_version_t { - #[doc = "< version 1.0"] - ZE_DEVICE_IMAGE_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_DEVICE_IMAGE_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_device_image_properties_t"] pub use self::_ze_device_image_properties_version_t as ze_device_image_properties_version_t; #[doc = ""] #[doc = " @brief Device image properties queried using ::zeDeviceGetComputeProperties"] @@ -2318,10 +2327,6 @@ extern "C" { #[doc = " - The application may call this function from simultaneous threads."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuDeviceGetAttribute**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -2335,14 +2340,16 @@ extern "C" { pImageProperties: *mut ze_device_image_properties_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_device_p2p_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_device_p2p_properties_version_t { - #[doc = "< version 1.0"] - ZE_DEVICE_P2P_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_DEVICE_P2P_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_device_p2p_properties_t"] pub use self::_ze_device_p2p_properties_version_t as ze_device_p2p_properties_version_t; #[doc = ""] #[doc = " @brief Device properties queried using ::zeDeviceGetP2PProperties"] @@ -2416,10 +2423,6 @@ extern "C" { #[doc = " - The application may call this function from simultaneous threads."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cudaDeviceGetP2PAttribute**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -2457,10 +2460,6 @@ extern "C" { #[doc = " - The application may call this function from simultaneous threads."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cudaDeviceCanAccessPeer**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -2476,7 +2475,7 @@ extern "C" { value: *mut ze_bool_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported Cache Config"] #[doc = ""] @@ -2491,6 +2490,11 @@ pub enum _ze_cache_config_t { #[doc = "< Large General Data size"] ZE_CACHE_CONFIG_LARGE_DATA = 4, } +#[doc = ""] +#[doc = " @brief Supported Cache Config"] +#[doc = ""] +#[doc = " @details"] +#[doc = " - Supported Cache Config (Default, Large SLM, Large Data Cache)"] pub use self::_ze_cache_config_t as ze_cache_config_t; extern "C" { #[doc = ""] @@ -2500,10 +2504,6 @@ extern "C" { #[doc = " - The application may **not** call this function from simultaneous"] #[doc = " threads with the same device handle."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cudaFuncSetCacheConfig **"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -2518,28 +2518,30 @@ extern "C" { CacheConfig: ze_cache_config_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_command_queue_desc_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_command_queue_desc_version_t { - #[doc = "< version 1.0"] - ZE_COMMAND_QUEUE_DESC_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_COMMAND_QUEUE_DESC_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_command_queue_desc_t"] pub use self::_ze_command_queue_desc_version_t as ze_command_queue_desc_version_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported command queue flags"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_command_queue_flag_t { #[doc = "< default behavior"] ZE_COMMAND_QUEUE_FLAG_NONE = 0, - #[doc = "< command queue only supports enqueing copy-only command lists"] + #[doc = "< command queue only supports enqueuing copy-only command lists"] ZE_COMMAND_QUEUE_FLAG_COPY_ONLY = 1, #[doc = "< command queue is not tied to a physical command queue; driver may"] #[doc = "< dynamically assign based on usage"] ZE_COMMAND_QUEUE_FLAG_LOGICAL_ONLY = 2, - #[doc = "< command queue reserves and cannot comsume more than a single slice."] + #[doc = "< command queue reserves and cannot consume more than a single slice."] #[doc = "< 'slice' size is device-specific. cannot be combined with COPY_ONLY."] ZE_COMMAND_QUEUE_FLAG_SINGLE_SLICE_ONLY = 4, #[doc = "< command queue supports command list with cooperative kernels. See"] @@ -2547,8 +2549,10 @@ pub enum _ze_command_queue_flag_t { #[doc = "< be combined with COPY_ONLY."] ZE_COMMAND_QUEUE_FLAG_SUPPORTS_COOPERATIVE_KERNELS = 8, } +#[doc = ""] +#[doc = " @brief Supported command queue flags"] pub use self::_ze_command_queue_flag_t as ze_command_queue_flag_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported command queue modes"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -2562,8 +2566,10 @@ pub enum _ze_command_queue_mode_t { #[doc = "< explicit synchronization object must be used to determine completeness"] ZE_COMMAND_QUEUE_MODE_ASYNCHRONOUS = 2, } +#[doc = ""] +#[doc = " @brief Supported command queue modes"] pub use self::_ze_command_queue_mode_t as ze_command_queue_mode_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported command queue priorities"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -2575,6 +2581,8 @@ pub enum _ze_command_queue_priority_t { #[doc = "< higher priority than normal"] ZE_COMMAND_QUEUE_PRIORITY_HIGH = 2, } +#[doc = ""] +#[doc = " @brief Supported command queue priorities"] pub use self::_ze_command_queue_priority_t as ze_command_queue_priority_t; #[doc = ""] #[doc = " @brief Command Queue descriptor"] @@ -2680,8 +2688,6 @@ extern "C" { #[doc = " @remarks"] #[doc = " _Analogues_"] #[doc = " - **clCreateCommandQueue**"] - #[doc = " - cuCtxCreate"] - #[doc = " - cuCtxGetCurrent"] #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] @@ -2722,7 +2728,6 @@ extern "C" { #[doc = " @remarks"] #[doc = " _Analogues_"] #[doc = " - **clReleaseCommandQueue**"] - #[doc = " - cuCtxDestroy"] #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] @@ -2785,16 +2790,18 @@ extern "C" { timeout: u32, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_command_list_desc_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_command_list_desc_version_t { - #[doc = "< version 1.0"] - ZE_COMMAND_LIST_DESC_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_COMMAND_LIST_DESC_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_command_list_desc_t"] pub use self::_ze_command_list_desc_version_t as ze_command_list_desc_version_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported command list creation flags"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -2823,6 +2830,8 @@ pub enum _ze_command_list_flag_t { #[doc = "< multi-engine submission and scheduling."] ZE_COMMAND_LIST_FLAG_EXPLICIT_ONLY = 8, } +#[doc = ""] +#[doc = " @brief Supported command list creation flags"] pub use self::_ze_command_list_flag_t as ze_command_list_flag_t; #[doc = ""] #[doc = " @brief Command List descriptor"] @@ -2995,1420 +3004,18 @@ extern "C" { #[doc = " + `nullptr == hCommandList`"] pub fn zeCommandListReset(hCommandList: ze_command_list_handle_t) -> ze_result_t; } -extern "C" { - #[doc = ""] - #[doc = " @brief Appends an execution and global memory barrier into a command list."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - If numWaitEvents is zero, then all previous commands are completed"] - #[doc = " prior to the execution of the barrier."] - #[doc = " - If numWaitEvents is non-zero, then then all phWaitEvents must be"] - #[doc = " signalled prior to the execution of the barrier."] - #[doc = " - This command blocks all following commands from beginning until the"] - #[doc = " execution of the barrier completes."] - #[doc = " - Memory and cache hierarchies are flushed and invalidated sufficient"] - #[doc = " for device and host access."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **vkCmdPipelineBarrier**"] - #[doc = " - clEnqueueBarrierWithWaitList"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeCommandListAppendBarrier( - hCommandList: ze_command_list_handle_t, - hSignalEvent: ze_event_handle_t, - numWaitEvents: u32, - phWaitEvents: *mut ze_event_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Appends a global memory ranges barrier into a command list."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - If numWaitEvents is zero, then all previous commands are completed"] - #[doc = " prior to the execution of the barrier."] - #[doc = " - If numWaitEvents is non-zero, then then all phWaitEvents must be"] - #[doc = " signalled prior to the execution of the barrier."] - #[doc = " - This command blocks all following commands from beginning until the"] - #[doc = " execution of the barrier completes."] - #[doc = " - Memory and cache hierarchies are flushed and invalidated sufficient"] - #[doc = " for device and host access."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == pRangeSizes`"] - #[doc = " + `nullptr == pRanges`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeCommandListAppendMemoryRangesBarrier( - hCommandList: ze_command_list_handle_t, - numRanges: u32, - pRangeSizes: *const usize, - pRanges: *mut *const ::std::os::raw::c_void, - hSignalEvent: ze_event_handle_t, - numWaitEvents: u32, - phWaitEvents: *mut ze_event_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Ensures in-bound writes to the device are globally observable."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - This is a special-case system level barrier that can be used to ensure"] - #[doc = " global observability of writes; typically needed after a producer"] - #[doc = " (e.g., NIC) performs direct writes to the device's memory (e.g.,"] - #[doc = " Direct RDMA writes). This is typically required when the memory"] - #[doc = " corresponding to the writes is subsequently accessed from a remote"] - #[doc = " device."] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDevice`"] - pub fn zeDeviceSystemBarrier(hDevice: ze_device_handle_t) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Copies host, device, or shared memory."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The memory pointed to by both srcptr and dstptr must be accessible by"] - #[doc = " the device on which the command list is created."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **clEnqueueCopyBuffer**"] - #[doc = " - **clEnqueueReadBuffer**"] - #[doc = " - **clEnqueueWriteBuffer**"] - #[doc = " - **clEnqueueSVMMemcpy**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == dstptr`"] - #[doc = " + `nullptr == srcptr`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeCommandListAppendMemoryCopy( - hCommandList: ze_command_list_handle_t, - dstptr: *mut ::std::os::raw::c_void, - srcptr: *const ::std::os::raw::c_void, - size: usize, - hEvent: ze_event_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Initializes host, device, or shared memory."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The memory pointed to by dstptr must be accessible by the device on"] - #[doc = " which the command list is created."] - #[doc = " - The value to initialize memory to is described by the pattern and the"] - #[doc = " pattern size."] - #[doc = " - The pattern size must be a power of two."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **clEnqueueFillBuffer**"] - #[doc = " - **clEnqueueSVMMemFill**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == ptr`"] - #[doc = " + `nullptr == pattern`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeCommandListAppendMemoryFill( - hCommandList: ze_command_list_handle_t, - ptr: *mut ::std::os::raw::c_void, - pattern: *const ::std::os::raw::c_void, - pattern_size: usize, - size: usize, - hEvent: ze_event_handle_t, - ) -> ze_result_t; -} -#[doc = ""] -#[doc = " @brief Copy region descriptor"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _ze_copy_region_t { - #[doc = "< [in] The origin x offset for region in bytes"] - pub originX: u32, - #[doc = "< [in] The origin y offset for region in rows"] - pub originY: u32, - #[doc = "< [in] The origin z offset for region in slices"] - pub originZ: u32, - #[doc = "< [in] The region width relative to origin in bytes"] - pub width: u32, - #[doc = "< [in] The region height relative to origin in rows"] - pub height: u32, - #[doc = "< [in] The region depth relative to origin in slices. Set this to 0 for"] - #[doc = "< 2D copy."] - pub depth: u32, -} -#[test] -fn bindgen_test_layout__ze_copy_region_t() { - assert_eq!( - ::std::mem::size_of::<_ze_copy_region_t>(), - 24usize, - concat!("Size of: ", stringify!(_ze_copy_region_t)) - ); - assert_eq!( - ::std::mem::align_of::<_ze_copy_region_t>(), - 4usize, - concat!("Alignment of ", stringify!(_ze_copy_region_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).originX as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ze_copy_region_t), - "::", - stringify!(originX) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).originY as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_ze_copy_region_t), - "::", - stringify!(originY) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).originZ as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_ze_copy_region_t), - "::", - stringify!(originZ) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).width as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_ze_copy_region_t), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).height as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_ze_copy_region_t), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).depth as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(_ze_copy_region_t), - "::", - stringify!(depth) - ) - ); -} -extern "C" { - #[doc = ""] - #[doc = " @brief Copies a region from a 2D or 3D array of host, device, or shared"] - #[doc = " memory."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The memory pointed to by both srcptr and dstptr must be accessible by"] - #[doc = " the device on which the command list is created."] - #[doc = " - The region width, height, and depth for both src and dst must be same."] - #[doc = " The origins can be different."] - #[doc = " - The src and dst regions cannot be overlapping."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == dstptr`"] - #[doc = " + `nullptr == dstRegion`"] - #[doc = " + `nullptr == srcptr`"] - #[doc = " + `nullptr == srcRegion`"] - #[doc = " - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeCommandListAppendMemoryCopyRegion( - hCommandList: ze_command_list_handle_t, - dstptr: *mut ::std::os::raw::c_void, - dstRegion: *const ze_copy_region_t, - dstPitch: u32, - dstSlicePitch: u32, - srcptr: *const ::std::os::raw::c_void, - srcRegion: *const ze_copy_region_t, - srcPitch: u32, - srcSlicePitch: u32, - hEvent: ze_event_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Copies a image."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **clEnqueueCopyImage**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " + `nullptr == hDstImage`"] - #[doc = " + `nullptr == hSrcImage`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeCommandListAppendImageCopy( - hCommandList: ze_command_list_handle_t, - hDstImage: ze_image_handle_t, - hSrcImage: ze_image_handle_t, - hEvent: ze_event_handle_t, - ) -> ze_result_t; -} -#[doc = ""] -#[doc = " @brief Region descriptor"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _ze_image_region_t { - #[doc = "< [in] The origin x offset for region in pixels"] - pub originX: u32, - #[doc = "< [in] The origin y offset for region in pixels"] - pub originY: u32, - #[doc = "< [in] The origin z offset for region in pixels"] - pub originZ: u32, - #[doc = "< [in] The region width relative to origin in pixels"] - pub width: u32, - #[doc = "< [in] The region height relative to origin in pixels"] - pub height: u32, - #[doc = "< [in] The region depth relative to origin. For 1D or 2D images, set"] - #[doc = "< this to 1."] - pub depth: u32, -} -#[test] -fn bindgen_test_layout__ze_image_region_t() { - assert_eq!( - ::std::mem::size_of::<_ze_image_region_t>(), - 24usize, - concat!("Size of: ", stringify!(_ze_image_region_t)) - ); - assert_eq!( - ::std::mem::align_of::<_ze_image_region_t>(), - 4usize, - concat!("Alignment of ", stringify!(_ze_image_region_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).originX as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ze_image_region_t), - "::", - stringify!(originX) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).originY as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_ze_image_region_t), - "::", - stringify!(originY) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).originZ as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_ze_image_region_t), - "::", - stringify!(originZ) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).width as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_ze_image_region_t), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).height as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_ze_image_region_t), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).depth as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(_ze_image_region_t), - "::", - stringify!(depth) - ) - ); -} -extern "C" { - #[doc = ""] - #[doc = " @brief Copies a region of a image to another image."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The region width and height for both src and dst must be same. The"] - #[doc = " origins can be different."] - #[doc = " - The src and dst regions cannot be overlapping."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " + `nullptr == hDstImage`"] - #[doc = " + `nullptr == hSrcImage`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - #[doc = " - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS"] - pub fn zeCommandListAppendImageCopyRegion( - hCommandList: ze_command_list_handle_t, - hDstImage: ze_image_handle_t, - hSrcImage: ze_image_handle_t, - pDstRegion: *const ze_image_region_t, - pSrcRegion: *const ze_image_region_t, - hEvent: ze_event_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Copies from a image to device or shared memory."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The memory pointed to by dstptr must be accessible by the device on"] - #[doc = " which the command list is created."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - clEnqueueReadImage"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " + `nullptr == hSrcImage`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == dstptr`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeCommandListAppendImageCopyToMemory( - hCommandList: ze_command_list_handle_t, - dstptr: *mut ::std::os::raw::c_void, - hSrcImage: ze_image_handle_t, - pSrcRegion: *const ze_image_region_t, - hEvent: ze_event_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Copies to a image from device or shared memory."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The memory pointed to by srcptr must be accessible by the device on"] - #[doc = " which the command list is created."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - clEnqueueWriteImage"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " + `nullptr == hDstImage`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == srcptr`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeCommandListAppendImageCopyFromMemory( - hCommandList: ze_command_list_handle_t, - hDstImage: ze_image_handle_t, - srcptr: *const ::std::os::raw::c_void, - pDstRegion: *const ze_image_region_t, - hEvent: ze_event_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Asynchronously prefetches shared memory to the device associated with"] - #[doc = " the specified command list"] - #[doc = ""] - #[doc = " @details"] - #[doc = " - This is a hint to improve performance only and is not required for"] - #[doc = " correctness."] - #[doc = " - Only prefetching to the device associated with the specified command"] - #[doc = " list is supported."] - #[doc = " Prefetching to the host or to a peer device is not supported."] - #[doc = " - Prefetching may not be supported for all allocation types for all devices."] - #[doc = " If memory prefetching is not supported for the specified memory range"] - #[doc = " the prefetch hint may be ignored."] - #[doc = " - Prefetching may only be supported at a device-specific granularity,"] - #[doc = " such as at a page boundary."] - #[doc = " In this case, the memory range may be expanded such that the start and"] - #[doc = " end of the range satisfy granularity requirements."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - cudaMemPrefetchAsync"] - #[doc = " - clEnqueueSVMMigrateMem"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == ptr`"] - pub fn zeCommandListAppendMemoryPrefetch( - hCommandList: ze_command_list_handle_t, - ptr: *const ::std::os::raw::c_void, - size: usize, - ) -> ze_result_t; -} -#[repr(u32)] -#[doc = ""] -#[doc = " @brief Supported memory advice hints"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_memory_advice_t { - #[doc = "< hint that memory will be read from frequently and written to rarely"] - ZE_MEMORY_ADVICE_SET_READ_MOSTLY = 0, - #[doc = "< removes the affect of ::ZE_MEMORY_ADVICE_SET_READ_MOSTLY"] - ZE_MEMORY_ADVICE_CLEAR_READ_MOSTLY = 1, - #[doc = "< hint that the preferred memory location is the specified device"] - ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION = 2, - #[doc = "< removes the affect of ::ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION"] - ZE_MEMORY_ADVICE_CLEAR_PREFERRED_LOCATION = 3, - #[doc = "< hint that memory will be accessed by the specified device"] - ZE_MEMORY_ADVICE_SET_ACCESSED_BY = 4, - #[doc = "< removes the affect of ::ZE_MEMORY_ADVICE_SET_ACCESSED_BY"] - ZE_MEMORY_ADVICE_CLEAR_ACCESSED_BY = 5, - #[doc = "< hints that memory will mostly be accessed non-atomically"] - ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY = 6, - #[doc = "< removes the affect of ::ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY"] - ZE_MEMORY_ADVICE_CLEAR_NON_ATOMIC_MOSTLY = 7, - #[doc = "< hints that memory should be cached"] - ZE_MEMORY_ADVICE_BIAS_CACHED = 8, - #[doc = "< hints that memory should be not be cached"] - ZE_MEMORY_ADVICE_BIAS_UNCACHED = 9, -} -pub use self::_ze_memory_advice_t as ze_memory_advice_t; -extern "C" { - #[doc = ""] - #[doc = " @brief Provides advice about the use of a shared memory range"] - #[doc = ""] - #[doc = " @details"] - #[doc = " - Memory advice is a performance hint only and is not required for"] - #[doc = " functional correctness."] - #[doc = " - Memory advice can be used to override driver heuristics to explicitly"] - #[doc = " control shared memory behavior."] - #[doc = " - Not all memory advice hints may be supported for all allocation types"] - #[doc = " for all devices."] - #[doc = " If a memory advice hint is not supported by the device it will be ignored."] - #[doc = " - Memory advice may only be supported at a device-specific granularity,"] - #[doc = " such as at a page boundary."] - #[doc = " In this case, the memory range may be expanded such that the start and"] - #[doc = " end of the range satisfy granularity requirements."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cudaMemAdvise**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " + `nullptr == hDevice`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == ptr`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] - #[doc = " + advice"] - pub fn zeCommandListAppendMemAdvise( - hCommandList: ze_command_list_handle_t, - hDevice: ze_device_handle_t, - ptr: *const ::std::os::raw::c_void, - size: usize, - advice: ze_memory_advice_t, - ) -> ze_result_t; -} -#[repr(u32)] -#[doc = ""] -#[doc = " @brief API version of ::ze_event_pool_desc_t"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_event_pool_desc_version_t { - #[doc = "< version 1.0"] - ZE_EVENT_POOL_DESC_VERSION_CURRENT = 65536, -} -pub use self::_ze_event_pool_desc_version_t as ze_event_pool_desc_version_t; -#[repr(u32)] -#[doc = ""] -#[doc = " @brief Supported event pool creation flags"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_event_pool_flag_t { - #[doc = "< signals and waits visible to the entire device and peer devices"] - ZE_EVENT_POOL_FLAG_DEFAULT = 0, - #[doc = "< signals and waits are also visible to host"] - ZE_EVENT_POOL_FLAG_HOST_VISIBLE = 1, - #[doc = "< signals and waits may be shared across processes"] - ZE_EVENT_POOL_FLAG_IPC = 2, - #[doc = "< Indicates all events in pool will contain timestamp information that"] - #[doc = "< can be queried using ::zeEventGetTimestamp"] - ZE_EVENT_POOL_FLAG_TIMESTAMP = 4, -} -pub use self::_ze_event_pool_flag_t as ze_event_pool_flag_t; -#[doc = ""] -#[doc = " @brief Event pool descriptor"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _ze_event_pool_desc_t { - #[doc = "< [in] ::ZE_EVENT_POOL_DESC_VERSION_CURRENT"] - pub version: ze_event_pool_desc_version_t, - #[doc = "< [in] creation flags"] - pub flags: ze_event_pool_flag_t, - #[doc = "< [in] number of events within the pool"] - pub count: u32, -} -#[test] -fn bindgen_test_layout__ze_event_pool_desc_t() { - assert_eq!( - ::std::mem::size_of::<_ze_event_pool_desc_t>(), - 12usize, - concat!("Size of: ", stringify!(_ze_event_pool_desc_t)) - ); - assert_eq!( - ::std::mem::align_of::<_ze_event_pool_desc_t>(), - 4usize, - concat!("Alignment of ", stringify!(_ze_event_pool_desc_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_event_pool_desc_t>())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ze_event_pool_desc_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_event_pool_desc_t>())).flags as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_ze_event_pool_desc_t), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_event_pool_desc_t>())).count as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_ze_event_pool_desc_t), - "::", - stringify!(count) - ) - ); -} -extern "C" { - #[doc = ""] - #[doc = " @brief Creates a pool for a set of event(s) for the driver"] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDriver`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == desc`"] - #[doc = " + `nullptr == phEventPool`"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] - #[doc = " + `::ZE_EVENT_POOL_DESC_VERSION_CURRENT < desc->version`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] - #[doc = " + desc->flags"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"] - pub fn zeEventPoolCreate( - hDriver: ze_driver_handle_t, - desc: *const ze_event_pool_desc_t, - numDevices: u32, - phDevices: *mut ze_device_handle_t, - phEventPool: *mut ze_event_pool_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Deletes an event pool object."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application is responsible for destroying all event handles"] - #[doc = " created from the pool before destroying the pool itself"] - #[doc = " - The application is responsible for making sure the device is not"] - #[doc = " currently referencing the any event within the pool before it is"] - #[doc = " deleted"] - #[doc = " - The implementation of this function will immediately free all Host and"] - #[doc = " Device allocations associated with this event pool"] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same event pool handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hEventPool`"] - #[doc = " - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE"] - pub fn zeEventPoolDestroy(hEventPool: ze_event_pool_handle_t) -> ze_result_t; -} -#[repr(u32)] -#[doc = ""] -#[doc = " @brief API version of ::ze_event_desc_t"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_event_desc_version_t { - #[doc = "< version 1.0"] - ZE_EVENT_DESC_VERSION_CURRENT = 65536, -} -pub use self::_ze_event_desc_version_t as ze_event_desc_version_t; -#[repr(u32)] -#[doc = ""] -#[doc = " @brief Supported event scope flags"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_event_scope_flag_t { - #[doc = "< execution synchronization only; no cache hierarchies are flushed or"] - #[doc = "< invalidated"] - ZE_EVENT_SCOPE_FLAG_NONE = 0, - #[doc = "< cache hierarchies are flushed or invalidated sufficient for local"] - #[doc = "< sub-device access"] - ZE_EVENT_SCOPE_FLAG_SUBDEVICE = 1, - #[doc = "< cache hierarchies are flushed or invalidated sufficient for global"] - #[doc = "< device access and peer device access"] - ZE_EVENT_SCOPE_FLAG_DEVICE = 2, - #[doc = "< cache hierarchies are flushed or invalidated sufficient for device and"] - #[doc = "< host access"] - ZE_EVENT_SCOPE_FLAG_HOST = 4, -} -pub use self::_ze_event_scope_flag_t as ze_event_scope_flag_t; -#[doc = ""] -#[doc = " @brief Event descriptor"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _ze_event_desc_t { - #[doc = "< [in] ::ZE_EVENT_DESC_VERSION_CURRENT"] - pub version: ze_event_desc_version_t, - #[doc = "< [in] index of the event within the pool; must be less-than the count"] - #[doc = "< specified during pool creation"] - pub index: u32, - #[doc = "< [in] defines the scope of relevant cache hierarchies to flush on a"] - #[doc = "< signal action before the event is triggered"] - pub signal: ze_event_scope_flag_t, - #[doc = "< [in] defines the scope of relevant cache hierarchies to invalidate on"] - #[doc = "< a wait action after the event is complete"] - pub wait: ze_event_scope_flag_t, -} -#[test] -fn bindgen_test_layout__ze_event_desc_t() { - assert_eq!( - ::std::mem::size_of::<_ze_event_desc_t>(), - 16usize, - concat!("Size of: ", stringify!(_ze_event_desc_t)) - ); - assert_eq!( - ::std::mem::align_of::<_ze_event_desc_t>(), - 4usize, - concat!("Alignment of ", stringify!(_ze_event_desc_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_event_desc_t>())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ze_event_desc_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_event_desc_t>())).index as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_ze_event_desc_t), - "::", - stringify!(index) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_event_desc_t>())).signal as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_ze_event_desc_t), - "::", - stringify!(signal) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_event_desc_t>())).wait as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(_ze_event_desc_t), - "::", - stringify!(wait) - ) - ); -} -extern "C" { - #[doc = ""] - #[doc = " @brief Creates an event on the device."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - Multiple events cannot be created using the same location within the"] - #[doc = " same pool."] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **clCreateUserEvent**"] - #[doc = " - vkCreateEvent"] - #[doc = " - cuEventCreate"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hEventPool`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == desc`"] - #[doc = " + `nullptr == phEvent`"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] - #[doc = " + `::ZE_EVENT_DESC_VERSION_CURRENT < desc->version`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] - #[doc = " + desc->signal"] - #[doc = " + desc->wait"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] - pub fn zeEventCreate( - hEventPool: ze_event_pool_handle_t, - desc: *const ze_event_desc_t, - phEvent: *mut ze_event_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Deletes an event object."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application is responsible for making sure the device is not"] - #[doc = " currently referencing the event before it is deleted"] - #[doc = " - The implementation of this function will immediately free all Host and"] - #[doc = " Device allocations associated with this event"] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same event handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **clReleaseEvent**"] - #[doc = " - vkDestroyEvent"] - #[doc = " - cuEventDestroy"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hEvent`"] - #[doc = " - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE"] - pub fn zeEventDestroy(hEvent: ze_event_handle_t) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Gets an IPC event pool handle for the specified event handle that can"] - #[doc = " be shared with another process."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuIpcGetEventHandle**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hEventPool`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == phIpc`"] - pub fn zeEventPoolGetIpcHandle( - hEventPool: ze_event_pool_handle_t, - phIpc: *mut ze_ipc_event_pool_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Opens an IPC event pool handle to retrieve an event pool handle from"] - #[doc = " another process."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The event handle in this process should not be freed with"] - #[doc = " ::zeEventPoolDestroy, but rather with ::zeEventPoolCloseIpcHandle."] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuIpcOpenMemHandle**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDriver`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == phEventPool`"] - pub fn zeEventPoolOpenIpcHandle( - hDriver: ze_driver_handle_t, - hIpc: ze_ipc_event_pool_handle_t, - phEventPool: *mut ze_event_pool_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Closes an IPC event handle in the current process."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - Closes an IPC event handle by destroying events that were opened in"] - #[doc = " this process using ::zeEventPoolOpenIpcHandle."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same event pool handle."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuIpcCloseMemHandle**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hEventPool`"] - pub fn zeEventPoolCloseIpcHandle(hEventPool: ze_event_pool_handle_t) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Appends a signal of the event from the device into a command list."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **clSetUserEventStatus**"] - #[doc = " - cuEventRecord"] - #[doc = " - vkCmdSetEvent"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " + `nullptr == hEvent`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeCommandListAppendSignalEvent( - hCommandList: ze_command_list_handle_t, - hEvent: ze_event_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Appends wait on event(s) on the device into a command list."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == phEvents`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeCommandListAppendWaitOnEvents( - hCommandList: ze_command_list_handle_t, - numEvents: u32, - phEvents: *mut ze_event_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Signals a event from host."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - clSetUserEventStatus"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hEvent`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeEventHostSignal(hEvent: ze_event_handle_t) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief The current host thread waits on an event to be signalled."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - clWaitForEvents"] - #[doc = " - cuEventSynchronize"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hEvent`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - #[doc = " - ::ZE_RESULT_NOT_READY"] - #[doc = " + timeout expired"] - pub fn zeEventHostSynchronize(hEvent: ze_event_handle_t, timeout: u32) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Queries an event object's status."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **clGetEventInfo**"] - #[doc = " - vkGetEventStatus"] - #[doc = " - cuEventQuery"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hEvent`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - #[doc = " - ::ZE_RESULT_NOT_READY"] - #[doc = " + not signaled"] - pub fn zeEventQueryStatus(hEvent: ze_event_handle_t) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Reset an event back to not signaled state"] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command list handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - vkResetEvent"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandList`"] - #[doc = " + `nullptr == hEvent`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeCommandListAppendEventReset( - hCommandList: ze_command_list_handle_t, - hEvent: ze_event_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Reset an event back to not signaled state"] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - vkResetEvent"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hEvent`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeEventHostReset(hEvent: ze_event_handle_t) -> ze_result_t; -} -#[repr(u32)] -#[doc = ""] -#[doc = " @brief Supported timestamp types"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_event_timestamp_type_t { - #[doc = "< wall-clock time start in GPU clocks for event. Data is uint64_t."] - ZE_EVENT_TIMESTAMP_GLOBAL_START = 0, - #[doc = "< wall-clock time end in GPU clocks for event.Data is uint64_t."] - ZE_EVENT_TIMESTAMP_GLOBAL_END = 1, - #[doc = "< context time start in GPU clocks for event. Only includes time while"] - #[doc = "< HW context is actively running on GPU. Data is uint64_t."] - ZE_EVENT_TIMESTAMP_CONTEXT_START = 2, - #[doc = "< context time end in GPU clocks for event. Only includes time while HW"] - #[doc = "< context is actively running on GPU. Data is uint64_t."] - ZE_EVENT_TIMESTAMP_CONTEXT_END = 3, -} -pub use self::_ze_event_timestamp_type_t as ze_event_timestamp_type_t; -extern "C" { - #[doc = ""] - #[doc = " @brief Query timestamp information associated with an event. Event must come"] - #[doc = " from an event pool that was created using"] - #[doc = " ::ZE_EVENT_POOL_FLAG_TIMESTAMP flag."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hEvent`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] - #[doc = " + timestampType"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == dstptr`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - pub fn zeEventGetTimestamp( - hEvent: ze_event_handle_t, - timestampType: ze_event_timestamp_type_t, - dstptr: *mut ::std::os::raw::c_void, - ) -> ze_result_t; -} -#[repr(u32)] -#[doc = ""] -#[doc = " @brief API version of ::ze_fence_desc_t"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_fence_desc_version_t { - #[doc = "< version 1.0"] - ZE_FENCE_DESC_VERSION_CURRENT = 65536, -} -pub use self::_ze_fence_desc_version_t as ze_fence_desc_version_t; -#[repr(u32)] -#[doc = ""] -#[doc = " @brief Supported fence creation flags"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_fence_flag_t { - #[doc = "< default behavior"] - ZE_FENCE_FLAG_NONE = 0, -} -pub use self::_ze_fence_flag_t as ze_fence_flag_t; -#[doc = ""] -#[doc = " @brief Fence descriptor"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _ze_fence_desc_t { - #[doc = "< [in] ::ZE_FENCE_DESC_VERSION_CURRENT"] - pub version: ze_fence_desc_version_t, - #[doc = "< [in] creation flags"] - pub flags: ze_fence_flag_t, -} -#[test] -fn bindgen_test_layout__ze_fence_desc_t() { - assert_eq!( - ::std::mem::size_of::<_ze_fence_desc_t>(), - 8usize, - concat!("Size of: ", stringify!(_ze_fence_desc_t)) - ); - assert_eq!( - ::std::mem::align_of::<_ze_fence_desc_t>(), - 4usize, - concat!("Alignment of ", stringify!(_ze_fence_desc_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_fence_desc_t>())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ze_fence_desc_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_fence_desc_t>())).flags as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_ze_fence_desc_t), - "::", - stringify!(flags) - ) - ); -} -extern "C" { - #[doc = ""] - #[doc = " @brief Creates a fence object on the device's command queue."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **vkCreateFence**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hCommandQueue`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == desc`"] - #[doc = " + `nullptr == phFence`"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] - #[doc = " + `::ZE_FENCE_DESC_VERSION_CURRENT < desc->version`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] - #[doc = " + desc->flags"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"] - pub fn zeFenceCreate( - hCommandQueue: ze_command_queue_handle_t, - desc: *const ze_fence_desc_t, - phFence: *mut ze_fence_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Deletes a fence object."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application is responsible for making sure the device is not"] - #[doc = " currently referencing the fence before it is deleted"] - #[doc = " - The implementation of this function will immediately free all Host and"] - #[doc = " Device allocations associated with this fence"] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same fence handle."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **vkDestroyFence**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hFence`"] - #[doc = " - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE"] - pub fn zeFenceDestroy(hFence: ze_fence_handle_t) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief The current host thread waits on a fence to be signaled."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **vkWaitForFences**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hFence`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - #[doc = " - ::ZE_RESULT_NOT_READY"] - #[doc = " + timeout expired"] - pub fn zeFenceHostSynchronize(hFence: ze_fence_handle_t, timeout: u32) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Queries a fence object's status."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **vkGetFenceStatus**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hFence`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] - #[doc = " - ::ZE_RESULT_NOT_READY"] - #[doc = " + not signaled"] - pub fn zeFenceQueryStatus(hFence: ze_fence_handle_t) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Reset a fence back to the not signaled state."] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **vkResetFences**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hFence`"] - pub fn zeFenceReset(hFence: ze_fence_handle_t) -> ze_result_t; -} -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_image_desc_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_image_desc_version_t { - #[doc = "< version 1.0"] - ZE_IMAGE_DESC_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_IMAGE_DESC_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_image_desc_t"] pub use self::_ze_image_desc_version_t as ze_image_desc_version_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported image creation flags"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -4422,8 +3029,10 @@ pub enum _ze_image_flag_t { #[doc = "< device should not cache contents"] ZE_IMAGE_FLAG_BIAS_UNCACHED = 8, } +#[doc = ""] +#[doc = " @brief Supported image creation flags"] pub use self::_ze_image_flag_t as ze_image_flag_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported image types"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -4441,8 +3050,10 @@ pub enum _ze_image_type_t { #[doc = "< Buffer"] ZE_IMAGE_TYPE_BUFFER = 5, } +#[doc = ""] +#[doc = " @brief Supported image types"] pub use self::_ze_image_type_t as ze_image_type_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported image format layouts"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -4508,8 +3119,10 @@ pub enum _ze_image_format_layout_t { #[doc = "< Media Format: P416. Format type and swizzle is ignored for this."] ZE_IMAGE_FORMAT_LAYOUT_P416 = 29, } +#[doc = ""] +#[doc = " @brief Supported image format layouts"] pub use self::_ze_image_format_layout_t as ze_image_format_layout_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported image format types"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -4525,8 +3138,10 @@ pub enum _ze_image_format_type_t { #[doc = "< Float"] ZE_IMAGE_FORMAT_TYPE_FLOAT = 4, } +#[doc = ""] +#[doc = " @brief Supported image format types"] pub use self::_ze_image_format_type_t as ze_image_format_type_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported image format component swizzle into channel"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -4546,6 +3161,8 @@ pub enum _ze_image_format_swizzle_t { #[doc = "< Don't care"] ZE_IMAGE_FORMAT_SWIZZLE_X = 6, } +#[doc = ""] +#[doc = " @brief Supported image format component swizzle into channel"] pub use self::_ze_image_format_swizzle_t as ze_image_format_swizzle_t; #[doc = ""] #[doc = " @brief Image format descriptor"] @@ -4554,7 +3171,7 @@ pub use self::_ze_image_format_swizzle_t as ze_image_format_swizzle_t; pub struct _ze_image_format_desc_t { #[doc = "< [in] image format component layout"] pub layout: ze_image_format_layout_t, - #[doc = "< [in] image format type. Media formats can not be used for"] + #[doc = "< [in] image format type. Media formats can't be used for"] #[doc = "< ::ZE_IMAGE_TYPE_BUFFER."] pub type_: ze_image_format_type_t, #[doc = "< [in] image component swizzle into channel x"] @@ -4771,16 +3388,18 @@ fn bindgen_test_layout__ze_image_desc_t() { ) ); } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_image_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_image_properties_version_t { - #[doc = "< version 1.0"] - ZE_IMAGE_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_IMAGE_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_image_properties_t"] pub use self::_ze_image_properties_version_t as ze_image_properties_version_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported sampler filtering flags"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -4792,6 +3411,8 @@ pub enum _ze_image_sampler_filter_flags_t { #[doc = "< device supports linear filtering"] ZE_IMAGE_SAMPLER_FILTER_FLAGS_LINEAR = 2, } +#[doc = ""] +#[doc = " @brief Supported sampler filtering flags"] pub use self::_ze_image_sampler_filter_flags_t as ze_image_sampler_filter_flags_t; #[doc = ""] #[doc = " @brief Image properties"] @@ -4927,580 +3548,109 @@ extern "C" { #[doc = " - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE"] pub fn zeImageDestroy(hImage: ze_image_handle_t) -> ze_result_t; } -#[repr(u32)] -#[doc = ""] -#[doc = " @brief API version of ::ze_device_mem_alloc_desc_t"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_device_mem_alloc_desc_version_t { - #[doc = "< version 1.0"] - ZE_DEVICE_MEM_ALLOC_DESC_VERSION_CURRENT = 65536, -} -pub use self::_ze_device_mem_alloc_desc_version_t as ze_device_mem_alloc_desc_version_t; -#[repr(u32)] -#[doc = ""] -#[doc = " @brief Supported memory allocation flags"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_device_mem_alloc_flag_t { - #[doc = "< implicit default behavior; uses driver-based heuristics"] - ZE_DEVICE_MEM_ALLOC_FLAG_DEFAULT = 0, - #[doc = "< device should cache allocation"] - ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED = 1, - #[doc = "< device should not cache allocation (UC)"] - ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED = 2, -} -pub use self::_ze_device_mem_alloc_flag_t as ze_device_mem_alloc_flag_t; -#[doc = ""] -#[doc = " @brief Device mem alloc descriptor"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _ze_device_mem_alloc_desc_t { - #[doc = "< [in] ::ZE_DEVICE_MEM_ALLOC_DESC_VERSION_CURRENT"] - pub version: ze_device_mem_alloc_desc_version_t, - #[doc = "< [in] flags specifying additional allocation controls"] - pub flags: ze_device_mem_alloc_flag_t, - #[doc = "< [in] ordinal of the device's local memory to allocate from;"] - #[doc = "< must be less than the count returned from ::zeDeviceGetMemoryProperties"] - pub ordinal: u32, -} -#[test] -fn bindgen_test_layout__ze_device_mem_alloc_desc_t() { - assert_eq!( - ::std::mem::size_of::<_ze_device_mem_alloc_desc_t>(), - 12usize, - concat!("Size of: ", stringify!(_ze_device_mem_alloc_desc_t)) - ); - assert_eq!( - ::std::mem::align_of::<_ze_device_mem_alloc_desc_t>(), - 4usize, - concat!("Alignment of ", stringify!(_ze_device_mem_alloc_desc_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_ze_device_mem_alloc_desc_t>())).version as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ze_device_mem_alloc_desc_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_ze_device_mem_alloc_desc_t>())).flags as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_ze_device_mem_alloc_desc_t), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_ze_device_mem_alloc_desc_t>())).ordinal as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_ze_device_mem_alloc_desc_t), - "::", - stringify!(ordinal) - ) - ); -} -#[repr(u32)] -#[doc = ""] -#[doc = " @brief API version of ::ze_host_mem_alloc_desc_t"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_host_mem_alloc_desc_version_t { - #[doc = "< version 1.0"] - ZE_HOST_MEM_ALLOC_DESC_VERSION_CURRENT = 65536, -} -pub use self::_ze_host_mem_alloc_desc_version_t as ze_host_mem_alloc_desc_version_t; -#[repr(u32)] -#[doc = ""] -#[doc = " @brief Supported host memory allocation flags"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_host_mem_alloc_flag_t { - #[doc = "< implicit default behavior; uses driver-based heuristics"] - ZE_HOST_MEM_ALLOC_FLAG_DEFAULT = 0, - #[doc = "< host should cache allocation"] - ZE_HOST_MEM_ALLOC_FLAG_BIAS_CACHED = 1, - #[doc = "< host should not cache allocation (UC)"] - ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED = 2, - #[doc = "< host memory should be allocated write-combined (WC)"] - ZE_HOST_MEM_ALLOC_FLAG_BIAS_WRITE_COMBINED = 4, -} -pub use self::_ze_host_mem_alloc_flag_t as ze_host_mem_alloc_flag_t; -#[doc = ""] -#[doc = " @brief Host mem alloc descriptor"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _ze_host_mem_alloc_desc_t { - #[doc = "< [in] ::ZE_HOST_MEM_ALLOC_DESC_VERSION_CURRENT"] - pub version: ze_host_mem_alloc_desc_version_t, - #[doc = "< [in] flags specifying additional allocation controls"] - pub flags: ze_host_mem_alloc_flag_t, -} -#[test] -fn bindgen_test_layout__ze_host_mem_alloc_desc_t() { - assert_eq!( - ::std::mem::size_of::<_ze_host_mem_alloc_desc_t>(), - 8usize, - concat!("Size of: ", stringify!(_ze_host_mem_alloc_desc_t)) - ); - assert_eq!( - ::std::mem::align_of::<_ze_host_mem_alloc_desc_t>(), - 4usize, - concat!("Alignment of ", stringify!(_ze_host_mem_alloc_desc_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_ze_host_mem_alloc_desc_t>())).version as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ze_host_mem_alloc_desc_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_ze_host_mem_alloc_desc_t>())).flags as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_ze_host_mem_alloc_desc_t), - "::", - stringify!(flags) - ) - ); -} -extern "C" { - #[doc = ""] - #[doc = " @brief Allocates memory that is shared between the host and one or more"] - #[doc = " devices"] - #[doc = ""] - #[doc = " @details"] - #[doc = " - Shared allocations share ownership between the host and one or more"] - #[doc = " devices."] - #[doc = " - Shared allocations may optionally be associated with a device by"] - #[doc = " passing a handle to the device."] - #[doc = " - Devices supporting only single-device shared access capabilities may"] - #[doc = " access shared memory associated with the device."] - #[doc = " For these devices, ownership of the allocation is shared between the"] - #[doc = " host and the associated device only."] - #[doc = " - Passing nullptr as the device handle does not associate the shared"] - #[doc = " allocation with any device."] - #[doc = " For allocations with no associated device, ownership of the allocation"] - #[doc = " is shared between the host and all devices supporting cross-device"] - #[doc = " shared access capabilities."] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cudaMallocManaged**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDriver`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == device_desc`"] - #[doc = " + `nullptr == host_desc`"] - #[doc = " + `nullptr == pptr`"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] - #[doc = " + `::ZE_DEVICE_MEM_ALLOC_DESC_VERSION_CURRENT < device_desc->version`"] - #[doc = " + `::ZE_HOST_MEM_ALLOC_DESC_VERSION_CURRENT < host_desc->version`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] - #[doc = " + device_desc->flags"] - #[doc = " + host_desc->flags"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"] - pub fn zeDriverAllocSharedMem( - hDriver: ze_driver_handle_t, - device_desc: *const ze_device_mem_alloc_desc_t, - host_desc: *const ze_host_mem_alloc_desc_t, - size: usize, - alignment: usize, - hDevice: ze_device_handle_t, - pptr: *mut *mut ::std::os::raw::c_void, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Allocates memory specific to a device"] - #[doc = ""] - #[doc = " @details"] - #[doc = " - A device allocation is owned by a specific device."] - #[doc = " - In general, a device allocation may only be accessed by the device"] - #[doc = " that owns it."] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cudaMalloc**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDriver`"] - #[doc = " + `nullptr == hDevice`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == device_desc`"] - #[doc = " + `nullptr == pptr`"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] - #[doc = " + `::ZE_DEVICE_MEM_ALLOC_DESC_VERSION_CURRENT < device_desc->version`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] - #[doc = " + device_desc->flags"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"] - pub fn zeDriverAllocDeviceMem( - hDriver: ze_driver_handle_t, - device_desc: *const ze_device_mem_alloc_desc_t, - size: usize, - alignment: usize, - hDevice: ze_device_handle_t, - pptr: *mut *mut ::std::os::raw::c_void, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Allocates host memory"] - #[doc = ""] - #[doc = " @details"] - #[doc = " - A host allocation is owned by the host process."] - #[doc = " - Host allocations are accessible by the host and all devices within the"] - #[doc = " driver driver."] - #[doc = " - Host allocations are frequently used as staging areas to transfer data"] - #[doc = " to or from devices."] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cudaHostAlloc**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDriver`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == host_desc`"] - #[doc = " + `nullptr == pptr`"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] - #[doc = " + `::ZE_HOST_MEM_ALLOC_DESC_VERSION_CURRENT < host_desc->version`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] - #[doc = " + host_desc->flags"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE"] - #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"] - pub fn zeDriverAllocHostMem( - hDriver: ze_driver_handle_t, - host_desc: *const ze_host_mem_alloc_desc_t, - size: usize, - alignment: usize, - pptr: *mut *mut ::std::os::raw::c_void, - ) -> ze_result_t; -} extern "C" { #[doc = ""] - #[doc = " @brief Frees allocated host memory, device memory, or shared memory"] + #[doc = " @brief Appends an execution and global memory barrier into a command list."] #[doc = ""] #[doc = " @details"] - #[doc = " - The application is responsible for making sure the device is not"] - #[doc = " currently referencing the memory before it is freed"] - #[doc = " - The implementation of this function will immediately free all Host and"] - #[doc = " Device allocations associated with this memory"] + #[doc = " - If numWaitEvents is zero, then all previous commands are completed"] + #[doc = " prior to the execution of the barrier."] + #[doc = " - If numWaitEvents is non-zero, then then all phWaitEvents must be"] + #[doc = " signaled prior to the execution of the barrier."] + #[doc = " - This command blocks all following commands from beginning until the"] + #[doc = " execution of the barrier completes."] #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same pointer."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cudaFree**"] - #[doc = " - **cudaFreeHost**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDriver`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == ptr`"] - pub fn zeDriverFreeMem( - hDriver: ze_driver_handle_t, - ptr: *mut ::std::os::raw::c_void, - ) -> ze_result_t; -} -#[repr(u32)] -#[doc = ""] -#[doc = " @brief API version of ::ze_memory_allocation_properties_t"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_memory_allocation_properties_version_t { - #[doc = "< version 1.0"] - ZE_MEMORY_ALLOCATION_PROPERTIES_VERSION_CURRENT = 65536, -} -pub use self::_ze_memory_allocation_properties_version_t as ze_memory_allocation_properties_version_t; -#[repr(u32)] -#[doc = ""] -#[doc = " @brief Memory allocation type"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_memory_type_t { - #[doc = "< the memory pointed to is of unknown type"] - ZE_MEMORY_TYPE_UNKNOWN = 0, - #[doc = "< the memory pointed to is a host allocation"] - ZE_MEMORY_TYPE_HOST = 1, - #[doc = "< the memory pointed to is a device allocation"] - ZE_MEMORY_TYPE_DEVICE = 2, - #[doc = "< the memory pointed to is a shared ownership allocation"] - ZE_MEMORY_TYPE_SHARED = 3, -} -pub use self::_ze_memory_type_t as ze_memory_type_t; -#[doc = ""] -#[doc = " @brief Memory allocation properties queried using"] -#[doc = " ::zeDriverGetMemAllocProperties"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _ze_memory_allocation_properties_t { - #[doc = "< [in] ::ZE_MEMORY_ALLOCATION_PROPERTIES_VERSION_CURRENT"] - pub version: ze_memory_allocation_properties_version_t, - #[doc = "< [out] type of allocated memory"] - pub type_: ze_memory_type_t, - #[doc = "< [out] identifier for this allocation"] - pub id: u64, -} -#[test] -fn bindgen_test_layout__ze_memory_allocation_properties_t() { - assert_eq!( - ::std::mem::size_of::<_ze_memory_allocation_properties_t>(), - 16usize, - concat!("Size of: ", stringify!(_ze_memory_allocation_properties_t)) - ); - assert_eq!( - ::std::mem::align_of::<_ze_memory_allocation_properties_t>(), - 8usize, - concat!( - "Alignment of ", - stringify!(_ze_memory_allocation_properties_t) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_ze_memory_allocation_properties_t>())).version as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_ze_memory_allocation_properties_t), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_ze_memory_allocation_properties_t>())).type_ as *const _ - as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(_ze_memory_allocation_properties_t), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_ze_memory_allocation_properties_t>())).id as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_ze_memory_allocation_properties_t), - "::", - stringify!(id) - ) - ); -} -extern "C" { - #[doc = ""] - #[doc = " @brief Retrieves attributes of a memory allocation"] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuPointerGetAttribute**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDriver`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == ptr`"] - #[doc = " + `nullptr == pMemAllocProperties`"] - pub fn zeDriverGetMemAllocProperties( - hDriver: ze_driver_handle_t, - ptr: *const ::std::os::raw::c_void, - pMemAllocProperties: *mut ze_memory_allocation_properties_t, - phDevice: *mut ze_device_handle_t, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Retrieves the base address and/or size of an allocation"] - #[doc = ""] - #[doc = " @details"] - #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] #[doc = " @remarks"] #[doc = " _Analogues_"] - #[doc = " - **cuMemGetAddressRange**"] + #[doc = " - **vkCmdPipelineBarrier**"] + #[doc = " - clEnqueueBarrierWithWaitList"] #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDriver`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == ptr`"] - pub fn zeDriverGetMemAddressRange( - hDriver: ze_driver_handle_t, - ptr: *const ::std::os::raw::c_void, - pBase: *mut *mut ::std::os::raw::c_void, - pSize: *mut usize, + #[doc = " + `nullptr == hCommandList`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeCommandListAppendBarrier( + hCommandList: ze_command_list_handle_t, + hSignalEvent: ze_event_handle_t, + numWaitEvents: u32, + phWaitEvents: *mut ze_event_handle_t, ) -> ze_result_t; } extern "C" { #[doc = ""] - #[doc = " @brief Creates an IPC memory handle for the specified allocation in the"] - #[doc = " sending process"] + #[doc = " @brief Appends a global memory ranges barrier into a command list."] #[doc = ""] #[doc = " @details"] - #[doc = " - Takes a pointer to the base of a device memory allocation and exports"] - #[doc = " it for use in another process."] - #[doc = " - The application may call this function from simultaneous threads."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuIpcGetMemHandle**"] + #[doc = " - If numWaitEvents is zero, then all previous commands are completed"] + #[doc = " prior to the execution of the barrier."] + #[doc = " - If numWaitEvents is non-zero, then then all phWaitEvents must be"] + #[doc = " signaled prior to the execution of the barrier."] + #[doc = " - This command blocks all following commands from beginning until the"] + #[doc = " execution of the barrier completes."] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDriver`"] + #[doc = " + `nullptr == hCommandList`"] #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == ptr`"] - #[doc = " + `nullptr == pIpcHandle`"] - pub fn zeDriverGetMemIpcHandle( - hDriver: ze_driver_handle_t, - ptr: *const ::std::os::raw::c_void, - pIpcHandle: *mut ze_ipc_mem_handle_t, + #[doc = " + `nullptr == pRangeSizes`"] + #[doc = " + `nullptr == pRanges`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeCommandListAppendMemoryRangesBarrier( + hCommandList: ze_command_list_handle_t, + numRanges: u32, + pRangeSizes: *const usize, + pRanges: *mut *const ::std::os::raw::c_void, + hSignalEvent: ze_event_handle_t, + numWaitEvents: u32, + phWaitEvents: *mut ze_event_handle_t, ) -> ze_result_t; } -#[repr(u32)] -#[doc = ""] -#[doc = " @brief Supported IPC memory flags"] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum _ze_ipc_memory_flag_t { - #[doc = "< No special flags"] - ZE_IPC_MEMORY_FLAG_NONE = 0, -} -pub use self::_ze_ipc_memory_flag_t as ze_ipc_memory_flag_t; extern "C" { #[doc = ""] - #[doc = " @brief Opens an IPC memory handle to retrieve a device pointer in a receiving"] - #[doc = " process"] + #[doc = " @brief Ensures in-bound writes to the device are globally observable."] #[doc = ""] #[doc = " @details"] - #[doc = " - Takes an IPC memory handle from a sending process and associates it"] - #[doc = " with a device pointer usable in this process."] - #[doc = " - The device pointer in this process should not be freed with"] - #[doc = " ::zeDriverFreeMem, but rather with ::zeDriverCloseMemIpcHandle."] + #[doc = " - This is a special-case system level barrier that can be used to ensure"] + #[doc = " global observability of writes; typically needed after a producer"] + #[doc = " (e.g., NIC) performs direct writes to the device's memory (e.g.,"] + #[doc = " Direct RDMA writes). This is typically required when the memory"] + #[doc = " corresponding to the writes is subsequently accessed from a remote"] + #[doc = " device."] #[doc = " - The application may call this function from simultaneous threads."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuIpcOpenMemHandle**"] + #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDriver`"] #[doc = " + `nullptr == hDevice`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] - #[doc = " + flags"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == pptr`"] - pub fn zeDriverOpenMemIpcHandle( - hDriver: ze_driver_handle_t, - hDevice: ze_device_handle_t, - handle: ze_ipc_mem_handle_t, - flags: ze_ipc_memory_flag_t, - pptr: *mut *mut ::std::os::raw::c_void, - ) -> ze_result_t; -} -extern "C" { - #[doc = ""] - #[doc = " @brief Closes an IPC memory handle in a receiving process"] - #[doc = ""] - #[doc = " @details"] - #[doc = " - Closes an IPC memory handle by unmapping memory that was opened in"] - #[doc = " this process using ::zeDriverOpenMemIpcHandle."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same pointer."] - #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuIpcCloseMemHandle**"] - #[doc = ""] - #[doc = " @returns"] - #[doc = " - ::ZE_RESULT_SUCCESS"] - #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] - #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] - #[doc = " + `nullptr == hDriver`"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] - #[doc = " + `nullptr == ptr`"] - pub fn zeDriverCloseMemIpcHandle( - hDriver: ze_driver_handle_t, - ptr: *const ::std::os::raw::c_void, - ) -> ze_result_t; + pub fn zeDeviceSystemBarrier(hDevice: ze_device_handle_t) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_module_desc_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_module_desc_version_t { - #[doc = "< version 1.0"] - ZE_MODULE_DESC_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_MODULE_DESC_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_module_desc_t"] pub use self::_ze_module_desc_version_t as ze_module_desc_version_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported module creation input formats"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -5510,6 +3660,8 @@ pub enum _ze_module_format_t { #[doc = "< Format is device native format"] ZE_MODULE_FORMAT_NATIVE = 1, } +#[doc = ""] +#[doc = " @brief Supported module creation input formats"] pub use self::_ze_module_format_t as ze_module_format_t; #[doc = ""] #[doc = " @brief Specialization constants - User defined constants"] @@ -5688,10 +3840,6 @@ extern "C" { #[doc = " - The application may call this function from simultaneous threads."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuModuleLoad**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -5734,10 +3882,6 @@ extern "C" { #[doc = " threads with the same module handle."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuModuleUnload**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -5869,16 +4013,18 @@ extern "C" { pNames: *mut *const ::std::os::raw::c_char, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_kernel_desc_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_kernel_desc_version_t { - #[doc = "< version 1.0"] - ZE_KERNEL_DESC_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_KERNEL_DESC_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_kernel_desc_t"] pub use self::_ze_kernel_desc_version_t as ze_kernel_desc_version_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Supported kernel creation flags"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -5888,6 +4034,8 @@ pub enum _ze_kernel_flag_t { #[doc = "< force all device allocations to be resident during execution"] ZE_KERNEL_FLAG_FORCE_RESIDENCY = 1, } +#[doc = ""] +#[doc = " @brief Supported kernel creation flags"] pub use self::_ze_kernel_flag_t as ze_kernel_flag_t; #[doc = ""] #[doc = " @brief Kernel descriptor"] @@ -5952,10 +4100,6 @@ extern "C" { #[doc = " - The application may call this function from simultaneous threads."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuModuleGetFunction**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -6132,7 +4276,7 @@ extern "C" { pArgValue: *const ::std::os::raw::c_void, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Kernel attributes"] #[doc = ""] @@ -6156,6 +4300,12 @@ pub enum _ze_kernel_attribute_t { #[doc = "< ::zeKernelSetAttribute is not supported for this."] ZE_KERNEL_ATTR_SOURCE_ATTRIBUTE = 3, } +#[doc = ""] +#[doc = " @brief Kernel attributes"] +#[doc = ""] +#[doc = " @remarks"] +#[doc = " _Analogues_"] +#[doc = " - **cl_kernel_exec_info**"] pub use self::_ze_kernel_attribute_t as ze_kernel_attribute_t; extern "C" { #[doc = ""] @@ -6223,10 +4373,6 @@ extern "C" { #[doc = " - The application may **not** call this function from simultaneous"] #[doc = " threads with the same kernel handle."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cudaFuncSetCacheConfig **"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -6241,14 +4387,16 @@ extern "C" { CacheConfig: ze_cache_config_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_kernel_properties_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_kernel_properties_version_t { - #[doc = "< version 1.0"] - ZE_KERNEL_PROPERTIES_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_KERNEL_PROPERTIES_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_kernel_properties_t"] pub use self::_ze_kernel_properties_version_t as ze_kernel_properties_version_t; #[doc = ""] #[doc = " @brief Kernel properties"] @@ -6360,10 +4508,6 @@ extern "C" { #[doc = " - The application may call this function from simultaneous threads."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuFuncGetAttribute**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -6437,16 +4581,12 @@ extern "C" { #[doc = " @brief Launch kernel over one or more work groups."] #[doc = ""] #[doc = " @details"] - #[doc = " - This may **not** be called for a command list created with"] - #[doc = " ::ZE_COMMAND_LIST_FLAG_COPY_ONLY."] + #[doc = " - This may **only** be called for a command list created with command"] + #[doc = " queue group ordinal that supports compute."] #[doc = " - This function may **not** be called from simultaneous threads with the"] #[doc = " same command list handle."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuLaunchKernel**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -6471,8 +4611,8 @@ extern "C" { #[doc = " @brief Launch kernel cooperatively over one or more work groups."] #[doc = ""] #[doc = " @details"] - #[doc = " - This may **not** be called for a command list created with"] - #[doc = " ::ZE_COMMAND_LIST_FLAG_COPY_ONLY."] + #[doc = " - This may **only** be called for a command list created with command"] + #[doc = " queue group ordinal that supports compute."] #[doc = " - This may only be used for a command list that are submitted to command"] #[doc = " queue with cooperative flag set."] #[doc = " - This function may **not** be called from simultaneous threads with the"] @@ -6481,10 +4621,6 @@ extern "C" { #[doc = " - Use ::zeKernelSuggestMaxCooperativeGroupCount to recommend max group"] #[doc = " count for device for cooperative functions that device supports."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cudaLaunchCooperativeKernel**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -6512,16 +4648,12 @@ extern "C" { #[doc = " - The launch arguments need to be device visible."] #[doc = " - The launch arguments buffer may not be reused until the function has"] #[doc = " completed on the device."] - #[doc = " - This may **not** be called for a command list created with"] - #[doc = " ::ZE_COMMAND_LIST_FLAG_COPY_ONLY."] + #[doc = " - This may **only** be called for a command list created with command"] + #[doc = " queue group ordinal that supports compute."] #[doc = " - This function may **not** be called from simultaneous threads with the"] #[doc = " same command list handle."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuLaunchKernel**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -6550,16 +4682,12 @@ extern "C" { #[doc = " - The array of launch arguments need to be device visible."] #[doc = " - The array of launch arguments buffer may not be reused until the"] #[doc = " kernel has completed on the device."] - #[doc = " - This may **not** be called for a command list created with"] - #[doc = " ::ZE_COMMAND_LIST_FLAG_COPY_ONLY."] + #[doc = " - This may **only** be called for a command list created with command"] + #[doc = " queue group ordinal that supports compute."] #[doc = " - This function may **not** be called from simultaneous threads with the"] #[doc = " same command list handle."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuLaunchKernel**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -6685,16 +4813,598 @@ extern "C" { hImage: ze_image_handle_t, ) -> ze_result_t; } -#[repr(u32)] +#[repr(i32)] +#[doc = ""] +#[doc = " @brief API version of ::ze_event_pool_desc_t"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_event_pool_desc_version_t { + #[doc = "< version 0.91"] + ZE_EVENT_POOL_DESC_VERSION_CURRENT = 91, +} +#[doc = ""] +#[doc = " @brief API version of ::ze_event_pool_desc_t"] +pub use self::_ze_event_pool_desc_version_t as ze_event_pool_desc_version_t; +#[repr(i32)] +#[doc = ""] +#[doc = " @brief Supported event pool creation flags"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_event_pool_flag_t { + #[doc = "< signals and waits visible to the entire device and peer devices"] + ZE_EVENT_POOL_FLAG_DEFAULT = 0, + #[doc = "< signals and waits are also visible to host"] + ZE_EVENT_POOL_FLAG_HOST_VISIBLE = 1, + #[doc = "< signals and waits may be shared across processes"] + ZE_EVENT_POOL_FLAG_IPC = 2, + #[doc = "< Indicates all events in pool will contain timestamp information that"] + #[doc = "< can be queried using ::zeEventGetTimestamp"] + ZE_EVENT_POOL_FLAG_TIMESTAMP = 4, +} +#[doc = ""] +#[doc = " @brief Supported event pool creation flags"] +pub use self::_ze_event_pool_flag_t as ze_event_pool_flag_t; +#[doc = ""] +#[doc = " @brief Event pool descriptor"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ze_event_pool_desc_t { + #[doc = "< [in] ::ZE_EVENT_POOL_DESC_VERSION_CURRENT"] + pub version: ze_event_pool_desc_version_t, + #[doc = "< [in] creation flags"] + pub flags: ze_event_pool_flag_t, + #[doc = "< [in] number of events within the pool"] + pub count: u32, +} +#[test] +fn bindgen_test_layout__ze_event_pool_desc_t() { + assert_eq!( + ::std::mem::size_of::<_ze_event_pool_desc_t>(), + 12usize, + concat!("Size of: ", stringify!(_ze_event_pool_desc_t)) + ); + assert_eq!( + ::std::mem::align_of::<_ze_event_pool_desc_t>(), + 4usize, + concat!("Alignment of ", stringify!(_ze_event_pool_desc_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_event_pool_desc_t>())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_ze_event_pool_desc_t), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_event_pool_desc_t>())).flags as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_ze_event_pool_desc_t), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_event_pool_desc_t>())).count as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_ze_event_pool_desc_t), + "::", + stringify!(count) + ) + ); +} +extern "C" { + #[doc = ""] + #[doc = " @brief Creates a pool for a set of event(s) for the driver"] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hDriver`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == desc`"] + #[doc = " + `nullptr == phEventPool`"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] + #[doc = " + `::ZE_EVENT_POOL_DESC_VERSION_CURRENT < desc->version`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] + #[doc = " + desc->flags"] + #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] + #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"] + pub fn zeEventPoolCreate( + hDriver: ze_driver_handle_t, + desc: *const ze_event_pool_desc_t, + numDevices: u32, + phDevices: *mut ze_device_handle_t, + phEventPool: *mut ze_event_pool_handle_t, + ) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Deletes an event pool object."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application is responsible for destroying all event handles"] + #[doc = " created from the pool before destroying the pool itself"] + #[doc = " - The application is responsible for making sure the device is not"] + #[doc = " currently referencing the any event within the pool before it is"] + #[doc = " deleted"] + #[doc = " - The implementation of this function will immediately free all Host and"] + #[doc = " Device allocations associated with this event pool"] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same event pool handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hEventPool`"] + #[doc = " - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE"] + pub fn zeEventPoolDestroy(hEventPool: ze_event_pool_handle_t) -> ze_result_t; +} +#[repr(i32)] +#[doc = ""] +#[doc = " @brief API version of ::ze_event_desc_t"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_event_desc_version_t { + #[doc = "< version 0.91"] + ZE_EVENT_DESC_VERSION_CURRENT = 91, +} +#[doc = ""] +#[doc = " @brief API version of ::ze_event_desc_t"] +pub use self::_ze_event_desc_version_t as ze_event_desc_version_t; +#[repr(i32)] +#[doc = ""] +#[doc = " @brief Supported event scope flags"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_event_scope_flag_t { + #[doc = "< execution synchronization only; no cache hierarchies are flushed or"] + #[doc = "< invalidated"] + ZE_EVENT_SCOPE_FLAG_NONE = 0, + #[doc = "< cache hierarchies are flushed or invalidated sufficient for local"] + #[doc = "< sub-device access"] + ZE_EVENT_SCOPE_FLAG_SUBDEVICE = 1, + #[doc = "< cache hierarchies are flushed or invalidated sufficient for global"] + #[doc = "< device access and peer device access"] + ZE_EVENT_SCOPE_FLAG_DEVICE = 2, + #[doc = "< cache hierarchies are flushed or invalidated sufficient for device and"] + #[doc = "< host access"] + ZE_EVENT_SCOPE_FLAG_HOST = 4, +} +#[doc = ""] +#[doc = " @brief Supported event scope flags"] +pub use self::_ze_event_scope_flag_t as ze_event_scope_flag_t; +#[doc = ""] +#[doc = " @brief Event descriptor"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ze_event_desc_t { + #[doc = "< [in] ::ZE_EVENT_DESC_VERSION_CURRENT"] + pub version: ze_event_desc_version_t, + #[doc = "< [in] index of the event within the pool; must be less-than the count"] + #[doc = "< specified during pool creation"] + pub index: u32, + #[doc = "< [in] defines the scope of relevant cache hierarchies to flush on a"] + #[doc = "< signal action before the event is triggered"] + pub signal: ze_event_scope_flag_t, + #[doc = "< [in] defines the scope of relevant cache hierarchies to invalidate on"] + #[doc = "< a wait action after the event is complete"] + pub wait: ze_event_scope_flag_t, +} +#[test] +fn bindgen_test_layout__ze_event_desc_t() { + assert_eq!( + ::std::mem::size_of::<_ze_event_desc_t>(), + 16usize, + concat!("Size of: ", stringify!(_ze_event_desc_t)) + ); + assert_eq!( + ::std::mem::align_of::<_ze_event_desc_t>(), + 4usize, + concat!("Alignment of ", stringify!(_ze_event_desc_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_event_desc_t>())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_ze_event_desc_t), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_event_desc_t>())).index as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_ze_event_desc_t), + "::", + stringify!(index) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_event_desc_t>())).signal as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_ze_event_desc_t), + "::", + stringify!(signal) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_event_desc_t>())).wait as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_ze_event_desc_t), + "::", + stringify!(wait) + ) + ); +} +extern "C" { + #[doc = ""] + #[doc = " @brief Creates an event on the device."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - Multiple events cannot be created using the same location within the"] + #[doc = " same pool."] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **clCreateUserEvent**"] + #[doc = " - vkCreateEvent"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hEventPool`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == desc`"] + #[doc = " + `nullptr == phEvent`"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] + #[doc = " + `::ZE_EVENT_DESC_VERSION_CURRENT < desc->version`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] + #[doc = " + desc->signal"] + #[doc = " + desc->wait"] + #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] + pub fn zeEventCreate( + hEventPool: ze_event_pool_handle_t, + desc: *const ze_event_desc_t, + phEvent: *mut ze_event_handle_t, + ) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Deletes an event object."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application is responsible for making sure the device is not"] + #[doc = " currently referencing the event before it is deleted"] + #[doc = " - The implementation of this function will immediately free all Host and"] + #[doc = " Device allocations associated with this event"] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same event handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **clReleaseEvent**"] + #[doc = " - vkDestroyEvent"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hEvent`"] + #[doc = " - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE"] + pub fn zeEventDestroy(hEvent: ze_event_handle_t) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Gets an IPC event pool handle for the specified event handle that can"] + #[doc = " be shared with another process."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hEventPool`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == phIpc`"] + pub fn zeEventPoolGetIpcHandle( + hEventPool: ze_event_pool_handle_t, + phIpc: *mut ze_ipc_event_pool_handle_t, + ) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Opens an IPC event pool handle to retrieve an event pool handle from"] + #[doc = " another process."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The event handle in this process should not be freed with"] + #[doc = " ::zeEventPoolDestroy, but rather with ::zeEventPoolCloseIpcHandle."] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hDriver`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == phEventPool`"] + pub fn zeEventPoolOpenIpcHandle( + hDriver: ze_driver_handle_t, + hIpc: ze_ipc_event_pool_handle_t, + phEventPool: *mut ze_event_pool_handle_t, + ) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Closes an IPC event handle in the current process."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - Closes an IPC event handle by destroying events that were opened in"] + #[doc = " this process using ::zeEventPoolOpenIpcHandle."] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same event pool handle."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hEventPool`"] + pub fn zeEventPoolCloseIpcHandle(hEventPool: ze_event_pool_handle_t) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Appends a signal of the event from the device into a command list."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **clSetUserEventStatus**"] + #[doc = " - vkCmdSetEvent"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " + `nullptr == hEvent`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeCommandListAppendSignalEvent( + hCommandList: ze_command_list_handle_t, + hEvent: ze_event_handle_t, + ) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Appends wait on event(s) on the device into a command list."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == phEvents`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeCommandListAppendWaitOnEvents( + hCommandList: ze_command_list_handle_t, + numEvents: u32, + phEvents: *mut ze_event_handle_t, + ) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Signals a event from host."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - clSetUserEventStatus"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hEvent`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeEventHostSignal(hEvent: ze_event_handle_t) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief The current host thread waits on an event to be signaled."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - clWaitForEvents"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hEvent`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + #[doc = " - ::ZE_RESULT_NOT_READY"] + #[doc = " + timeout expired"] + pub fn zeEventHostSynchronize(hEvent: ze_event_handle_t, timeout: u32) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Queries an event object's status."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **clGetEventInfo**"] + #[doc = " - vkGetEventStatus"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hEvent`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + #[doc = " - ::ZE_RESULT_NOT_READY"] + #[doc = " + not signaled"] + pub fn zeEventQueryStatus(hEvent: ze_event_handle_t) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Reset an event back to not signaled state"] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - vkResetEvent"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " + `nullptr == hEvent`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeCommandListAppendEventReset( + hCommandList: ze_command_list_handle_t, + hEvent: ze_event_handle_t, + ) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Reset an event back to not signaled state"] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - vkResetEvent"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hEvent`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeEventHostReset(hEvent: ze_event_handle_t) -> ze_result_t; +} +#[repr(i32)] +#[doc = ""] +#[doc = " @brief Supported timestamp types"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_event_timestamp_type_t { + #[doc = "< wall-clock time start in GPU clocks for event. Data is uint64_t."] + ZE_EVENT_TIMESTAMP_GLOBAL_START = 0, + #[doc = "< wall-clock time end in GPU clocks for event.Data is uint64_t."] + ZE_EVENT_TIMESTAMP_GLOBAL_END = 1, + #[doc = "< context time start in GPU clocks for event. Only includes time while"] + #[doc = "< HW context is actively running on GPU. Data is uint64_t."] + ZE_EVENT_TIMESTAMP_CONTEXT_START = 2, + #[doc = "< context time end in GPU clocks for event. Only includes time while HW"] + #[doc = "< context is actively running on GPU. Data is uint64_t."] + ZE_EVENT_TIMESTAMP_CONTEXT_END = 3, +} +#[doc = ""] +#[doc = " @brief Supported timestamp types"] +pub use self::_ze_event_timestamp_type_t as ze_event_timestamp_type_t; +extern "C" { + #[doc = ""] + #[doc = " @brief Query timestamp information associated with an event. Event must come"] + #[doc = " from an event pool that was created using"] + #[doc = " ::ZE_EVENT_POOL_FLAG_TIMESTAMP flag."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hEvent`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] + #[doc = " + timestampType"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == dstptr`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeEventGetTimestamp( + hEvent: ze_event_handle_t, + timestampType: ze_event_timestamp_type_t, + dstptr: *mut ::std::os::raw::c_void, + ) -> ze_result_t; +} +#[repr(i32)] #[doc = ""] #[doc = " @brief API version of ::ze_sampler_desc_t"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _ze_sampler_desc_version_t { - #[doc = "< version 1.0"] - ZE_SAMPLER_DESC_VERSION_CURRENT = 65536, + #[doc = "< version 0.91"] + ZE_SAMPLER_DESC_VERSION_CURRENT = 91, } +#[doc = ""] +#[doc = " @brief API version of ::ze_sampler_desc_t"] pub use self::_ze_sampler_desc_version_t as ze_sampler_desc_version_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Sampler addressing modes"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -6712,8 +5422,10 @@ pub enum _ze_sampler_address_mode_t { #[doc = "< Out-of-bounds coordinates are mirrored starting from edge."] ZE_SAMPLER_ADDRESS_MODE_MIRROR = 4, } +#[doc = ""] +#[doc = " @brief Sampler addressing modes"] pub use self::_ze_sampler_address_mode_t as ze_sampler_address_mode_t; -#[repr(u32)] +#[repr(i32)] #[doc = ""] #[doc = " @brief Sampler filtering modes"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -6723,6 +5435,8 @@ pub enum _ze_sampler_filter_mode_t { #[doc = "< Out-of-bounds coordinates are wrapped back around."] ZE_SAMPLER_FILTER_MODE_LINEAR = 1, } +#[doc = ""] +#[doc = " @brief Sampler filtering modes"] pub use self::_ze_sampler_filter_mode_t as ze_sampler_filter_mode_t; #[doc = ""] #[doc = " @brief Sampler descriptor"] @@ -6801,10 +5515,6 @@ extern "C" { #[doc = " - The application may call this function from simultaneous threads."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuTexObjectCreate**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -6839,10 +5549,6 @@ extern "C" { #[doc = " threads with the same sampler handle."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] - #[doc = " @remarks"] - #[doc = " _Analogues_"] - #[doc = " - **cuModuleUnload**"] - #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] @@ -6852,375 +5558,1267 @@ extern "C" { #[doc = " - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE"] pub fn zeSamplerDestroy(hSampler: ze_sampler_handle_t) -> ze_result_t; } +#[repr(i32)] #[doc = ""] -#[doc = " @brief Handle of command list object"] -pub type zex_command_list_handle_t = ze_command_list_handle_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _zex_command_graph_handle_t { - _unused: [u8; 0], +#[doc = " @brief API version of ::ze_device_mem_alloc_desc_t"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_device_mem_alloc_desc_version_t { + #[doc = "< version 0.91"] + ZE_DEVICE_MEM_ALLOC_DESC_VERSION_CURRENT = 91, } #[doc = ""] -#[doc = " @brief Handle of driver's command graph object"] -pub type zex_command_graph_handle_t = *mut _zex_command_graph_handle_t; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum ALU_REG { - GPR0 = 0, - GPR0_1 = 1, - GPR1 = 2, - GPR1_1 = 3, - GPR2 = 4, - GPR2_1 = 5, - GPR3 = 6, - GPR3_1 = 7, - GPR4 = 8, - GPR4_1 = 9, - GPR5 = 10, - GPR5_1 = 11, - GPR6 = 12, - GPR6_1 = 13, - GPR7 = 14, - GPR7_1 = 15, - GPR8 = 16, - GPR8_1 = 17, - GPR9 = 18, - GPR9_1 = 19, - GPR10 = 20, - GPR10_1 = 21, - GPR11 = 22, - GPR11_1 = 23, - GPR12 = 24, - GPR12_1 = 25, - GPR13 = 26, - GPR13_1 = 27, - GPR14 = 28, - GPR14_1 = 29, - GPR15 = 30, - GPR15_1 = 31, - GPR_MAX = 32, - PREDICATE1 = 33, - REG_MAX = 34, - CONST0 = 35, - CONST1 = 36, - NONE = 37, - MAX = 38, -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum ALU_OP_TYPE { - ADD = 256, - SUB = 257, - AND = 258, - OR = 259, - XOR = 260, - STORE = 384, - STOREINV = 1408, - LOAD = 128, - LOAD0 = 129, - LOAD1 = 1153, - LOADINV = 1152, - NOOP = 0, - MAX = 1, -} -#[repr(u32)] +#[doc = " @brief API version of ::ze_device_mem_alloc_desc_t"] +pub use self::_ze_device_mem_alloc_desc_version_t as ze_device_mem_alloc_desc_version_t; +#[repr(i32)] +#[doc = ""] +#[doc = " @brief Supported memory allocation flags"] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum ALU_FLAG { - ACC = 49, - ZF = 50, - CF = 51, - NACC = 305, - NZF = 306, - NCF = 307, - MAX = 308, +pub enum _ze_device_mem_alloc_flag_t { + #[doc = "< implicit default behavior; uses driver-based heuristics"] + ZE_DEVICE_MEM_ALLOC_FLAG_DEFAULT = 0, + #[doc = "< device should cache allocation"] + ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED = 1, + #[doc = "< device should not cache allocation (UC)"] + ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_UNCACHED = 2, } +#[doc = ""] +#[doc = " @brief Supported memory allocation flags"] +pub use self::_ze_device_mem_alloc_flag_t as ze_device_mem_alloc_flag_t; +#[doc = ""] +#[doc = " @brief Device mem alloc descriptor"] #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _zex_alu_operation_t { - pub opType: ALU_OP_TYPE, - pub regDest: ALU_REG, - pub regSource1: ALU_REG, - pub regSource2: ALU_REG, - pub flag: ALU_FLAG, +pub struct _ze_device_mem_alloc_desc_t { + #[doc = "< [in] ::ZE_DEVICE_MEM_ALLOC_DESC_VERSION_CURRENT"] + pub version: ze_device_mem_alloc_desc_version_t, + #[doc = "< [in] flags specifying additional allocation controls"] + pub flags: ze_device_mem_alloc_flag_t, + #[doc = "< [in] ordinal of the device's local memory to allocate from;"] + #[doc = "< must be less than the count returned from ::zeDeviceGetMemoryProperties"] + pub ordinal: u32, } #[test] -fn bindgen_test_layout__zex_alu_operation_t() { +fn bindgen_test_layout__ze_device_mem_alloc_desc_t() { assert_eq!( - ::std::mem::size_of::<_zex_alu_operation_t>(), - 20usize, - concat!("Size of: ", stringify!(_zex_alu_operation_t)) + ::std::mem::size_of::<_ze_device_mem_alloc_desc_t>(), + 12usize, + concat!("Size of: ", stringify!(_ze_device_mem_alloc_desc_t)) ); assert_eq!( - ::std::mem::align_of::<_zex_alu_operation_t>(), + ::std::mem::align_of::<_ze_device_mem_alloc_desc_t>(), 4usize, - concat!("Alignment of ", stringify!(_zex_alu_operation_t)) + concat!("Alignment of ", stringify!(_ze_device_mem_alloc_desc_t)) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_zex_alu_operation_t>())).opType as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<_ze_device_mem_alloc_desc_t>())).version as *const _ as usize + }, 0usize, concat!( "Offset of field: ", - stringify!(_zex_alu_operation_t), + stringify!(_ze_device_mem_alloc_desc_t), "::", - stringify!(opType) + stringify!(version) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_zex_alu_operation_t>())).regDest as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<_ze_device_mem_alloc_desc_t>())).flags as *const _ as usize + }, 4usize, concat!( "Offset of field: ", - stringify!(_zex_alu_operation_t), + stringify!(_ze_device_mem_alloc_desc_t), "::", - stringify!(regDest) + stringify!(flags) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_zex_alu_operation_t>())).regSource1 as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<_ze_device_mem_alloc_desc_t>())).ordinal as *const _ as usize + }, 8usize, concat!( "Offset of field: ", - stringify!(_zex_alu_operation_t), + stringify!(_ze_device_mem_alloc_desc_t), "::", - stringify!(regSource1) + stringify!(ordinal) ) ); +} +#[repr(i32)] +#[doc = ""] +#[doc = " @brief API version of ::ze_host_mem_alloc_desc_t"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_host_mem_alloc_desc_version_t { + #[doc = "< version 0.91"] + ZE_HOST_MEM_ALLOC_DESC_VERSION_CURRENT = 91, +} +#[doc = ""] +#[doc = " @brief API version of ::ze_host_mem_alloc_desc_t"] +pub use self::_ze_host_mem_alloc_desc_version_t as ze_host_mem_alloc_desc_version_t; +#[repr(i32)] +#[doc = ""] +#[doc = " @brief Supported host memory allocation flags"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_host_mem_alloc_flag_t { + #[doc = "< implicit default behavior; uses driver-based heuristics"] + ZE_HOST_MEM_ALLOC_FLAG_DEFAULT = 0, + #[doc = "< host should cache allocation"] + ZE_HOST_MEM_ALLOC_FLAG_BIAS_CACHED = 1, + #[doc = "< host should not cache allocation (UC)"] + ZE_HOST_MEM_ALLOC_FLAG_BIAS_UNCACHED = 2, + #[doc = "< host memory should be allocated write-combined (WC)"] + ZE_HOST_MEM_ALLOC_FLAG_BIAS_WRITE_COMBINED = 4, +} +#[doc = ""] +#[doc = " @brief Supported host memory allocation flags"] +pub use self::_ze_host_mem_alloc_flag_t as ze_host_mem_alloc_flag_t; +#[doc = ""] +#[doc = " @brief Host mem alloc descriptor"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ze_host_mem_alloc_desc_t { + #[doc = "< [in] ::ZE_HOST_MEM_ALLOC_DESC_VERSION_CURRENT"] + pub version: ze_host_mem_alloc_desc_version_t, + #[doc = "< [in] flags specifying additional allocation controls"] + pub flags: ze_host_mem_alloc_flag_t, +} +#[test] +fn bindgen_test_layout__ze_host_mem_alloc_desc_t() { + assert_eq!( + ::std::mem::size_of::<_ze_host_mem_alloc_desc_t>(), + 8usize, + concat!("Size of: ", stringify!(_ze_host_mem_alloc_desc_t)) + ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_zex_alu_operation_t>())).regSource2 as *const _ as usize }, - 12usize, + ::std::mem::align_of::<_ze_host_mem_alloc_desc_t>(), + 4usize, + concat!("Alignment of ", stringify!(_ze_host_mem_alloc_desc_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_ze_host_mem_alloc_desc_t>())).version as *const _ as usize + }, + 0usize, concat!( "Offset of field: ", - stringify!(_zex_alu_operation_t), + stringify!(_ze_host_mem_alloc_desc_t), "::", - stringify!(regSource2) + stringify!(version) ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<_zex_alu_operation_t>())).flag as *const _ as usize }, - 16usize, + unsafe { &(*(::std::ptr::null::<_ze_host_mem_alloc_desc_t>())).flags as *const _ as usize }, + 4usize, concat!( "Offset of field: ", - stringify!(_zex_alu_operation_t), + stringify!(_ze_host_mem_alloc_desc_t), "::", - stringify!(flag) + stringify!(flags) ) ); } -pub type zex_alu_operation_t = _zex_alu_operation_t; -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum COMMANDGRAPH_TYPE { - COMMAND = 0, - CONDITION = 1, - OR = 2, - START = 3, - MAX = 4, +extern "C" { + #[doc = ""] + #[doc = " @brief Allocates memory that is shared between the host and one or more"] + #[doc = " devices"] + #[doc = ""] + #[doc = " @details"] + #[doc = " - Shared allocations share ownership between the host and one or more"] + #[doc = " devices."] + #[doc = " - Shared allocations may optionally be associated with a device by"] + #[doc = " passing a handle to the device."] + #[doc = " - Devices supporting only single-device shared access capabilities may"] + #[doc = " access shared memory associated with the device."] + #[doc = " For these devices, ownership of the allocation is shared between the"] + #[doc = " host and the associated device only."] + #[doc = " - Passing nullptr as the device handle does not associate the shared"] + #[doc = " allocation with any device."] + #[doc = " For allocations with no associated device, ownership of the allocation"] + #[doc = " is shared between the host and all devices supporting cross-device"] + #[doc = " shared access capabilities."] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hDriver`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == device_desc`"] + #[doc = " + `nullptr == host_desc`"] + #[doc = " + `nullptr == pptr`"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] + #[doc = " + `::ZE_DEVICE_MEM_ALLOC_DESC_VERSION_CURRENT < device_desc->version`"] + #[doc = " + `::ZE_HOST_MEM_ALLOC_DESC_VERSION_CURRENT < host_desc->version`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] + #[doc = " + device_desc->flags"] + #[doc = " + host_desc->flags"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT"] + #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] + #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"] + pub fn zeDriverAllocSharedMem( + hDriver: ze_driver_handle_t, + device_desc: *const ze_device_mem_alloc_desc_t, + host_desc: *const ze_host_mem_alloc_desc_t, + size: usize, + alignment: usize, + hDevice: ze_device_handle_t, + pptr: *mut *mut ::std::os::raw::c_void, + ) -> ze_result_t; } extern "C" { #[doc = ""] - #[doc = " @brief Creates a command graph on the device for submitting commands to any"] - #[doc = " command queue."] + #[doc = " @brief Allocates memory specific to a device"] #[doc = ""] #[doc = " @details"] + #[doc = " - A device allocation is owned by a specific device."] + #[doc = " - In general, a device allocation may only be accessed by the device"] + #[doc = " that owns it."] #[doc = " - The application may call this function from simultaneous threads."] - #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ARGUMENT"] - #[doc = " + nullptr == hDevice"] - #[doc = " + nullptr == desc"] - #[doc = " + nullptr == phCommandGraph"] - #[doc = " - ::ZE_RESULT_ERROR_UNKNOWN"] - #[doc = " + ::ZEX_COMMAND_GRAPH_DESC_VERSION_CURRENT < desc->version"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hDriver`"] + #[doc = " + `nullptr == hDevice`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == device_desc`"] + #[doc = " + `nullptr == pptr`"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] + #[doc = " + `::ZE_DEVICE_MEM_ALLOC_DESC_VERSION_CURRENT < device_desc->version`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] + #[doc = " + device_desc->flags"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT"] #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"] - pub fn zexCommandGraphCreate( + pub fn zeDriverAllocDeviceMem( + hDriver: ze_driver_handle_t, + device_desc: *const ze_device_mem_alloc_desc_t, + size: usize, + alignment: usize, hDevice: ze_device_handle_t, - desc: *const ze_command_list_desc_t, - phCommandGraph: *mut zex_command_graph_handle_t, + pptr: *mut *mut ::std::os::raw::c_void, ) -> ze_result_t; } extern "C" { #[doc = ""] - #[doc = " @brief Destroys a command graph."] + #[doc = " @brief Allocates host memory"] #[doc = ""] #[doc = " @details"] - #[doc = " - The implementation of this function will immediately free all Host"] - #[doc = " allocations associated with this command graph."] - #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command graph handle."] - #[doc = " - The implementation of this function should be lock-free."] + #[doc = " - A host allocation is owned by the host process."] + #[doc = " - Host allocations are accessible by the host and all devices within the"] + #[doc = " driver driver."] + #[doc = " - Host allocations are frequently used as staging areas to transfer data"] + #[doc = " to or from devices."] + #[doc = " - The application may call this function from simultaneous threads."] #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ARGUMENT"] - #[doc = " + nullptr == hCommandGraph"] - #[doc = " - ::ZE_RESULT_ERROR_UNKNOWN"] - pub fn zexCommandGraphDestroy(hCommandGraph: zex_command_graph_handle_t) -> ze_result_t; + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hDriver`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == host_desc`"] + #[doc = " + `nullptr == pptr`"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] + #[doc = " + `::ZE_HOST_MEM_ALLOC_DESC_VERSION_CURRENT < host_desc->version`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] + #[doc = " + host_desc->flags"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_ALIGNMENT"] + #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] + #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"] + pub fn zeDriverAllocHostMem( + hDriver: ze_driver_handle_t, + host_desc: *const ze_host_mem_alloc_desc_t, + size: usize, + alignment: usize, + pptr: *mut *mut ::std::os::raw::c_void, + ) -> ze_result_t; } extern "C" { #[doc = ""] - #[doc = " @brief Closes a command graph; ready to be executed by a command queue."] + #[doc = " @brief Frees allocated host memory, device memory, or shared memory"] #[doc = ""] #[doc = " @details"] - #[doc = " - The command graph will optimize the execution order of the command"] - #[doc = " lists."] - #[doc = " - A command list may **not** be reset after the command graph is closed."] + #[doc = " - The application is responsible for making sure the device is not"] + #[doc = " currently referencing the memory before it is freed"] + #[doc = " - The implementation of this function will immediately free all Host and"] + #[doc = " Device allocations associated with this memory"] #[doc = " - The application may **not** call this function from simultaneous"] - #[doc = " threads with the same command graph handle."] - #[doc = " - The implementation of this function should be lock-free."] + #[doc = " threads with the same pointer."] #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ARGUMENT"] - #[doc = " + nullptr == hCommandGraph"] - #[doc = " - ::ZE_RESULT_ERROR_UNKNOWN"] - pub fn zexCommandGraphClose(hCommandGraph: zex_command_graph_handle_t) -> ze_result_t; + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hDriver`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == ptr`"] + pub fn zeDriverFreeMem( + hDriver: ze_driver_handle_t, + ptr: *mut ::std::os::raw::c_void, + ) -> ze_result_t; +} +#[repr(i32)] +#[doc = ""] +#[doc = " @brief API version of ::ze_memory_allocation_properties_t"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_memory_allocation_properties_version_t { + #[doc = "< version 0.91"] + ZE_MEMORY_ALLOCATION_PROPERTIES_VERSION_CURRENT = 91, +} +#[doc = ""] +#[doc = " @brief API version of ::ze_memory_allocation_properties_t"] +pub use self::_ze_memory_allocation_properties_version_t as ze_memory_allocation_properties_version_t; +#[repr(i32)] +#[doc = ""] +#[doc = " @brief Memory allocation type"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_memory_type_t { + #[doc = "< the memory pointed to is of unknown type"] + ZE_MEMORY_TYPE_UNKNOWN = 0, + #[doc = "< the memory pointed to is a host allocation"] + ZE_MEMORY_TYPE_HOST = 1, + #[doc = "< the memory pointed to is a device allocation"] + ZE_MEMORY_TYPE_DEVICE = 2, + #[doc = "< the memory pointed to is a shared ownership allocation"] + ZE_MEMORY_TYPE_SHARED = 3, +} +#[doc = ""] +#[doc = " @brief Memory allocation type"] +pub use self::_ze_memory_type_t as ze_memory_type_t; +#[doc = ""] +#[doc = " @brief Memory allocation properties queried using"] +#[doc = " ::zeDriverGetMemAllocProperties"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ze_memory_allocation_properties_t { + #[doc = "< [in] ::ZE_MEMORY_ALLOCATION_PROPERTIES_VERSION_CURRENT"] + pub version: ze_memory_allocation_properties_version_t, + #[doc = "< [out] type of allocated memory"] + pub type_: ze_memory_type_t, + #[doc = "< [out] identifier for this allocation"] + pub id: u64, +} +#[test] +fn bindgen_test_layout__ze_memory_allocation_properties_t() { + assert_eq!( + ::std::mem::size_of::<_ze_memory_allocation_properties_t>(), + 16usize, + concat!("Size of: ", stringify!(_ze_memory_allocation_properties_t)) + ); + assert_eq!( + ::std::mem::align_of::<_ze_memory_allocation_properties_t>(), + 8usize, + concat!( + "Alignment of ", + stringify!(_ze_memory_allocation_properties_t) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_ze_memory_allocation_properties_t>())).version as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_ze_memory_allocation_properties_t), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_ze_memory_allocation_properties_t>())).type_ as *const _ + as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_ze_memory_allocation_properties_t), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<_ze_memory_allocation_properties_t>())).id as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_ze_memory_allocation_properties_t), + "::", + stringify!(id) + ) + ); } extern "C" { - pub fn zexCommandGraphCreateNode( - hCommandGraph: zex_command_graph_handle_t, - phCommandNode: *mut zex_command_graph_handle_t, - phParentNodes: *mut zex_command_graph_handle_t, - noParentNodes: usize, - nodeType: COMMANDGRAPH_TYPE, + #[doc = ""] + #[doc = " @brief Retrieves attributes of a memory allocation"] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hDriver`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == ptr`"] + #[doc = " + `nullptr == pMemAllocProperties`"] + pub fn zeDriverGetMemAllocProperties( + hDriver: ze_driver_handle_t, + ptr: *const ::std::os::raw::c_void, + pMemAllocProperties: *mut ze_memory_allocation_properties_t, + phDevice: *mut ze_device_handle_t, ) -> ze_result_t; } extern "C" { - pub fn zexCommandGraphCreateLoadRegImemNode( - hCommandGraph: zex_command_graph_handle_t, - phCommandNode: *mut zex_command_graph_handle_t, - phParentNodes: *mut zex_command_graph_handle_t, - noParentNodes: usize, - regDestination: ALU_REG, - regSourceAddress: ALU_REG, + #[doc = ""] + #[doc = " @brief Retrieves the base address and/or size of an allocation"] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hDriver`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == ptr`"] + pub fn zeDriverGetMemAddressRange( + hDriver: ze_driver_handle_t, + ptr: *const ::std::os::raw::c_void, + pBase: *mut *mut ::std::os::raw::c_void, + pSize: *mut usize, ) -> ze_result_t; } extern "C" { - pub fn zexCommandGraphCreateStoreRegImemNode( - hCommandGraph: zex_command_graph_handle_t, - phCommandNode: *mut zex_command_graph_handle_t, - phParentNodes: *mut zex_command_graph_handle_t, - noParentNodes: usize, - regDestinationAddress: ALU_REG, - regSource: ALU_REG, + #[doc = ""] + #[doc = " @brief Creates an IPC memory handle for the specified allocation in the"] + #[doc = " sending process"] + #[doc = ""] + #[doc = " @details"] + #[doc = " - Takes a pointer to the base of a device memory allocation and exports"] + #[doc = " it for use in another process."] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hDriver`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == ptr`"] + #[doc = " + `nullptr == pIpcHandle`"] + pub fn zeDriverGetMemIpcHandle( + hDriver: ze_driver_handle_t, + ptr: *const ::std::os::raw::c_void, + pIpcHandle: *mut ze_ipc_mem_handle_t, ) -> ze_result_t; } +#[repr(i32)] +#[doc = ""] +#[doc = " @brief Supported IPC memory flags"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_ipc_memory_flag_t { + #[doc = "< No special flags"] + ZE_IPC_MEMORY_FLAG_NONE = 0, +} +#[doc = ""] +#[doc = " @brief Supported IPC memory flags"] +pub use self::_ze_ipc_memory_flag_t as ze_ipc_memory_flag_t; extern "C" { - pub fn zexCommandGraphNodeAddChildren( - hCommandNode: zex_command_graph_handle_t, - phChildrenNodes: *mut zex_command_graph_handle_t, - noChildrenNodes: usize, + #[doc = ""] + #[doc = " @brief Opens an IPC memory handle to retrieve a device pointer in a receiving"] + #[doc = " process"] + #[doc = ""] + #[doc = " @details"] + #[doc = " - Takes an IPC memory handle from a sending process and associates it"] + #[doc = " with a device pointer usable in this process."] + #[doc = " - The device pointer in this process should not be freed with"] + #[doc = " ::zeDriverFreeMem, but rather with ::zeDriverCloseMemIpcHandle."] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hDriver`"] + #[doc = " + `nullptr == hDevice`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] + #[doc = " + flags"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == pptr`"] + pub fn zeDriverOpenMemIpcHandle( + hDriver: ze_driver_handle_t, + hDevice: ze_device_handle_t, + handle: ze_ipc_mem_handle_t, + flags: ze_ipc_memory_flag_t, + pptr: *mut *mut ::std::os::raw::c_void, + ) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Closes an IPC memory handle in a receiving process"] + #[doc = ""] + #[doc = " @details"] + #[doc = " - Closes an IPC memory handle by unmapping memory that was opened in"] + #[doc = " this process using ::zeDriverOpenMemIpcHandle."] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same pointer."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hDriver`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == ptr`"] + pub fn zeDriverCloseMemIpcHandle( + hDriver: ze_driver_handle_t, + ptr: *const ::std::os::raw::c_void, ) -> ze_result_t; } +#[repr(i32)] +#[doc = ""] +#[doc = " @brief API version of ::ze_fence_desc_t"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_fence_desc_version_t { + #[doc = "< version 0.91"] + ZE_FENCE_DESC_VERSION_CURRENT = 91, +} +#[doc = ""] +#[doc = " @brief API version of ::ze_fence_desc_t"] +pub use self::_ze_fence_desc_version_t as ze_fence_desc_version_t; +#[repr(i32)] +#[doc = ""] +#[doc = " @brief Supported fence creation flags"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_fence_flag_t { + #[doc = "< default behavior"] + ZE_FENCE_FLAG_NONE = 0, +} +#[doc = ""] +#[doc = " @brief Supported fence creation flags"] +pub use self::_ze_fence_flag_t as ze_fence_flag_t; +#[doc = ""] +#[doc = " @brief Fence descriptor"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ze_fence_desc_t { + #[doc = "< [in] ::ZE_FENCE_DESC_VERSION_CURRENT"] + pub version: ze_fence_desc_version_t, + #[doc = "< [in] creation flags"] + pub flags: ze_fence_flag_t, +} +#[test] +fn bindgen_test_layout__ze_fence_desc_t() { + assert_eq!( + ::std::mem::size_of::<_ze_fence_desc_t>(), + 8usize, + concat!("Size of: ", stringify!(_ze_fence_desc_t)) + ); + assert_eq!( + ::std::mem::align_of::<_ze_fence_desc_t>(), + 4usize, + concat!("Alignment of ", stringify!(_ze_fence_desc_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_fence_desc_t>())).version as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_ze_fence_desc_t), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_fence_desc_t>())).flags as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_ze_fence_desc_t), + "::", + stringify!(flags) + ) + ); +} extern "C" { - pub fn zexCommandGraphOpenNode( - hCommandNode: zex_command_graph_handle_t, - phCommandList: *mut zex_command_list_handle_t, + #[doc = ""] + #[doc = " @brief Creates a fence object on the device's command queue."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **vkCreateFence**"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandQueue`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == desc`"] + #[doc = " + `nullptr == phFence`"] + #[doc = " - ::ZE_RESULT_ERROR_UNSUPPORTED_VERSION"] + #[doc = " + `::ZE_FENCE_DESC_VERSION_CURRENT < desc->version`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] + #[doc = " + desc->flags"] + #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] + #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"] + pub fn zeFenceCreate( + hCommandQueue: ze_command_queue_handle_t, + desc: *const ze_fence_desc_t, + phFence: *mut ze_fence_handle_t, ) -> ze_result_t; } extern "C" { - pub fn zexCommandGraphCloseNode(hCommandNode: zex_command_graph_handle_t) -> ze_result_t; + #[doc = ""] + #[doc = " @brief Deletes a fence object."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application is responsible for making sure the device is not"] + #[doc = " currently referencing the fence before it is deleted"] + #[doc = " - The implementation of this function will immediately free all Host and"] + #[doc = " Device allocations associated with this fence"] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same fence handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **vkDestroyFence**"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hFence`"] + #[doc = " - ::ZE_RESULT_ERROR_HANDLE_OBJECT_IN_USE"] + pub fn zeFenceDestroy(hFence: ze_fence_handle_t) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief The current host thread waits on a fence to be signaled."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **vkWaitForFences**"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hFence`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + #[doc = " - ::ZE_RESULT_NOT_READY"] + #[doc = " + timeout expired"] + pub fn zeFenceHostSynchronize(hFence: ze_fence_handle_t, timeout: u32) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Queries a fence object's status."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **vkGetFenceStatus**"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hFence`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + #[doc = " - ::ZE_RESULT_NOT_READY"] + #[doc = " + not signaled"] + pub fn zeFenceQueryStatus(hFence: ze_fence_handle_t) -> ze_result_t; +} +extern "C" { + #[doc = ""] + #[doc = " @brief Reset a fence back to the not signaled state."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may call this function from simultaneous threads."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **vkResetFences**"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hFence`"] + pub fn zeFenceReset(hFence: ze_fence_handle_t) -> ze_result_t; } extern "C" { #[doc = ""] - #[doc = " @brief Reserve a section of contiguous command buffer space within the"] - #[doc = " command list."] + #[doc = " @brief Copies host, device, or shared memory."] #[doc = ""] #[doc = " @details"] - #[doc = " - The pointer returned is valid for both Host and device access."] + #[doc = " - The memory pointed to by both srcptr and dstptr must be accessible by"] + #[doc = " the device on which the command list is created."] #[doc = " - The application may **not** call this function from simultaneous"] #[doc = " threads with the same command list handle."] #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **clEnqueueCopyBuffer**"] + #[doc = " - **clEnqueueReadBuffer**"] + #[doc = " - **clEnqueueWriteBuffer**"] + #[doc = " - **clEnqueueSVMMemcpy**"] + #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ARGUMENT"] - #[doc = " + nullptr == hCommandList"] - #[doc = " + nullptr == ptr"] - #[doc = " + 0 for size"] - #[doc = " - ::ZE_RESULT_ERROR_UNKNOWN"] - pub fn zexCommandListReserveSpace( - hCommandList: zex_command_list_handle_t, + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == dstptr`"] + #[doc = " + `nullptr == srcptr`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeCommandListAppendMemoryCopy( + hCommandList: ze_command_list_handle_t, + dstptr: *mut ::std::os::raw::c_void, + srcptr: *const ::std::os::raw::c_void, size: usize, - ptr: *mut *mut ::std::os::raw::c_void, + hEvent: ze_event_handle_t, ) -> ze_result_t; } extern "C" { - pub fn zexCommandListAppendMILoadRegReg( - hCommandList: zex_command_list_handle_t, - destination: ALU_REG, - source: ALU_REG, + #[doc = ""] + #[doc = " @brief Initializes host, device, or shared memory."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The memory pointed to by dstptr must be accessible by the device on"] + #[doc = " which the command list is created."] + #[doc = " - The value to initialize memory to is described by the pattern and the"] + #[doc = " pattern size."] + #[doc = " - The pattern size must be a power of two."] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **clEnqueueFillBuffer**"] + #[doc = " - **clEnqueueSVMMemFill**"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == ptr`"] + #[doc = " + `nullptr == pattern`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeCommandListAppendMemoryFill( + hCommandList: ze_command_list_handle_t, + ptr: *mut ::std::os::raw::c_void, + pattern: *const ::std::os::raw::c_void, + pattern_size: usize, + size: usize, + hEvent: ze_event_handle_t, ) -> ze_result_t; } +#[doc = ""] +#[doc = " @brief Copy region descriptor"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ze_copy_region_t { + #[doc = "< [in] The origin x offset for region in bytes"] + pub originX: u32, + #[doc = "< [in] The origin y offset for region in rows"] + pub originY: u32, + #[doc = "< [in] The origin z offset for region in slices"] + pub originZ: u32, + #[doc = "< [in] The region width relative to origin in bytes"] + pub width: u32, + #[doc = "< [in] The region height relative to origin in rows"] + pub height: u32, + #[doc = "< [in] The region depth relative to origin in slices. Set this to 0 for"] + #[doc = "< 2D copy."] + pub depth: u32, +} +#[test] +fn bindgen_test_layout__ze_copy_region_t() { + assert_eq!( + ::std::mem::size_of::<_ze_copy_region_t>(), + 24usize, + concat!("Size of: ", stringify!(_ze_copy_region_t)) + ); + assert_eq!( + ::std::mem::align_of::<_ze_copy_region_t>(), + 4usize, + concat!("Alignment of ", stringify!(_ze_copy_region_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).originX as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_ze_copy_region_t), + "::", + stringify!(originX) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).originY as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_ze_copy_region_t), + "::", + stringify!(originY) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).originZ as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_ze_copy_region_t), + "::", + stringify!(originZ) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).width as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_ze_copy_region_t), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).height as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_ze_copy_region_t), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_copy_region_t>())).depth as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_ze_copy_region_t), + "::", + stringify!(depth) + ) + ); +} extern "C" { - pub fn zexCommandListAppendMILoadRegMem( - hCommandList: zex_command_list_handle_t, - reg: ALU_REG, - address: u64, + #[doc = ""] + #[doc = " @brief Copies a region from a 2D or 3D array of host, device, or shared"] + #[doc = " memory."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The memory pointed to by both srcptr and dstptr must be accessible by"] + #[doc = " the device on which the command list is created."] + #[doc = " - The region width, height, and depth for both src and dst must be same."] + #[doc = " The origins can be different."] + #[doc = " - The src and dst regions cannot be overlapping."] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == dstptr`"] + #[doc = " + `nullptr == dstRegion`"] + #[doc = " + `nullptr == srcptr`"] + #[doc = " + `nullptr == srcRegion`"] + #[doc = " - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeCommandListAppendMemoryCopyRegion( + hCommandList: ze_command_list_handle_t, + dstptr: *mut ::std::os::raw::c_void, + dstRegion: *const ze_copy_region_t, + dstPitch: u32, + dstSlicePitch: u32, + srcptr: *const ::std::os::raw::c_void, + srcRegion: *const ze_copy_region_t, + srcPitch: u32, + srcSlicePitch: u32, + hEvent: ze_event_handle_t, ) -> ze_result_t; } extern "C" { - pub fn zexCommandListAppendMILoadRegImm( - hCommandList: zex_command_list_handle_t, - destination: ALU_REG, - val: u32, + #[doc = ""] + #[doc = " @brief Copies a image."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - **clEnqueueCopyImage**"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " + `nullptr == hDstImage`"] + #[doc = " + `nullptr == hSrcImage`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeCommandListAppendImageCopy( + hCommandList: ze_command_list_handle_t, + hDstImage: ze_image_handle_t, + hSrcImage: ze_image_handle_t, + hEvent: ze_event_handle_t, ) -> ze_result_t; } +#[doc = ""] +#[doc = " @brief Region descriptor"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ze_image_region_t { + #[doc = "< [in] The origin x offset for region in pixels"] + pub originX: u32, + #[doc = "< [in] The origin y offset for region in pixels"] + pub originY: u32, + #[doc = "< [in] The origin z offset for region in pixels"] + pub originZ: u32, + #[doc = "< [in] The region width relative to origin in pixels"] + pub width: u32, + #[doc = "< [in] The region height relative to origin in pixels"] + pub height: u32, + #[doc = "< [in] The region depth relative to origin. For 1D or 2D images, set"] + #[doc = "< this to 1."] + pub depth: u32, +} +#[test] +fn bindgen_test_layout__ze_image_region_t() { + assert_eq!( + ::std::mem::size_of::<_ze_image_region_t>(), + 24usize, + concat!("Size of: ", stringify!(_ze_image_region_t)) + ); + assert_eq!( + ::std::mem::align_of::<_ze_image_region_t>(), + 4usize, + concat!("Alignment of ", stringify!(_ze_image_region_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).originX as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_ze_image_region_t), + "::", + stringify!(originX) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).originY as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_ze_image_region_t), + "::", + stringify!(originY) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).originZ as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_ze_image_region_t), + "::", + stringify!(originZ) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).width as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(_ze_image_region_t), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).height as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_ze_image_region_t), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_ze_image_region_t>())).depth as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(_ze_image_region_t), + "::", + stringify!(depth) + ) + ); +} extern "C" { - pub fn zexCommandListAppendMIStoreRegMem( - hCommandList: zex_command_list_handle_t, - reg: ALU_REG, - address: u64, + #[doc = ""] + #[doc = " @brief Copies a region of a image to another image."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The region width and height for both src and dst must be same. The"] + #[doc = " origins can be different."] + #[doc = " - The src and dst regions cannot be overlapping."] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " + `nullptr == hDstImage`"] + #[doc = " + `nullptr == hSrcImage`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + #[doc = " - ::ZE_RESULT_ERROR_OVERLAPPING_REGIONS"] + pub fn zeCommandListAppendImageCopyRegion( + hCommandList: ze_command_list_handle_t, + hDstImage: ze_image_handle_t, + hSrcImage: ze_image_handle_t, + pDstRegion: *const ze_image_region_t, + pSrcRegion: *const ze_image_region_t, + hEvent: ze_event_handle_t, ) -> ze_result_t; } extern "C" { - pub fn zexCommandListAppendMIMath( - hCommandList: zex_command_list_handle_t, - opArray: *mut zex_alu_operation_t, - noOperations: usize, + #[doc = ""] + #[doc = " @brief Copies from a image to device or shared memory."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The memory pointed to by dstptr must be accessible by the device on"] + #[doc = " which the command list is created."] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - clEnqueueReadImage"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " + `nullptr == hSrcImage`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == dstptr`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeCommandListAppendImageCopyToMemory( + hCommandList: ze_command_list_handle_t, + dstptr: *mut ::std::os::raw::c_void, + hSrcImage: ze_image_handle_t, + pSrcRegion: *const ze_image_region_t, + hEvent: ze_event_handle_t, ) -> ze_result_t; } extern "C" { - pub fn zexCommandQueueExecuteCommandGraphs( - hCommandQueue: ze_command_queue_handle_t, - numCommandGraphs: u32, - phCommandGraphs: *mut zex_command_graph_handle_t, - hFence: ze_fence_handle_t, + #[doc = ""] + #[doc = " @brief Copies to a image from device or shared memory."] + #[doc = ""] + #[doc = " @details"] + #[doc = " - The memory pointed to by srcptr must be accessible by the device on"] + #[doc = " which the command list is created."] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @remarks"] + #[doc = " _Analogues_"] + #[doc = " - clEnqueueWriteImage"] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " + `nullptr == hDstImage`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == srcptr`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"] + pub fn zeCommandListAppendImageCopyFromMemory( + hCommandList: ze_command_list_handle_t, + hDstImage: ze_image_handle_t, + srcptr: *const ::std::os::raw::c_void, + pDstRegion: *const ze_image_region_t, + hEvent: ze_event_handle_t, ) -> ze_result_t; } extern "C" { #[doc = ""] - #[doc = " @brief Initialize the 'One API' driver and must be called before any other"] - #[doc = " API function."] + #[doc = " @brief Asynchronously prefetches shared memory to the device associated with"] + #[doc = " the specified command list"] #[doc = ""] #[doc = " @details"] - #[doc = " - If this function is not called then all other functions will return"] - #[doc = " ::ZE_RESULT_ERROR_UNINITIALIZED."] - #[doc = " - Only one instance of a driver per process will be initialized."] - #[doc = " - This function is thread-safe for scenarios where multiple libraries"] - #[doc = " may initialize the driver simultaneously."] + #[doc = " - This is a hint to improve performance only and is not required for"] + #[doc = " correctness."] + #[doc = " - Only prefetching to the device associated with the specified command"] + #[doc = " list is supported."] + #[doc = " Prefetching to the host or to a peer device is not supported."] + #[doc = " - Prefetching may not be supported for all allocation types for all devices."] + #[doc = " If memory prefetching is not supported for the specified memory range"] + #[doc = " the prefetch hint may be ignored."] + #[doc = " - Prefetching may only be supported at a device-specific granularity,"] + #[doc = " such as at a page boundary."] + #[doc = " In this case, the memory range may be expanded such that the start and"] + #[doc = " end of the range satisfy granularity requirements."] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] #[doc = ""] #[doc = " @remarks"] #[doc = " _Analogues_"] - #[doc = " - **cuInit**"] + #[doc = " - clEnqueueSVMMigrateMem"] #[doc = ""] #[doc = " @returns"] #[doc = " - ::ZE_RESULT_SUCCESS"] #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] - #[doc = " - ::ZE_RESULT_ERROR_INVALID_ARGUMENT"] - #[doc = " + invalid value for flags"] - #[doc = " - ::ZE_RESULT_ERROR_UNKNOWN"] - #[doc = " - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY"] - pub fn zexInit(flags: ze_init_flag_t) -> ze_result_t; + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == ptr`"] + pub fn zeCommandListAppendMemoryPrefetch( + hCommandList: ze_command_list_handle_t, + ptr: *const ::std::os::raw::c_void, + size: usize, + ) -> ze_result_t; +} +#[repr(i32)] +#[doc = ""] +#[doc = " @brief Supported memory advice hints"] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _ze_memory_advice_t { + #[doc = "< hint that memory will be read from frequently and written to rarely"] + ZE_MEMORY_ADVICE_SET_READ_MOSTLY = 0, + #[doc = "< removes the affect of ::ZE_MEMORY_ADVICE_SET_READ_MOSTLY"] + ZE_MEMORY_ADVICE_CLEAR_READ_MOSTLY = 1, + #[doc = "< hint that the preferred memory location is the specified device"] + ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION = 2, + #[doc = "< removes the affect of ::ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION"] + ZE_MEMORY_ADVICE_CLEAR_PREFERRED_LOCATION = 3, + #[doc = "< hint that memory will be accessed by the specified device"] + ZE_MEMORY_ADVICE_SET_ACCESSED_BY = 4, + #[doc = "< removes the affect of ::ZE_MEMORY_ADVICE_SET_ACCESSED_BY"] + ZE_MEMORY_ADVICE_CLEAR_ACCESSED_BY = 5, + #[doc = "< hints that memory will mostly be accessed non-atomically"] + ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY = 6, + #[doc = "< removes the affect of ::ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY"] + ZE_MEMORY_ADVICE_CLEAR_NON_ATOMIC_MOSTLY = 7, + #[doc = "< hints that memory should be cached"] + ZE_MEMORY_ADVICE_BIAS_CACHED = 8, + #[doc = "< hints that memory should be not be cached"] + ZE_MEMORY_ADVICE_BIAS_UNCACHED = 9, +} +#[doc = ""] +#[doc = " @brief Supported memory advice hints"] +pub use self::_ze_memory_advice_t as ze_memory_advice_t; +extern "C" { + #[doc = ""] + #[doc = " @brief Provides advice about the use of a shared memory range"] + #[doc = ""] + #[doc = " @details"] + #[doc = " - Memory advice is a performance hint only and is not required for"] + #[doc = " functional correctness."] + #[doc = " - Memory advice can be used to override driver heuristics to explicitly"] + #[doc = " control shared memory behavior."] + #[doc = " - Not all memory advice hints may be supported for all allocation types"] + #[doc = " for all devices."] + #[doc = " If a memory advice hint is not supported by the device it will be ignored."] + #[doc = " - Memory advice may only be supported at a device-specific granularity,"] + #[doc = " such as at a page boundary."] + #[doc = " In this case, the memory range may be expanded such that the start and"] + #[doc = " end of the range satisfy granularity requirements."] + #[doc = " - The application may **not** call this function from simultaneous"] + #[doc = " threads with the same command list handle."] + #[doc = " - The implementation of this function should be lock-free."] + #[doc = ""] + #[doc = " @returns"] + #[doc = " - ::ZE_RESULT_SUCCESS"] + #[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"] + #[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"] + #[doc = " + `nullptr == hCommandList`"] + #[doc = " + `nullptr == hDevice`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"] + #[doc = " + `nullptr == ptr`"] + #[doc = " - ::ZE_RESULT_ERROR_INVALID_ENUMERATION"] + #[doc = " + advice"] + pub fn zeCommandListAppendMemAdvise( + hCommandList: ze_command_list_handle_t, + hDevice: ze_device_handle_t, + ptr: *const ::std::os::raw::c_void, + size: usize, + advice: ze_memory_advice_t, + ) -> ze_result_t; } diff --git a/level_zero-sys/src/ze_loader.lib b/level_zero-sys/src/ze_loader.lib Binary files differnew file mode 100644 index 0000000..03137fa --- /dev/null +++ b/level_zero-sys/src/ze_loader.lib |