diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 5013e698..e3d9c78c 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -13,7 +13,7 @@ use std::{ /// WARNING: If version is changed, bindings for all platforms will have to be re-generated. /// To do so, run this: /// cargo build --package onnxruntime-sys --features generate-bindings -const ORT_VERSION: &str = "1.13.1"; +const ORT_VERSION: &str = "1.14.0"; /// Base Url from which to download pre-built releases/ const ORT_RELEASE_BASE_URL: &str = "https://github.com/microsoft/onnxruntime/releases/download"; diff --git a/onnxruntime-sys/src/generated/android/aarch64/bindings.rs b/onnxruntime-sys/src/generated/android/aarch64/bindings.rs index d8152c55..1c6d82ec 100644 --- a/onnxruntime-sys/src/generated/android/aarch64/bindings.rs +++ b/onnxruntime-sys/src/generated/android/aarch64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 13; +pub const ORT_API_VERSION: u32 = 14; pub type __int32_t = ::std::os::raw::c_int; pub type __uint32_t = ::std::os::raw::c_uint; pub type __int64_t = ::std::os::raw::c_long; @@ -392,6 +392,14 @@ pub enum OrtMemType { OrtMemTypeDefault = 0, } #[repr(u32)] +#[doc = " \\brief This mimics OrtDevice type constants so they can be returned in the API"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtMemoryInfoDeviceType { + OrtMemoryInfoDeviceType_CPU = 0, + OrtMemoryInfoDeviceType_GPU = 1, + OrtMemoryInfoDeviceType_FPGA = 2, +} +#[repr(u32)] #[doc = " \\brief Algorithm to use for cuDNN Convolution Op"] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCudnnConvAlgoSearch { @@ -437,12 +445,16 @@ pub struct OrtCUDAProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief CUDA memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_CUDA_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtCUDAProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) ); assert_eq!( @@ -586,6 +598,23 @@ fn bindgen_test_layout_OrtCUDAProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief ROCM Provider Options"] #[doc = ""] @@ -624,12 +653,16 @@ pub struct OrtROCMProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief ROCM memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_ROCM_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtROCMProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtROCMProviderOptions)) ); assert_eq!( @@ -773,6 +806,23 @@ fn bindgen_test_layout_OrtROCMProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief TensorRT Provider Options"] #[doc = ""] @@ -1210,9 +1260,7 @@ pub struct OrtOpenVINOProviderOptions { pub device_id: *const ::std::os::raw::c_char, #[doc = "< 0 = Use default number of threads"] pub num_of_threads: usize, - #[doc = "< 0 = disabled, nonzero = enabled"] - pub use_compiled_network: ::std::os::raw::c_uchar, - pub blob_dump_path: *const ::std::os::raw::c_char, + pub cache_dir: *const ::std::os::raw::c_char, pub context: *mut ::std::os::raw::c_void, #[doc = "< 0 = disabled, nonzero = enabled"] pub enable_opencl_throttling: ::std::os::raw::c_uchar, @@ -1223,7 +1271,7 @@ pub struct OrtOpenVINOProviderOptions { fn bindgen_test_layout_OrtOpenVINOProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 64usize, + 56usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1299,40 +1347,23 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } test_field_num_of_threads(); - fn test_field_use_compiled_network() { + fn test_field_cache_dir() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).use_compiled_network) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).cache_dir) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), "::", - stringify!(use_compiled_network) - ) - ); - } - test_field_use_compiled_network(); - fn test_field_blob_dump_path() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).blob_dump_path) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(OrtOpenVINOProviderOptions), - "::", - stringify!(blob_dump_path) + stringify!(cache_dir) ) ); } - test_field_blob_dump_path(); + test_field_cache_dir(); fn test_field_context() { assert_eq!( unsafe { @@ -1340,7 +1371,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 48usize, + 40usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1357,7 +1388,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize }, - 56usize, + 48usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1374,7 +1405,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize }, - 57usize, + 49usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1518,6 +1549,9 @@ pub type OrtCustomCreateThreadFn = ::std::option::Option< #[doc = " Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn"] pub type OrtCustomJoinThreadFn = ::std::option::Option; +pub type RegisterCustomOpsFn = ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions, api: *const OrtApiBase) -> *mut OrtStatus, +>; #[doc = " \\brief The C API"] #[doc = ""] #[doc = " All C API functions are defined inside this structure as pointers to functions."] @@ -2825,12 +2859,98 @@ pub struct OrtApi { #[doc = " \\since Version 1.13."] pub ReleaseCANNProviderOptions: ::std::option::Option, + pub MemoryInfoGetDeviceType: ::std::option::Option< + unsafe extern "C" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemoryInfoDeviceType), + >, + pub UpdateEnvWithCustomLogLevel: ::std::option::Option< + unsafe extern "C" fn( + ort_env: *mut OrtEnv, + log_severity_level: OrtLoggingLevel, + ) -> OrtStatusPtr, + >, + pub SetGlobalIntraOpThreadAffinity: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + affinity_string: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsLibrary_V2: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + library_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsUsingFunction: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + registration_func_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_tensor: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + allocator: *mut OrtAllocator, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub HasSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, } #[test] fn bindgen_test_layout_OrtApi() { assert_eq!( ::std::mem::size_of::(), - 1800usize, + 1912usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6699,12 +6819,251 @@ fn bindgen_test_layout_OrtApi() { ); } test_field_ReleaseCANNProviderOptions(); + fn test_field_MemoryInfoGetDeviceType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetDeviceType) as usize - ptr as usize + }, + 1800usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetDeviceType) + ) + ); + } + test_field_MemoryInfoGetDeviceType(); + fn test_field_UpdateEnvWithCustomLogLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateEnvWithCustomLogLevel) as usize - ptr as usize + }, + 1808usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateEnvWithCustomLogLevel) + ) + ); + } + test_field_UpdateEnvWithCustomLogLevel(); + fn test_field_SetGlobalIntraOpThreadAffinity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalIntraOpThreadAffinity) as usize - ptr as usize + }, + 1816usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalIntraOpThreadAffinity) + ) + ); + } + test_field_SetGlobalIntraOpThreadAffinity(); + fn test_field_RegisterCustomOpsLibrary_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsLibrary_V2) as usize - ptr as usize + }, + 1824usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsLibrary_V2) + ) + ); + } + test_field_RegisterCustomOpsLibrary_V2(); + fn test_field_RegisterCustomOpsUsingFunction() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsUsingFunction) as usize - ptr as usize + }, + 1832usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsUsingFunction) + ) + ); + } + test_field_RegisterCustomOpsUsingFunction(); + fn test_field_KernelInfo_GetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputCount) as usize - ptr as usize + }, + 1840usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputCount) + ) + ); + } + test_field_KernelInfo_GetInputCount(); + fn test_field_KernelInfo_GetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputCount) as usize - ptr as usize + }, + 1848usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputCount) + ) + ); + } + test_field_KernelInfo_GetOutputCount(); + fn test_field_KernelInfo_GetInputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputName) as usize - ptr as usize + }, + 1856usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputName) + ) + ); + } + test_field_KernelInfo_GetInputName(); + fn test_field_KernelInfo_GetOutputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputName) as usize - ptr as usize + }, + 1864usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputName) + ) + ); + } + test_field_KernelInfo_GetOutputName(); + fn test_field_KernelInfo_GetInputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputTypeInfo) as usize - ptr as usize + }, + 1872usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetInputTypeInfo(); + fn test_field_KernelInfo_GetOutputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputTypeInfo) as usize - ptr as usize + }, + 1880usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetOutputTypeInfo(); + fn test_field_KernelInfoGetAttribute_tensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_tensor) as usize - ptr as usize + }, + 1888usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_tensor) + ) + ); + } + test_field_KernelInfoGetAttribute_tensor(); + fn test_field_HasSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).HasSessionConfigEntry) as usize - ptr as usize + }, + 1896usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(HasSessionConfigEntry) + ) + ); + } + test_field_HasSessionConfigEntry(); + fn test_field_GetSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSessionConfigEntry) as usize - ptr as usize + }, + 1904usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSessionConfigEntry) + ) + ); + } + test_field_GetSessionConfigEntry(); } #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCustomOpInputOutputCharacteristic { INPUT_OUTPUT_REQUIRED = 0, INPUT_OUTPUT_OPTIONAL = 1, + INPUT_OUTPUT_VARIADIC = 2, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6753,12 +7112,27 @@ pub struct OrtCustomOp { index: usize, ) -> OrtCustomOpInputOutputCharacteristic, >, + pub GetInputMemoryType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> OrtMemType, + >, + pub GetVariadicInputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicInputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, } #[test] fn bindgen_test_layout_OrtCustomOp() { assert_eq!( ::std::mem::size_of::(), - 96usize, + 136usize, concat!("Size of: ", stringify!(OrtCustomOp)) ); assert_eq!( @@ -6970,6 +7344,91 @@ fn bindgen_test_layout_OrtCustomOp() { ); } test_field_GetOutputCharacteristic(); + fn test_field_GetInputMemoryType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputMemoryType) as usize - ptr as usize + }, + 96usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputMemoryType) + ) + ); + } + test_field_GetInputMemoryType(); + fn test_field_GetVariadicInputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputMinArity) as usize - ptr as usize + }, + 104usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputMinArity) + ) + ); + } + test_field_GetVariadicInputMinArity(); + fn test_field_GetVariadicInputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputHomogeneity) as usize - ptr as usize + }, + 112usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputHomogeneity) + ) + ); + } + test_field_GetVariadicInputHomogeneity(); + fn test_field_GetVariadicOutputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputMinArity) as usize - ptr as usize + }, + 120usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputMinArity) + ) + ); + } + test_field_GetVariadicOutputMinArity(); + fn test_field_GetVariadicOutputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputHomogeneity) as usize - ptr as usize + }, + 128usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputHomogeneity) + ) + ); + } + test_field_GetVariadicOutputHomogeneity(); } extern "C" { pub fn OrtSessionOptionsAppendExecutionProvider_CUDA( diff --git a/onnxruntime-sys/src/generated/linux/aarch64/bindings.rs b/onnxruntime-sys/src/generated/linux/aarch64/bindings.rs index d8152c55..1c6d82ec 100644 --- a/onnxruntime-sys/src/generated/linux/aarch64/bindings.rs +++ b/onnxruntime-sys/src/generated/linux/aarch64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 13; +pub const ORT_API_VERSION: u32 = 14; pub type __int32_t = ::std::os::raw::c_int; pub type __uint32_t = ::std::os::raw::c_uint; pub type __int64_t = ::std::os::raw::c_long; @@ -392,6 +392,14 @@ pub enum OrtMemType { OrtMemTypeDefault = 0, } #[repr(u32)] +#[doc = " \\brief This mimics OrtDevice type constants so they can be returned in the API"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtMemoryInfoDeviceType { + OrtMemoryInfoDeviceType_CPU = 0, + OrtMemoryInfoDeviceType_GPU = 1, + OrtMemoryInfoDeviceType_FPGA = 2, +} +#[repr(u32)] #[doc = " \\brief Algorithm to use for cuDNN Convolution Op"] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCudnnConvAlgoSearch { @@ -437,12 +445,16 @@ pub struct OrtCUDAProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief CUDA memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_CUDA_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtCUDAProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) ); assert_eq!( @@ -586,6 +598,23 @@ fn bindgen_test_layout_OrtCUDAProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief ROCM Provider Options"] #[doc = ""] @@ -624,12 +653,16 @@ pub struct OrtROCMProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief ROCM memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_ROCM_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtROCMProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtROCMProviderOptions)) ); assert_eq!( @@ -773,6 +806,23 @@ fn bindgen_test_layout_OrtROCMProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief TensorRT Provider Options"] #[doc = ""] @@ -1210,9 +1260,7 @@ pub struct OrtOpenVINOProviderOptions { pub device_id: *const ::std::os::raw::c_char, #[doc = "< 0 = Use default number of threads"] pub num_of_threads: usize, - #[doc = "< 0 = disabled, nonzero = enabled"] - pub use_compiled_network: ::std::os::raw::c_uchar, - pub blob_dump_path: *const ::std::os::raw::c_char, + pub cache_dir: *const ::std::os::raw::c_char, pub context: *mut ::std::os::raw::c_void, #[doc = "< 0 = disabled, nonzero = enabled"] pub enable_opencl_throttling: ::std::os::raw::c_uchar, @@ -1223,7 +1271,7 @@ pub struct OrtOpenVINOProviderOptions { fn bindgen_test_layout_OrtOpenVINOProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 64usize, + 56usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1299,40 +1347,23 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } test_field_num_of_threads(); - fn test_field_use_compiled_network() { + fn test_field_cache_dir() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).use_compiled_network) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).cache_dir) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), "::", - stringify!(use_compiled_network) - ) - ); - } - test_field_use_compiled_network(); - fn test_field_blob_dump_path() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).blob_dump_path) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(OrtOpenVINOProviderOptions), - "::", - stringify!(blob_dump_path) + stringify!(cache_dir) ) ); } - test_field_blob_dump_path(); + test_field_cache_dir(); fn test_field_context() { assert_eq!( unsafe { @@ -1340,7 +1371,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 48usize, + 40usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1357,7 +1388,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize }, - 56usize, + 48usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1374,7 +1405,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize }, - 57usize, + 49usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1518,6 +1549,9 @@ pub type OrtCustomCreateThreadFn = ::std::option::Option< #[doc = " Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn"] pub type OrtCustomJoinThreadFn = ::std::option::Option; +pub type RegisterCustomOpsFn = ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions, api: *const OrtApiBase) -> *mut OrtStatus, +>; #[doc = " \\brief The C API"] #[doc = ""] #[doc = " All C API functions are defined inside this structure as pointers to functions."] @@ -2825,12 +2859,98 @@ pub struct OrtApi { #[doc = " \\since Version 1.13."] pub ReleaseCANNProviderOptions: ::std::option::Option, + pub MemoryInfoGetDeviceType: ::std::option::Option< + unsafe extern "C" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemoryInfoDeviceType), + >, + pub UpdateEnvWithCustomLogLevel: ::std::option::Option< + unsafe extern "C" fn( + ort_env: *mut OrtEnv, + log_severity_level: OrtLoggingLevel, + ) -> OrtStatusPtr, + >, + pub SetGlobalIntraOpThreadAffinity: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + affinity_string: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsLibrary_V2: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + library_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsUsingFunction: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + registration_func_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_tensor: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + allocator: *mut OrtAllocator, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub HasSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, } #[test] fn bindgen_test_layout_OrtApi() { assert_eq!( ::std::mem::size_of::(), - 1800usize, + 1912usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6699,12 +6819,251 @@ fn bindgen_test_layout_OrtApi() { ); } test_field_ReleaseCANNProviderOptions(); + fn test_field_MemoryInfoGetDeviceType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetDeviceType) as usize - ptr as usize + }, + 1800usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetDeviceType) + ) + ); + } + test_field_MemoryInfoGetDeviceType(); + fn test_field_UpdateEnvWithCustomLogLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateEnvWithCustomLogLevel) as usize - ptr as usize + }, + 1808usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateEnvWithCustomLogLevel) + ) + ); + } + test_field_UpdateEnvWithCustomLogLevel(); + fn test_field_SetGlobalIntraOpThreadAffinity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalIntraOpThreadAffinity) as usize - ptr as usize + }, + 1816usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalIntraOpThreadAffinity) + ) + ); + } + test_field_SetGlobalIntraOpThreadAffinity(); + fn test_field_RegisterCustomOpsLibrary_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsLibrary_V2) as usize - ptr as usize + }, + 1824usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsLibrary_V2) + ) + ); + } + test_field_RegisterCustomOpsLibrary_V2(); + fn test_field_RegisterCustomOpsUsingFunction() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsUsingFunction) as usize - ptr as usize + }, + 1832usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsUsingFunction) + ) + ); + } + test_field_RegisterCustomOpsUsingFunction(); + fn test_field_KernelInfo_GetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputCount) as usize - ptr as usize + }, + 1840usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputCount) + ) + ); + } + test_field_KernelInfo_GetInputCount(); + fn test_field_KernelInfo_GetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputCount) as usize - ptr as usize + }, + 1848usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputCount) + ) + ); + } + test_field_KernelInfo_GetOutputCount(); + fn test_field_KernelInfo_GetInputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputName) as usize - ptr as usize + }, + 1856usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputName) + ) + ); + } + test_field_KernelInfo_GetInputName(); + fn test_field_KernelInfo_GetOutputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputName) as usize - ptr as usize + }, + 1864usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputName) + ) + ); + } + test_field_KernelInfo_GetOutputName(); + fn test_field_KernelInfo_GetInputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputTypeInfo) as usize - ptr as usize + }, + 1872usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetInputTypeInfo(); + fn test_field_KernelInfo_GetOutputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputTypeInfo) as usize - ptr as usize + }, + 1880usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetOutputTypeInfo(); + fn test_field_KernelInfoGetAttribute_tensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_tensor) as usize - ptr as usize + }, + 1888usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_tensor) + ) + ); + } + test_field_KernelInfoGetAttribute_tensor(); + fn test_field_HasSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).HasSessionConfigEntry) as usize - ptr as usize + }, + 1896usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(HasSessionConfigEntry) + ) + ); + } + test_field_HasSessionConfigEntry(); + fn test_field_GetSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSessionConfigEntry) as usize - ptr as usize + }, + 1904usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSessionConfigEntry) + ) + ); + } + test_field_GetSessionConfigEntry(); } #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCustomOpInputOutputCharacteristic { INPUT_OUTPUT_REQUIRED = 0, INPUT_OUTPUT_OPTIONAL = 1, + INPUT_OUTPUT_VARIADIC = 2, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6753,12 +7112,27 @@ pub struct OrtCustomOp { index: usize, ) -> OrtCustomOpInputOutputCharacteristic, >, + pub GetInputMemoryType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> OrtMemType, + >, + pub GetVariadicInputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicInputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, } #[test] fn bindgen_test_layout_OrtCustomOp() { assert_eq!( ::std::mem::size_of::(), - 96usize, + 136usize, concat!("Size of: ", stringify!(OrtCustomOp)) ); assert_eq!( @@ -6970,6 +7344,91 @@ fn bindgen_test_layout_OrtCustomOp() { ); } test_field_GetOutputCharacteristic(); + fn test_field_GetInputMemoryType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputMemoryType) as usize - ptr as usize + }, + 96usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputMemoryType) + ) + ); + } + test_field_GetInputMemoryType(); + fn test_field_GetVariadicInputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputMinArity) as usize - ptr as usize + }, + 104usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputMinArity) + ) + ); + } + test_field_GetVariadicInputMinArity(); + fn test_field_GetVariadicInputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputHomogeneity) as usize - ptr as usize + }, + 112usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputHomogeneity) + ) + ); + } + test_field_GetVariadicInputHomogeneity(); + fn test_field_GetVariadicOutputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputMinArity) as usize - ptr as usize + }, + 120usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputMinArity) + ) + ); + } + test_field_GetVariadicOutputMinArity(); + fn test_field_GetVariadicOutputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputHomogeneity) as usize - ptr as usize + }, + 128usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputHomogeneity) + ) + ); + } + test_field_GetVariadicOutputHomogeneity(); } extern "C" { pub fn OrtSessionOptionsAppendExecutionProvider_CUDA( diff --git a/onnxruntime-sys/src/generated/linux/x86_64/bindings.rs b/onnxruntime-sys/src/generated/linux/x86_64/bindings.rs index d8152c55..1c6d82ec 100644 --- a/onnxruntime-sys/src/generated/linux/x86_64/bindings.rs +++ b/onnxruntime-sys/src/generated/linux/x86_64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 13; +pub const ORT_API_VERSION: u32 = 14; pub type __int32_t = ::std::os::raw::c_int; pub type __uint32_t = ::std::os::raw::c_uint; pub type __int64_t = ::std::os::raw::c_long; @@ -392,6 +392,14 @@ pub enum OrtMemType { OrtMemTypeDefault = 0, } #[repr(u32)] +#[doc = " \\brief This mimics OrtDevice type constants so they can be returned in the API"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtMemoryInfoDeviceType { + OrtMemoryInfoDeviceType_CPU = 0, + OrtMemoryInfoDeviceType_GPU = 1, + OrtMemoryInfoDeviceType_FPGA = 2, +} +#[repr(u32)] #[doc = " \\brief Algorithm to use for cuDNN Convolution Op"] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCudnnConvAlgoSearch { @@ -437,12 +445,16 @@ pub struct OrtCUDAProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief CUDA memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_CUDA_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtCUDAProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) ); assert_eq!( @@ -586,6 +598,23 @@ fn bindgen_test_layout_OrtCUDAProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief ROCM Provider Options"] #[doc = ""] @@ -624,12 +653,16 @@ pub struct OrtROCMProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief ROCM memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_ROCM_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtROCMProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtROCMProviderOptions)) ); assert_eq!( @@ -773,6 +806,23 @@ fn bindgen_test_layout_OrtROCMProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief TensorRT Provider Options"] #[doc = ""] @@ -1210,9 +1260,7 @@ pub struct OrtOpenVINOProviderOptions { pub device_id: *const ::std::os::raw::c_char, #[doc = "< 0 = Use default number of threads"] pub num_of_threads: usize, - #[doc = "< 0 = disabled, nonzero = enabled"] - pub use_compiled_network: ::std::os::raw::c_uchar, - pub blob_dump_path: *const ::std::os::raw::c_char, + pub cache_dir: *const ::std::os::raw::c_char, pub context: *mut ::std::os::raw::c_void, #[doc = "< 0 = disabled, nonzero = enabled"] pub enable_opencl_throttling: ::std::os::raw::c_uchar, @@ -1223,7 +1271,7 @@ pub struct OrtOpenVINOProviderOptions { fn bindgen_test_layout_OrtOpenVINOProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 64usize, + 56usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1299,40 +1347,23 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } test_field_num_of_threads(); - fn test_field_use_compiled_network() { + fn test_field_cache_dir() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).use_compiled_network) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).cache_dir) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), "::", - stringify!(use_compiled_network) - ) - ); - } - test_field_use_compiled_network(); - fn test_field_blob_dump_path() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).blob_dump_path) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(OrtOpenVINOProviderOptions), - "::", - stringify!(blob_dump_path) + stringify!(cache_dir) ) ); } - test_field_blob_dump_path(); + test_field_cache_dir(); fn test_field_context() { assert_eq!( unsafe { @@ -1340,7 +1371,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 48usize, + 40usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1357,7 +1388,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize }, - 56usize, + 48usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1374,7 +1405,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize }, - 57usize, + 49usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1518,6 +1549,9 @@ pub type OrtCustomCreateThreadFn = ::std::option::Option< #[doc = " Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn"] pub type OrtCustomJoinThreadFn = ::std::option::Option; +pub type RegisterCustomOpsFn = ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions, api: *const OrtApiBase) -> *mut OrtStatus, +>; #[doc = " \\brief The C API"] #[doc = ""] #[doc = " All C API functions are defined inside this structure as pointers to functions."] @@ -2825,12 +2859,98 @@ pub struct OrtApi { #[doc = " \\since Version 1.13."] pub ReleaseCANNProviderOptions: ::std::option::Option, + pub MemoryInfoGetDeviceType: ::std::option::Option< + unsafe extern "C" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemoryInfoDeviceType), + >, + pub UpdateEnvWithCustomLogLevel: ::std::option::Option< + unsafe extern "C" fn( + ort_env: *mut OrtEnv, + log_severity_level: OrtLoggingLevel, + ) -> OrtStatusPtr, + >, + pub SetGlobalIntraOpThreadAffinity: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + affinity_string: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsLibrary_V2: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + library_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsUsingFunction: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + registration_func_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_tensor: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + allocator: *mut OrtAllocator, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub HasSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, } #[test] fn bindgen_test_layout_OrtApi() { assert_eq!( ::std::mem::size_of::(), - 1800usize, + 1912usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6699,12 +6819,251 @@ fn bindgen_test_layout_OrtApi() { ); } test_field_ReleaseCANNProviderOptions(); + fn test_field_MemoryInfoGetDeviceType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetDeviceType) as usize - ptr as usize + }, + 1800usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetDeviceType) + ) + ); + } + test_field_MemoryInfoGetDeviceType(); + fn test_field_UpdateEnvWithCustomLogLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateEnvWithCustomLogLevel) as usize - ptr as usize + }, + 1808usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateEnvWithCustomLogLevel) + ) + ); + } + test_field_UpdateEnvWithCustomLogLevel(); + fn test_field_SetGlobalIntraOpThreadAffinity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalIntraOpThreadAffinity) as usize - ptr as usize + }, + 1816usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalIntraOpThreadAffinity) + ) + ); + } + test_field_SetGlobalIntraOpThreadAffinity(); + fn test_field_RegisterCustomOpsLibrary_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsLibrary_V2) as usize - ptr as usize + }, + 1824usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsLibrary_V2) + ) + ); + } + test_field_RegisterCustomOpsLibrary_V2(); + fn test_field_RegisterCustomOpsUsingFunction() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsUsingFunction) as usize - ptr as usize + }, + 1832usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsUsingFunction) + ) + ); + } + test_field_RegisterCustomOpsUsingFunction(); + fn test_field_KernelInfo_GetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputCount) as usize - ptr as usize + }, + 1840usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputCount) + ) + ); + } + test_field_KernelInfo_GetInputCount(); + fn test_field_KernelInfo_GetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputCount) as usize - ptr as usize + }, + 1848usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputCount) + ) + ); + } + test_field_KernelInfo_GetOutputCount(); + fn test_field_KernelInfo_GetInputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputName) as usize - ptr as usize + }, + 1856usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputName) + ) + ); + } + test_field_KernelInfo_GetInputName(); + fn test_field_KernelInfo_GetOutputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputName) as usize - ptr as usize + }, + 1864usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputName) + ) + ); + } + test_field_KernelInfo_GetOutputName(); + fn test_field_KernelInfo_GetInputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputTypeInfo) as usize - ptr as usize + }, + 1872usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetInputTypeInfo(); + fn test_field_KernelInfo_GetOutputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputTypeInfo) as usize - ptr as usize + }, + 1880usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetOutputTypeInfo(); + fn test_field_KernelInfoGetAttribute_tensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_tensor) as usize - ptr as usize + }, + 1888usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_tensor) + ) + ); + } + test_field_KernelInfoGetAttribute_tensor(); + fn test_field_HasSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).HasSessionConfigEntry) as usize - ptr as usize + }, + 1896usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(HasSessionConfigEntry) + ) + ); + } + test_field_HasSessionConfigEntry(); + fn test_field_GetSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSessionConfigEntry) as usize - ptr as usize + }, + 1904usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSessionConfigEntry) + ) + ); + } + test_field_GetSessionConfigEntry(); } #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCustomOpInputOutputCharacteristic { INPUT_OUTPUT_REQUIRED = 0, INPUT_OUTPUT_OPTIONAL = 1, + INPUT_OUTPUT_VARIADIC = 2, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6753,12 +7112,27 @@ pub struct OrtCustomOp { index: usize, ) -> OrtCustomOpInputOutputCharacteristic, >, + pub GetInputMemoryType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> OrtMemType, + >, + pub GetVariadicInputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicInputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, } #[test] fn bindgen_test_layout_OrtCustomOp() { assert_eq!( ::std::mem::size_of::(), - 96usize, + 136usize, concat!("Size of: ", stringify!(OrtCustomOp)) ); assert_eq!( @@ -6970,6 +7344,91 @@ fn bindgen_test_layout_OrtCustomOp() { ); } test_field_GetOutputCharacteristic(); + fn test_field_GetInputMemoryType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputMemoryType) as usize - ptr as usize + }, + 96usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputMemoryType) + ) + ); + } + test_field_GetInputMemoryType(); + fn test_field_GetVariadicInputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputMinArity) as usize - ptr as usize + }, + 104usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputMinArity) + ) + ); + } + test_field_GetVariadicInputMinArity(); + fn test_field_GetVariadicInputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputHomogeneity) as usize - ptr as usize + }, + 112usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputHomogeneity) + ) + ); + } + test_field_GetVariadicInputHomogeneity(); + fn test_field_GetVariadicOutputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputMinArity) as usize - ptr as usize + }, + 120usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputMinArity) + ) + ); + } + test_field_GetVariadicOutputMinArity(); + fn test_field_GetVariadicOutputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputHomogeneity) as usize - ptr as usize + }, + 128usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputHomogeneity) + ) + ); + } + test_field_GetVariadicOutputHomogeneity(); } extern "C" { pub fn OrtSessionOptionsAppendExecutionProvider_CUDA( diff --git a/onnxruntime-sys/src/generated/macos/aarch64/bindings.rs b/onnxruntime-sys/src/generated/macos/aarch64/bindings.rs index 2eb0feb4..afa6b008 100644 --- a/onnxruntime-sys/src/generated/macos/aarch64/bindings.rs +++ b/onnxruntime-sys/src/generated/macos/aarch64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 13; +pub const ORT_API_VERSION: u32 = 14; pub type __darwin_size_t = ::std::os::raw::c_ulong; #[repr(u32)] #[doc = " Copied from TensorProto::DataType"] @@ -389,6 +389,14 @@ pub enum OrtMemType { OrtMemTypeDefault = 0, } #[repr(u32)] +#[doc = " \\brief This mimics OrtDevice type constants so they can be returned in the API"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtMemoryInfoDeviceType { + OrtMemoryInfoDeviceType_CPU = 0, + OrtMemoryInfoDeviceType_GPU = 1, + OrtMemoryInfoDeviceType_FPGA = 2, +} +#[repr(u32)] #[doc = " \\brief Algorithm to use for cuDNN Convolution Op"] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCudnnConvAlgoSearch { @@ -434,12 +442,16 @@ pub struct OrtCUDAProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief CUDA memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_CUDA_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtCUDAProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) ); assert_eq!( @@ -583,6 +595,23 @@ fn bindgen_test_layout_OrtCUDAProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief ROCM Provider Options"] #[doc = ""] @@ -621,12 +650,16 @@ pub struct OrtROCMProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief ROCM memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_ROCM_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtROCMProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtROCMProviderOptions)) ); assert_eq!( @@ -770,6 +803,23 @@ fn bindgen_test_layout_OrtROCMProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief TensorRT Provider Options"] #[doc = ""] @@ -1207,9 +1257,7 @@ pub struct OrtOpenVINOProviderOptions { pub device_id: *const ::std::os::raw::c_char, #[doc = "< 0 = Use default number of threads"] pub num_of_threads: usize, - #[doc = "< 0 = disabled, nonzero = enabled"] - pub use_compiled_network: ::std::os::raw::c_uchar, - pub blob_dump_path: *const ::std::os::raw::c_char, + pub cache_dir: *const ::std::os::raw::c_char, pub context: *mut ::std::os::raw::c_void, #[doc = "< 0 = disabled, nonzero = enabled"] pub enable_opencl_throttling: ::std::os::raw::c_uchar, @@ -1220,7 +1268,7 @@ pub struct OrtOpenVINOProviderOptions { fn bindgen_test_layout_OrtOpenVINOProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 64usize, + 56usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1296,40 +1344,23 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } test_field_num_of_threads(); - fn test_field_use_compiled_network() { + fn test_field_cache_dir() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).use_compiled_network) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).cache_dir) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), "::", - stringify!(use_compiled_network) - ) - ); - } - test_field_use_compiled_network(); - fn test_field_blob_dump_path() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).blob_dump_path) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(OrtOpenVINOProviderOptions), - "::", - stringify!(blob_dump_path) + stringify!(cache_dir) ) ); } - test_field_blob_dump_path(); + test_field_cache_dir(); fn test_field_context() { assert_eq!( unsafe { @@ -1337,7 +1368,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 48usize, + 40usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1354,7 +1385,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize }, - 56usize, + 48usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1371,7 +1402,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize }, - 57usize, + 49usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1515,6 +1546,9 @@ pub type OrtCustomCreateThreadFn = ::std::option::Option< #[doc = " Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn"] pub type OrtCustomJoinThreadFn = ::std::option::Option; +pub type RegisterCustomOpsFn = ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions, api: *const OrtApiBase) -> *mut OrtStatus, +>; #[doc = " \\brief The C API"] #[doc = ""] #[doc = " All C API functions are defined inside this structure as pointers to functions."] @@ -2822,12 +2856,98 @@ pub struct OrtApi { #[doc = " \\since Version 1.13."] pub ReleaseCANNProviderOptions: ::std::option::Option, + pub MemoryInfoGetDeviceType: ::std::option::Option< + unsafe extern "C" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemoryInfoDeviceType), + >, + pub UpdateEnvWithCustomLogLevel: ::std::option::Option< + unsafe extern "C" fn( + ort_env: *mut OrtEnv, + log_severity_level: OrtLoggingLevel, + ) -> OrtStatusPtr, + >, + pub SetGlobalIntraOpThreadAffinity: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + affinity_string: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsLibrary_V2: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + library_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsUsingFunction: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + registration_func_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_tensor: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + allocator: *mut OrtAllocator, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub HasSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, } #[test] fn bindgen_test_layout_OrtApi() { assert_eq!( ::std::mem::size_of::(), - 1800usize, + 1912usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6696,12 +6816,251 @@ fn bindgen_test_layout_OrtApi() { ); } test_field_ReleaseCANNProviderOptions(); + fn test_field_MemoryInfoGetDeviceType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetDeviceType) as usize - ptr as usize + }, + 1800usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetDeviceType) + ) + ); + } + test_field_MemoryInfoGetDeviceType(); + fn test_field_UpdateEnvWithCustomLogLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateEnvWithCustomLogLevel) as usize - ptr as usize + }, + 1808usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateEnvWithCustomLogLevel) + ) + ); + } + test_field_UpdateEnvWithCustomLogLevel(); + fn test_field_SetGlobalIntraOpThreadAffinity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalIntraOpThreadAffinity) as usize - ptr as usize + }, + 1816usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalIntraOpThreadAffinity) + ) + ); + } + test_field_SetGlobalIntraOpThreadAffinity(); + fn test_field_RegisterCustomOpsLibrary_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsLibrary_V2) as usize - ptr as usize + }, + 1824usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsLibrary_V2) + ) + ); + } + test_field_RegisterCustomOpsLibrary_V2(); + fn test_field_RegisterCustomOpsUsingFunction() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsUsingFunction) as usize - ptr as usize + }, + 1832usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsUsingFunction) + ) + ); + } + test_field_RegisterCustomOpsUsingFunction(); + fn test_field_KernelInfo_GetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputCount) as usize - ptr as usize + }, + 1840usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputCount) + ) + ); + } + test_field_KernelInfo_GetInputCount(); + fn test_field_KernelInfo_GetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputCount) as usize - ptr as usize + }, + 1848usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputCount) + ) + ); + } + test_field_KernelInfo_GetOutputCount(); + fn test_field_KernelInfo_GetInputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputName) as usize - ptr as usize + }, + 1856usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputName) + ) + ); + } + test_field_KernelInfo_GetInputName(); + fn test_field_KernelInfo_GetOutputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputName) as usize - ptr as usize + }, + 1864usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputName) + ) + ); + } + test_field_KernelInfo_GetOutputName(); + fn test_field_KernelInfo_GetInputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputTypeInfo) as usize - ptr as usize + }, + 1872usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetInputTypeInfo(); + fn test_field_KernelInfo_GetOutputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputTypeInfo) as usize - ptr as usize + }, + 1880usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetOutputTypeInfo(); + fn test_field_KernelInfoGetAttribute_tensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_tensor) as usize - ptr as usize + }, + 1888usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_tensor) + ) + ); + } + test_field_KernelInfoGetAttribute_tensor(); + fn test_field_HasSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).HasSessionConfigEntry) as usize - ptr as usize + }, + 1896usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(HasSessionConfigEntry) + ) + ); + } + test_field_HasSessionConfigEntry(); + fn test_field_GetSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSessionConfigEntry) as usize - ptr as usize + }, + 1904usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSessionConfigEntry) + ) + ); + } + test_field_GetSessionConfigEntry(); } #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCustomOpInputOutputCharacteristic { INPUT_OUTPUT_REQUIRED = 0, INPUT_OUTPUT_OPTIONAL = 1, + INPUT_OUTPUT_VARIADIC = 2, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6750,12 +7109,27 @@ pub struct OrtCustomOp { index: usize, ) -> OrtCustomOpInputOutputCharacteristic, >, + pub GetInputMemoryType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> OrtMemType, + >, + pub GetVariadicInputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicInputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, } #[test] fn bindgen_test_layout_OrtCustomOp() { assert_eq!( ::std::mem::size_of::(), - 96usize, + 136usize, concat!("Size of: ", stringify!(OrtCustomOp)) ); assert_eq!( @@ -6967,6 +7341,91 @@ fn bindgen_test_layout_OrtCustomOp() { ); } test_field_GetOutputCharacteristic(); + fn test_field_GetInputMemoryType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputMemoryType) as usize - ptr as usize + }, + 96usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputMemoryType) + ) + ); + } + test_field_GetInputMemoryType(); + fn test_field_GetVariadicInputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputMinArity) as usize - ptr as usize + }, + 104usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputMinArity) + ) + ); + } + test_field_GetVariadicInputMinArity(); + fn test_field_GetVariadicInputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputHomogeneity) as usize - ptr as usize + }, + 112usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputHomogeneity) + ) + ); + } + test_field_GetVariadicInputHomogeneity(); + fn test_field_GetVariadicOutputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputMinArity) as usize - ptr as usize + }, + 120usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputMinArity) + ) + ); + } + test_field_GetVariadicOutputMinArity(); + fn test_field_GetVariadicOutputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputHomogeneity) as usize - ptr as usize + }, + 128usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputHomogeneity) + ) + ); + } + test_field_GetVariadicOutputHomogeneity(); } extern "C" { pub fn OrtSessionOptionsAppendExecutionProvider_CUDA( diff --git a/onnxruntime-sys/src/generated/macos/x86_64/bindings.rs b/onnxruntime-sys/src/generated/macos/x86_64/bindings.rs index 2eb0feb4..afa6b008 100644 --- a/onnxruntime-sys/src/generated/macos/x86_64/bindings.rs +++ b/onnxruntime-sys/src/generated/macos/x86_64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 13; +pub const ORT_API_VERSION: u32 = 14; pub type __darwin_size_t = ::std::os::raw::c_ulong; #[repr(u32)] #[doc = " Copied from TensorProto::DataType"] @@ -389,6 +389,14 @@ pub enum OrtMemType { OrtMemTypeDefault = 0, } #[repr(u32)] +#[doc = " \\brief This mimics OrtDevice type constants so they can be returned in the API"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtMemoryInfoDeviceType { + OrtMemoryInfoDeviceType_CPU = 0, + OrtMemoryInfoDeviceType_GPU = 1, + OrtMemoryInfoDeviceType_FPGA = 2, +} +#[repr(u32)] #[doc = " \\brief Algorithm to use for cuDNN Convolution Op"] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCudnnConvAlgoSearch { @@ -434,12 +442,16 @@ pub struct OrtCUDAProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief CUDA memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_CUDA_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtCUDAProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) ); assert_eq!( @@ -583,6 +595,23 @@ fn bindgen_test_layout_OrtCUDAProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief ROCM Provider Options"] #[doc = ""] @@ -621,12 +650,16 @@ pub struct OrtROCMProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief ROCM memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_ROCM_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtROCMProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtROCMProviderOptions)) ); assert_eq!( @@ -770,6 +803,23 @@ fn bindgen_test_layout_OrtROCMProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief TensorRT Provider Options"] #[doc = ""] @@ -1207,9 +1257,7 @@ pub struct OrtOpenVINOProviderOptions { pub device_id: *const ::std::os::raw::c_char, #[doc = "< 0 = Use default number of threads"] pub num_of_threads: usize, - #[doc = "< 0 = disabled, nonzero = enabled"] - pub use_compiled_network: ::std::os::raw::c_uchar, - pub blob_dump_path: *const ::std::os::raw::c_char, + pub cache_dir: *const ::std::os::raw::c_char, pub context: *mut ::std::os::raw::c_void, #[doc = "< 0 = disabled, nonzero = enabled"] pub enable_opencl_throttling: ::std::os::raw::c_uchar, @@ -1220,7 +1268,7 @@ pub struct OrtOpenVINOProviderOptions { fn bindgen_test_layout_OrtOpenVINOProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 64usize, + 56usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1296,40 +1344,23 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } test_field_num_of_threads(); - fn test_field_use_compiled_network() { + fn test_field_cache_dir() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).use_compiled_network) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).cache_dir) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), "::", - stringify!(use_compiled_network) - ) - ); - } - test_field_use_compiled_network(); - fn test_field_blob_dump_path() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).blob_dump_path) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(OrtOpenVINOProviderOptions), - "::", - stringify!(blob_dump_path) + stringify!(cache_dir) ) ); } - test_field_blob_dump_path(); + test_field_cache_dir(); fn test_field_context() { assert_eq!( unsafe { @@ -1337,7 +1368,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 48usize, + 40usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1354,7 +1385,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize }, - 56usize, + 48usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1371,7 +1402,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize }, - 57usize, + 49usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1515,6 +1546,9 @@ pub type OrtCustomCreateThreadFn = ::std::option::Option< #[doc = " Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn"] pub type OrtCustomJoinThreadFn = ::std::option::Option; +pub type RegisterCustomOpsFn = ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions, api: *const OrtApiBase) -> *mut OrtStatus, +>; #[doc = " \\brief The C API"] #[doc = ""] #[doc = " All C API functions are defined inside this structure as pointers to functions."] @@ -2822,12 +2856,98 @@ pub struct OrtApi { #[doc = " \\since Version 1.13."] pub ReleaseCANNProviderOptions: ::std::option::Option, + pub MemoryInfoGetDeviceType: ::std::option::Option< + unsafe extern "C" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemoryInfoDeviceType), + >, + pub UpdateEnvWithCustomLogLevel: ::std::option::Option< + unsafe extern "C" fn( + ort_env: *mut OrtEnv, + log_severity_level: OrtLoggingLevel, + ) -> OrtStatusPtr, + >, + pub SetGlobalIntraOpThreadAffinity: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + affinity_string: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsLibrary_V2: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + library_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsUsingFunction: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + registration_func_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_tensor: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + allocator: *mut OrtAllocator, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub HasSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, } #[test] fn bindgen_test_layout_OrtApi() { assert_eq!( ::std::mem::size_of::(), - 1800usize, + 1912usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6696,12 +6816,251 @@ fn bindgen_test_layout_OrtApi() { ); } test_field_ReleaseCANNProviderOptions(); + fn test_field_MemoryInfoGetDeviceType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetDeviceType) as usize - ptr as usize + }, + 1800usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetDeviceType) + ) + ); + } + test_field_MemoryInfoGetDeviceType(); + fn test_field_UpdateEnvWithCustomLogLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateEnvWithCustomLogLevel) as usize - ptr as usize + }, + 1808usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateEnvWithCustomLogLevel) + ) + ); + } + test_field_UpdateEnvWithCustomLogLevel(); + fn test_field_SetGlobalIntraOpThreadAffinity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalIntraOpThreadAffinity) as usize - ptr as usize + }, + 1816usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalIntraOpThreadAffinity) + ) + ); + } + test_field_SetGlobalIntraOpThreadAffinity(); + fn test_field_RegisterCustomOpsLibrary_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsLibrary_V2) as usize - ptr as usize + }, + 1824usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsLibrary_V2) + ) + ); + } + test_field_RegisterCustomOpsLibrary_V2(); + fn test_field_RegisterCustomOpsUsingFunction() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsUsingFunction) as usize - ptr as usize + }, + 1832usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsUsingFunction) + ) + ); + } + test_field_RegisterCustomOpsUsingFunction(); + fn test_field_KernelInfo_GetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputCount) as usize - ptr as usize + }, + 1840usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputCount) + ) + ); + } + test_field_KernelInfo_GetInputCount(); + fn test_field_KernelInfo_GetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputCount) as usize - ptr as usize + }, + 1848usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputCount) + ) + ); + } + test_field_KernelInfo_GetOutputCount(); + fn test_field_KernelInfo_GetInputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputName) as usize - ptr as usize + }, + 1856usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputName) + ) + ); + } + test_field_KernelInfo_GetInputName(); + fn test_field_KernelInfo_GetOutputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputName) as usize - ptr as usize + }, + 1864usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputName) + ) + ); + } + test_field_KernelInfo_GetOutputName(); + fn test_field_KernelInfo_GetInputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputTypeInfo) as usize - ptr as usize + }, + 1872usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetInputTypeInfo(); + fn test_field_KernelInfo_GetOutputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputTypeInfo) as usize - ptr as usize + }, + 1880usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetOutputTypeInfo(); + fn test_field_KernelInfoGetAttribute_tensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_tensor) as usize - ptr as usize + }, + 1888usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_tensor) + ) + ); + } + test_field_KernelInfoGetAttribute_tensor(); + fn test_field_HasSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).HasSessionConfigEntry) as usize - ptr as usize + }, + 1896usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(HasSessionConfigEntry) + ) + ); + } + test_field_HasSessionConfigEntry(); + fn test_field_GetSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSessionConfigEntry) as usize - ptr as usize + }, + 1904usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSessionConfigEntry) + ) + ); + } + test_field_GetSessionConfigEntry(); } #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCustomOpInputOutputCharacteristic { INPUT_OUTPUT_REQUIRED = 0, INPUT_OUTPUT_OPTIONAL = 1, + INPUT_OUTPUT_VARIADIC = 2, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6750,12 +7109,27 @@ pub struct OrtCustomOp { index: usize, ) -> OrtCustomOpInputOutputCharacteristic, >, + pub GetInputMemoryType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> OrtMemType, + >, + pub GetVariadicInputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicInputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, } #[test] fn bindgen_test_layout_OrtCustomOp() { assert_eq!( ::std::mem::size_of::(), - 96usize, + 136usize, concat!("Size of: ", stringify!(OrtCustomOp)) ); assert_eq!( @@ -6967,6 +7341,91 @@ fn bindgen_test_layout_OrtCustomOp() { ); } test_field_GetOutputCharacteristic(); + fn test_field_GetInputMemoryType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputMemoryType) as usize - ptr as usize + }, + 96usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputMemoryType) + ) + ); + } + test_field_GetInputMemoryType(); + fn test_field_GetVariadicInputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputMinArity) as usize - ptr as usize + }, + 104usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputMinArity) + ) + ); + } + test_field_GetVariadicInputMinArity(); + fn test_field_GetVariadicInputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputHomogeneity) as usize - ptr as usize + }, + 112usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputHomogeneity) + ) + ); + } + test_field_GetVariadicInputHomogeneity(); + fn test_field_GetVariadicOutputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputMinArity) as usize - ptr as usize + }, + 120usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputMinArity) + ) + ); + } + test_field_GetVariadicOutputMinArity(); + fn test_field_GetVariadicOutputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputHomogeneity) as usize - ptr as usize + }, + 128usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputHomogeneity) + ) + ); + } + test_field_GetVariadicOutputHomogeneity(); } extern "C" { pub fn OrtSessionOptionsAppendExecutionProvider_CUDA( diff --git a/onnxruntime-sys/src/generated/windows/x86/bindings.rs b/onnxruntime-sys/src/generated/windows/x86/bindings.rs index 2c371c3b..77931f08 100644 --- a/onnxruntime-sys/src/generated/windows/x86/bindings.rs +++ b/onnxruntime-sys/src/generated/windows/x86/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 13; +pub const ORT_API_VERSION: u32 = 14; pub type wchar_t = ::std::os::raw::c_ushort; #[repr(i32)] #[doc = " Copied from TensorProto::DataType"] @@ -392,6 +392,14 @@ pub enum OrtMemType { OrtMemTypeDefault = 0, } #[repr(i32)] +#[doc = " \\brief This mimics OrtDevice type constants so they can be returned in the API"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtMemoryInfoDeviceType { + OrtMemoryInfoDeviceType_CPU = 0, + OrtMemoryInfoDeviceType_GPU = 1, + OrtMemoryInfoDeviceType_FPGA = 2, +} +#[repr(i32)] #[doc = " \\brief Algorithm to use for cuDNN Convolution Op"] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCudnnConvAlgoSearch { @@ -437,12 +445,16 @@ pub struct OrtCUDAProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief CUDA memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_CUDA_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtCUDAProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 32usize, + 36usize, concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) ); assert_eq!( @@ -586,6 +598,23 @@ fn bindgen_test_layout_OrtCUDAProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief ROCM Provider Options"] #[doc = ""] @@ -624,12 +653,16 @@ pub struct OrtROCMProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief ROCM memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_ROCM_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtROCMProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 32usize, + 36usize, concat!("Size of: ", stringify!(OrtROCMProviderOptions)) ); assert_eq!( @@ -773,6 +806,23 @@ fn bindgen_test_layout_OrtROCMProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief TensorRT Provider Options"] #[doc = ""] @@ -1210,9 +1260,7 @@ pub struct OrtOpenVINOProviderOptions { pub device_id: *const ::std::os::raw::c_char, #[doc = "< 0 = Use default number of threads"] pub num_of_threads: usize, - #[doc = "< 0 = disabled, nonzero = enabled"] - pub use_compiled_network: ::std::os::raw::c_uchar, - pub blob_dump_path: *const ::std::os::raw::c_char, + pub cache_dir: *const ::std::os::raw::c_char, pub context: *mut ::std::os::raw::c_void, #[doc = "< 0 = disabled, nonzero = enabled"] pub enable_opencl_throttling: ::std::os::raw::c_uchar, @@ -1223,7 +1271,7 @@ pub struct OrtOpenVINOProviderOptions { fn bindgen_test_layout_OrtOpenVINOProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 32usize, + 28usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1299,40 +1347,23 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } test_field_num_of_threads(); - fn test_field_use_compiled_network() { + fn test_field_cache_dir() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).use_compiled_network) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).cache_dir) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), "::", - stringify!(use_compiled_network) - ) - ); - } - test_field_use_compiled_network(); - fn test_field_blob_dump_path() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).blob_dump_path) as usize - ptr as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(OrtOpenVINOProviderOptions), - "::", - stringify!(blob_dump_path) + stringify!(cache_dir) ) ); } - test_field_blob_dump_path(); + test_field_cache_dir(); fn test_field_context() { assert_eq!( unsafe { @@ -1340,7 +1371,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 24usize, + 20usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1357,7 +1388,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize }, - 28usize, + 24usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1374,7 +1405,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize }, - 29usize, + 25usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1518,6 +1549,12 @@ pub type OrtCustomCreateThreadFn = ::std::option::Option< #[doc = " Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn"] pub type OrtCustomJoinThreadFn = ::std::option::Option; +pub type RegisterCustomOpsFn = ::std::option::Option< + unsafe extern "stdcall" fn( + options: *mut OrtSessionOptions, + api: *const OrtApiBase, + ) -> *mut OrtStatus, +>; #[doc = " \\brief The C API"] #[doc = ""] #[doc = " All C API functions are defined inside this structure as pointers to functions."] @@ -2865,12 +2902,98 @@ pub struct OrtApi { #[doc = " \\since Version 1.13."] pub ReleaseCANNProviderOptions: ::std::option::Option, + pub MemoryInfoGetDeviceType: ::std::option::Option< + unsafe extern "stdcall" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemoryInfoDeviceType), + >, + pub UpdateEnvWithCustomLogLevel: ::std::option::Option< + unsafe extern "stdcall" fn( + ort_env: *mut OrtEnv, + log_severity_level: OrtLoggingLevel, + ) -> OrtStatusPtr, + >, + pub SetGlobalIntraOpThreadAffinity: ::std::option::Option< + unsafe extern "stdcall" fn( + tp_options: *mut OrtThreadingOptions, + affinity_string: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsLibrary_V2: ::std::option::Option< + unsafe extern "stdcall" fn( + options: *mut OrtSessionOptions, + library_name: *const wchar_t, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsUsingFunction: ::std::option::Option< + unsafe extern "stdcall" fn( + options: *mut OrtSessionOptions, + registration_func_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputCount: ::std::option::Option< + unsafe extern "stdcall" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputCount: ::std::option::Option< + unsafe extern "stdcall" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputName: ::std::option::Option< + unsafe extern "stdcall" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputName: ::std::option::Option< + unsafe extern "stdcall" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputTypeInfo: ::std::option::Option< + unsafe extern "stdcall" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputTypeInfo: ::std::option::Option< + unsafe extern "stdcall" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_tensor: ::std::option::Option< + unsafe extern "stdcall" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + allocator: *mut OrtAllocator, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub HasSessionConfigEntry: ::std::option::Option< + unsafe extern "stdcall" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetSessionConfigEntry: ::std::option::Option< + unsafe extern "stdcall" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, } #[test] fn bindgen_test_layout_OrtApi() { assert_eq!( ::std::mem::size_of::(), - 900usize, + 956usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6739,12 +6862,251 @@ fn bindgen_test_layout_OrtApi() { ); } test_field_ReleaseCANNProviderOptions(); + fn test_field_MemoryInfoGetDeviceType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetDeviceType) as usize - ptr as usize + }, + 900usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetDeviceType) + ) + ); + } + test_field_MemoryInfoGetDeviceType(); + fn test_field_UpdateEnvWithCustomLogLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateEnvWithCustomLogLevel) as usize - ptr as usize + }, + 904usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateEnvWithCustomLogLevel) + ) + ); + } + test_field_UpdateEnvWithCustomLogLevel(); + fn test_field_SetGlobalIntraOpThreadAffinity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalIntraOpThreadAffinity) as usize - ptr as usize + }, + 908usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalIntraOpThreadAffinity) + ) + ); + } + test_field_SetGlobalIntraOpThreadAffinity(); + fn test_field_RegisterCustomOpsLibrary_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsLibrary_V2) as usize - ptr as usize + }, + 912usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsLibrary_V2) + ) + ); + } + test_field_RegisterCustomOpsLibrary_V2(); + fn test_field_RegisterCustomOpsUsingFunction() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsUsingFunction) as usize - ptr as usize + }, + 916usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsUsingFunction) + ) + ); + } + test_field_RegisterCustomOpsUsingFunction(); + fn test_field_KernelInfo_GetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputCount) as usize - ptr as usize + }, + 920usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputCount) + ) + ); + } + test_field_KernelInfo_GetInputCount(); + fn test_field_KernelInfo_GetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputCount) as usize - ptr as usize + }, + 924usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputCount) + ) + ); + } + test_field_KernelInfo_GetOutputCount(); + fn test_field_KernelInfo_GetInputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputName) as usize - ptr as usize + }, + 928usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputName) + ) + ); + } + test_field_KernelInfo_GetInputName(); + fn test_field_KernelInfo_GetOutputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputName) as usize - ptr as usize + }, + 932usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputName) + ) + ); + } + test_field_KernelInfo_GetOutputName(); + fn test_field_KernelInfo_GetInputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputTypeInfo) as usize - ptr as usize + }, + 936usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetInputTypeInfo(); + fn test_field_KernelInfo_GetOutputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputTypeInfo) as usize - ptr as usize + }, + 940usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetOutputTypeInfo(); + fn test_field_KernelInfoGetAttribute_tensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_tensor) as usize - ptr as usize + }, + 944usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_tensor) + ) + ); + } + test_field_KernelInfoGetAttribute_tensor(); + fn test_field_HasSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).HasSessionConfigEntry) as usize - ptr as usize + }, + 948usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(HasSessionConfigEntry) + ) + ); + } + test_field_HasSessionConfigEntry(); + fn test_field_GetSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSessionConfigEntry) as usize - ptr as usize + }, + 952usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSessionConfigEntry) + ) + ); + } + test_field_GetSessionConfigEntry(); } #[repr(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCustomOpInputOutputCharacteristic { INPUT_OUTPUT_REQUIRED = 0, INPUT_OUTPUT_OPTIONAL = 1, + INPUT_OUTPUT_VARIADIC = 2, } #[repr(C)] #[derive(Copy, Clone)] @@ -6799,12 +7161,27 @@ pub struct OrtCustomOp { index: usize, ) -> OrtCustomOpInputOutputCharacteristic, >, + pub GetInputMemoryType: ::std::option::Option< + unsafe extern "stdcall" fn(op: *const OrtCustomOp, index: usize) -> OrtMemType, + >, + pub GetVariadicInputMinArity: ::std::option::Option< + unsafe extern "stdcall" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicInputHomogeneity: ::std::option::Option< + unsafe extern "stdcall" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputMinArity: ::std::option::Option< + unsafe extern "stdcall" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputHomogeneity: ::std::option::Option< + unsafe extern "stdcall" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, } #[test] fn bindgen_test_layout_OrtCustomOp() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 68usize, concat!("Size of: ", stringify!(OrtCustomOp)) ); assert_eq!( @@ -7016,6 +7393,91 @@ fn bindgen_test_layout_OrtCustomOp() { ); } test_field_GetOutputCharacteristic(); + fn test_field_GetInputMemoryType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputMemoryType) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputMemoryType) + ) + ); + } + test_field_GetInputMemoryType(); + fn test_field_GetVariadicInputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputMinArity) as usize - ptr as usize + }, + 52usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputMinArity) + ) + ); + } + test_field_GetVariadicInputMinArity(); + fn test_field_GetVariadicInputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputHomogeneity) as usize - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputHomogeneity) + ) + ); + } + test_field_GetVariadicInputHomogeneity(); + fn test_field_GetVariadicOutputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputMinArity) as usize - ptr as usize + }, + 60usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputMinArity) + ) + ); + } + test_field_GetVariadicOutputMinArity(); + fn test_field_GetVariadicOutputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputHomogeneity) as usize - ptr as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputHomogeneity) + ) + ); + } + test_field_GetVariadicOutputHomogeneity(); } extern "stdcall" { pub fn OrtSessionOptionsAppendExecutionProvider_CUDA( diff --git a/onnxruntime-sys/src/generated/windows/x86_64/bindings.rs b/onnxruntime-sys/src/generated/windows/x86_64/bindings.rs index 6ba4ec19..84c61085 100644 --- a/onnxruntime-sys/src/generated/windows/x86_64/bindings.rs +++ b/onnxruntime-sys/src/generated/windows/x86_64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 13; +pub const ORT_API_VERSION: u32 = 14; pub type wchar_t = ::std::os::raw::c_ushort; #[repr(i32)] #[doc = " Copied from TensorProto::DataType"] @@ -389,6 +389,14 @@ pub enum OrtMemType { OrtMemTypeDefault = 0, } #[repr(i32)] +#[doc = " \\brief This mimics OrtDevice type constants so they can be returned in the API"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtMemoryInfoDeviceType { + OrtMemoryInfoDeviceType_CPU = 0, + OrtMemoryInfoDeviceType_GPU = 1, + OrtMemoryInfoDeviceType_FPGA = 2, +} +#[repr(i32)] #[doc = " \\brief Algorithm to use for cuDNN Convolution Op"] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCudnnConvAlgoSearch { @@ -434,12 +442,16 @@ pub struct OrtCUDAProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief CUDA memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_CUDA_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtCUDAProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) ); assert_eq!( @@ -583,6 +595,23 @@ fn bindgen_test_layout_OrtCUDAProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief ROCM Provider Options"] #[doc = ""] @@ -621,12 +650,16 @@ pub struct OrtROCMProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief ROCM memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_ROCM_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtROCMProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtROCMProviderOptions)) ); assert_eq!( @@ -770,6 +803,23 @@ fn bindgen_test_layout_OrtROCMProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief TensorRT Provider Options"] #[doc = ""] @@ -1207,9 +1257,7 @@ pub struct OrtOpenVINOProviderOptions { pub device_id: *const ::std::os::raw::c_char, #[doc = "< 0 = Use default number of threads"] pub num_of_threads: usize, - #[doc = "< 0 = disabled, nonzero = enabled"] - pub use_compiled_network: ::std::os::raw::c_uchar, - pub blob_dump_path: *const ::std::os::raw::c_char, + pub cache_dir: *const ::std::os::raw::c_char, pub context: *mut ::std::os::raw::c_void, #[doc = "< 0 = disabled, nonzero = enabled"] pub enable_opencl_throttling: ::std::os::raw::c_uchar, @@ -1220,7 +1268,7 @@ pub struct OrtOpenVINOProviderOptions { fn bindgen_test_layout_OrtOpenVINOProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 64usize, + 56usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1296,40 +1344,23 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } test_field_num_of_threads(); - fn test_field_use_compiled_network() { + fn test_field_cache_dir() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).use_compiled_network) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).cache_dir) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), "::", - stringify!(use_compiled_network) - ) - ); - } - test_field_use_compiled_network(); - fn test_field_blob_dump_path() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).blob_dump_path) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(OrtOpenVINOProviderOptions), - "::", - stringify!(blob_dump_path) + stringify!(cache_dir) ) ); } - test_field_blob_dump_path(); + test_field_cache_dir(); fn test_field_context() { assert_eq!( unsafe { @@ -1337,7 +1368,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 48usize, + 40usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1354,7 +1385,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize }, - 56usize, + 48usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1371,7 +1402,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize }, - 57usize, + 49usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1515,6 +1546,9 @@ pub type OrtCustomCreateThreadFn = ::std::option::Option< #[doc = " Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn"] pub type OrtCustomJoinThreadFn = ::std::option::Option; +pub type RegisterCustomOpsFn = ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions, api: *const OrtApiBase) -> *mut OrtStatus, +>; #[doc = " \\brief The C API"] #[doc = ""] #[doc = " All C API functions are defined inside this structure as pointers to functions."] @@ -2822,12 +2856,98 @@ pub struct OrtApi { #[doc = " \\since Version 1.13."] pub ReleaseCANNProviderOptions: ::std::option::Option, + pub MemoryInfoGetDeviceType: ::std::option::Option< + unsafe extern "C" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemoryInfoDeviceType), + >, + pub UpdateEnvWithCustomLogLevel: ::std::option::Option< + unsafe extern "C" fn( + ort_env: *mut OrtEnv, + log_severity_level: OrtLoggingLevel, + ) -> OrtStatusPtr, + >, + pub SetGlobalIntraOpThreadAffinity: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + affinity_string: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsLibrary_V2: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + library_name: *const wchar_t, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsUsingFunction: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + registration_func_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_tensor: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + allocator: *mut OrtAllocator, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub HasSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, } #[test] fn bindgen_test_layout_OrtApi() { assert_eq!( ::std::mem::size_of::(), - 1800usize, + 1912usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6696,12 +6816,251 @@ fn bindgen_test_layout_OrtApi() { ); } test_field_ReleaseCANNProviderOptions(); + fn test_field_MemoryInfoGetDeviceType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetDeviceType) as usize - ptr as usize + }, + 1800usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetDeviceType) + ) + ); + } + test_field_MemoryInfoGetDeviceType(); + fn test_field_UpdateEnvWithCustomLogLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateEnvWithCustomLogLevel) as usize - ptr as usize + }, + 1808usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateEnvWithCustomLogLevel) + ) + ); + } + test_field_UpdateEnvWithCustomLogLevel(); + fn test_field_SetGlobalIntraOpThreadAffinity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalIntraOpThreadAffinity) as usize - ptr as usize + }, + 1816usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalIntraOpThreadAffinity) + ) + ); + } + test_field_SetGlobalIntraOpThreadAffinity(); + fn test_field_RegisterCustomOpsLibrary_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsLibrary_V2) as usize - ptr as usize + }, + 1824usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsLibrary_V2) + ) + ); + } + test_field_RegisterCustomOpsLibrary_V2(); + fn test_field_RegisterCustomOpsUsingFunction() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsUsingFunction) as usize - ptr as usize + }, + 1832usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsUsingFunction) + ) + ); + } + test_field_RegisterCustomOpsUsingFunction(); + fn test_field_KernelInfo_GetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputCount) as usize - ptr as usize + }, + 1840usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputCount) + ) + ); + } + test_field_KernelInfo_GetInputCount(); + fn test_field_KernelInfo_GetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputCount) as usize - ptr as usize + }, + 1848usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputCount) + ) + ); + } + test_field_KernelInfo_GetOutputCount(); + fn test_field_KernelInfo_GetInputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputName) as usize - ptr as usize + }, + 1856usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputName) + ) + ); + } + test_field_KernelInfo_GetInputName(); + fn test_field_KernelInfo_GetOutputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputName) as usize - ptr as usize + }, + 1864usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputName) + ) + ); + } + test_field_KernelInfo_GetOutputName(); + fn test_field_KernelInfo_GetInputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputTypeInfo) as usize - ptr as usize + }, + 1872usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetInputTypeInfo(); + fn test_field_KernelInfo_GetOutputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputTypeInfo) as usize - ptr as usize + }, + 1880usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetOutputTypeInfo(); + fn test_field_KernelInfoGetAttribute_tensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_tensor) as usize - ptr as usize + }, + 1888usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_tensor) + ) + ); + } + test_field_KernelInfoGetAttribute_tensor(); + fn test_field_HasSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).HasSessionConfigEntry) as usize - ptr as usize + }, + 1896usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(HasSessionConfigEntry) + ) + ); + } + test_field_HasSessionConfigEntry(); + fn test_field_GetSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSessionConfigEntry) as usize - ptr as usize + }, + 1904usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSessionConfigEntry) + ) + ); + } + test_field_GetSessionConfigEntry(); } #[repr(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCustomOpInputOutputCharacteristic { INPUT_OUTPUT_REQUIRED = 0, INPUT_OUTPUT_OPTIONAL = 1, + INPUT_OUTPUT_VARIADIC = 2, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6750,12 +7109,27 @@ pub struct OrtCustomOp { index: usize, ) -> OrtCustomOpInputOutputCharacteristic, >, + pub GetInputMemoryType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> OrtMemType, + >, + pub GetVariadicInputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicInputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, } #[test] fn bindgen_test_layout_OrtCustomOp() { assert_eq!( ::std::mem::size_of::(), - 96usize, + 136usize, concat!("Size of: ", stringify!(OrtCustomOp)) ); assert_eq!( @@ -6967,6 +7341,91 @@ fn bindgen_test_layout_OrtCustomOp() { ); } test_field_GetOutputCharacteristic(); + fn test_field_GetInputMemoryType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputMemoryType) as usize - ptr as usize + }, + 96usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputMemoryType) + ) + ); + } + test_field_GetInputMemoryType(); + fn test_field_GetVariadicInputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputMinArity) as usize - ptr as usize + }, + 104usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputMinArity) + ) + ); + } + test_field_GetVariadicInputMinArity(); + fn test_field_GetVariadicInputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputHomogeneity) as usize - ptr as usize + }, + 112usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputHomogeneity) + ) + ); + } + test_field_GetVariadicInputHomogeneity(); + fn test_field_GetVariadicOutputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputMinArity) as usize - ptr as usize + }, + 120usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputMinArity) + ) + ); + } + test_field_GetVariadicOutputMinArity(); + fn test_field_GetVariadicOutputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputHomogeneity) as usize - ptr as usize + }, + 128usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputHomogeneity) + ) + ); + } + test_field_GetVariadicOutputHomogeneity(); } extern "C" { pub fn OrtSessionOptionsAppendExecutionProvider_CUDA( diff --git a/onnxruntime-sys/src/generated/windows/x86_64/bindings_directml.rs b/onnxruntime-sys/src/generated/windows/x86_64/bindings_directml.rs index e41c3f05..c9943825 100644 --- a/onnxruntime-sys/src/generated/windows/x86_64/bindings_directml.rs +++ b/onnxruntime-sys/src/generated/windows/x86_64/bindings_directml.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 13; +pub const ORT_API_VERSION: u32 = 14; pub type wchar_t = ::std::os::raw::c_ushort; pub type ULONG = ::std::os::raw::c_ulong; pub type BOOL = ::std::os::raw::c_int; @@ -3443,6 +3443,14 @@ pub enum OrtMemType { OrtMemTypeDefault = 0, } #[repr(i32)] +#[doc = " \\brief This mimics OrtDevice type constants so they can be returned in the API"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtMemoryInfoDeviceType { + OrtMemoryInfoDeviceType_CPU = 0, + OrtMemoryInfoDeviceType_GPU = 1, + OrtMemoryInfoDeviceType_FPGA = 2, +} +#[repr(i32)] #[doc = " \\brief Algorithm to use for cuDNN Convolution Op"] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCudnnConvAlgoSearch { @@ -3488,12 +3496,16 @@ pub struct OrtCUDAProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief CUDA memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_CUDA_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtCUDAProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) ); assert_eq!( @@ -3637,6 +3649,23 @@ fn bindgen_test_layout_OrtCUDAProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief ROCM Provider Options"] #[doc = ""] @@ -3675,12 +3704,16 @@ pub struct OrtROCMProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief ROCM memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, + #[doc = " \\brief Enable TunableOp."] + #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be superseded by environment variable ORT_ROCM_TUNABLE_OP_ENABLED."] + pub tunable_op_enabled: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtROCMProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 48usize, + 56usize, concat!("Size of: ", stringify!(OrtROCMProviderOptions)) ); assert_eq!( @@ -3824,6 +3857,23 @@ fn bindgen_test_layout_OrtROCMProviderOptions() { ); } test_field_default_memory_arena_cfg(); + fn test_field_tunable_op_enabled() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(tunable_op_enabled) + ) + ); + } + test_field_tunable_op_enabled(); } #[doc = " \\brief TensorRT Provider Options"] #[doc = ""] @@ -4261,9 +4311,7 @@ pub struct OrtOpenVINOProviderOptions { pub device_id: *const ::std::os::raw::c_char, #[doc = "< 0 = Use default number of threads"] pub num_of_threads: usize, - #[doc = "< 0 = disabled, nonzero = enabled"] - pub use_compiled_network: ::std::os::raw::c_uchar, - pub blob_dump_path: *const ::std::os::raw::c_char, + pub cache_dir: *const ::std::os::raw::c_char, pub context: *mut ::std::os::raw::c_void, #[doc = "< 0 = disabled, nonzero = enabled"] pub enable_opencl_throttling: ::std::os::raw::c_uchar, @@ -4274,7 +4322,7 @@ pub struct OrtOpenVINOProviderOptions { fn bindgen_test_layout_OrtOpenVINOProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 64usize, + 56usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -4350,40 +4398,23 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } test_field_num_of_threads(); - fn test_field_use_compiled_network() { + fn test_field_cache_dir() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).use_compiled_network) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).cache_dir) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), "::", - stringify!(use_compiled_network) + stringify!(cache_dir) ) ); } - test_field_use_compiled_network(); - fn test_field_blob_dump_path() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).blob_dump_path) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(OrtOpenVINOProviderOptions), - "::", - stringify!(blob_dump_path) - ) - ); - } - test_field_blob_dump_path(); + test_field_cache_dir(); fn test_field_context() { assert_eq!( unsafe { @@ -4391,7 +4422,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 48usize, + 40usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -4408,7 +4439,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize }, - 56usize, + 48usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -4425,7 +4456,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize }, - 57usize, + 49usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -4569,6 +4600,9 @@ pub type OrtCustomCreateThreadFn = ::std::option::Option< #[doc = " Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn"] pub type OrtCustomJoinThreadFn = ::std::option::Option; +pub type RegisterCustomOpsFn = ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions, api: *const OrtApiBase) -> *mut OrtStatus, +>; #[doc = " \\brief The C API"] #[doc = ""] #[doc = " All C API functions are defined inside this structure as pointers to functions."] @@ -5876,12 +5910,98 @@ pub struct OrtApi { #[doc = " \\since Version 1.13."] pub ReleaseCANNProviderOptions: ::std::option::Option, + pub MemoryInfoGetDeviceType: ::std::option::Option< + unsafe extern "C" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemoryInfoDeviceType), + >, + pub UpdateEnvWithCustomLogLevel: ::std::option::Option< + unsafe extern "C" fn( + ort_env: *mut OrtEnv, + log_severity_level: OrtLoggingLevel, + ) -> OrtStatusPtr, + >, + pub SetGlobalIntraOpThreadAffinity: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + affinity_string: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsLibrary_V2: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + library_name: *const wchar_t, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsUsingFunction: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + registration_func_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputCount: ::std::option::Option< + unsafe extern "C" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetInputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetOutputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_tensor: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + allocator: *mut OrtAllocator, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub HasSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, } #[test] fn bindgen_test_layout_OrtApi() { assert_eq!( ::std::mem::size_of::(), - 1800usize, + 1912usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -9750,12 +9870,251 @@ fn bindgen_test_layout_OrtApi() { ); } test_field_ReleaseCANNProviderOptions(); + fn test_field_MemoryInfoGetDeviceType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetDeviceType) as usize - ptr as usize + }, + 1800usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetDeviceType) + ) + ); + } + test_field_MemoryInfoGetDeviceType(); + fn test_field_UpdateEnvWithCustomLogLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateEnvWithCustomLogLevel) as usize - ptr as usize + }, + 1808usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateEnvWithCustomLogLevel) + ) + ); + } + test_field_UpdateEnvWithCustomLogLevel(); + fn test_field_SetGlobalIntraOpThreadAffinity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalIntraOpThreadAffinity) as usize - ptr as usize + }, + 1816usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalIntraOpThreadAffinity) + ) + ); + } + test_field_SetGlobalIntraOpThreadAffinity(); + fn test_field_RegisterCustomOpsLibrary_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsLibrary_V2) as usize - ptr as usize + }, + 1824usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsLibrary_V2) + ) + ); + } + test_field_RegisterCustomOpsLibrary_V2(); + fn test_field_RegisterCustomOpsUsingFunction() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsUsingFunction) as usize - ptr as usize + }, + 1832usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsUsingFunction) + ) + ); + } + test_field_RegisterCustomOpsUsingFunction(); + fn test_field_KernelInfo_GetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputCount) as usize - ptr as usize + }, + 1840usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputCount) + ) + ); + } + test_field_KernelInfo_GetInputCount(); + fn test_field_KernelInfo_GetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputCount) as usize - ptr as usize + }, + 1848usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputCount) + ) + ); + } + test_field_KernelInfo_GetOutputCount(); + fn test_field_KernelInfo_GetInputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputName) as usize - ptr as usize + }, + 1856usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputName) + ) + ); + } + test_field_KernelInfo_GetInputName(); + fn test_field_KernelInfo_GetOutputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputName) as usize - ptr as usize + }, + 1864usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputName) + ) + ); + } + test_field_KernelInfo_GetOutputName(); + fn test_field_KernelInfo_GetInputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetInputTypeInfo) as usize - ptr as usize + }, + 1872usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetInputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetInputTypeInfo(); + fn test_field_KernelInfo_GetOutputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetOutputTypeInfo) as usize - ptr as usize + }, + 1880usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetOutputTypeInfo) + ) + ); + } + test_field_KernelInfo_GetOutputTypeInfo(); + fn test_field_KernelInfoGetAttribute_tensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_tensor) as usize - ptr as usize + }, + 1888usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_tensor) + ) + ); + } + test_field_KernelInfoGetAttribute_tensor(); + fn test_field_HasSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).HasSessionConfigEntry) as usize - ptr as usize + }, + 1896usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(HasSessionConfigEntry) + ) + ); + } + test_field_HasSessionConfigEntry(); + fn test_field_GetSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSessionConfigEntry) as usize - ptr as usize + }, + 1904usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSessionConfigEntry) + ) + ); + } + test_field_GetSessionConfigEntry(); } #[repr(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum OrtCustomOpInputOutputCharacteristic { INPUT_OUTPUT_REQUIRED = 0, INPUT_OUTPUT_OPTIONAL = 1, + INPUT_OUTPUT_VARIADIC = 2, } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -9804,12 +10163,27 @@ pub struct OrtCustomOp { index: usize, ) -> OrtCustomOpInputOutputCharacteristic, >, + pub GetInputMemoryType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> OrtMemType, + >, + pub GetVariadicInputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicInputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputMinArity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, + pub GetVariadicOutputHomogeneity: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, + >, } #[test] fn bindgen_test_layout_OrtCustomOp() { assert_eq!( ::std::mem::size_of::(), - 96usize, + 136usize, concat!("Size of: ", stringify!(OrtCustomOp)) ); assert_eq!( @@ -10021,6 +10395,91 @@ fn bindgen_test_layout_OrtCustomOp() { ); } test_field_GetOutputCharacteristic(); + fn test_field_GetInputMemoryType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputMemoryType) as usize - ptr as usize + }, + 96usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputMemoryType) + ) + ); + } + test_field_GetInputMemoryType(); + fn test_field_GetVariadicInputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputMinArity) as usize - ptr as usize + }, + 104usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputMinArity) + ) + ); + } + test_field_GetVariadicInputMinArity(); + fn test_field_GetVariadicInputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicInputHomogeneity) as usize - ptr as usize + }, + 112usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicInputHomogeneity) + ) + ); + } + test_field_GetVariadicInputHomogeneity(); + fn test_field_GetVariadicOutputMinArity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputMinArity) as usize - ptr as usize + }, + 120usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputMinArity) + ) + ); + } + test_field_GetVariadicOutputMinArity(); + fn test_field_GetVariadicOutputHomogeneity() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVariadicOutputHomogeneity) as usize - ptr as usize + }, + 128usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetVariadicOutputHomogeneity) + ) + ); + } + test_field_GetVariadicOutputHomogeneity(); } extern "C" { pub fn OrtSessionOptionsAppendExecutionProvider_CUDA( diff --git a/onnxruntime/src/lib.rs b/onnxruntime/src/lib.rs index 886c26df..51fbea1a 100644 --- a/onnxruntime/src/lib.rs +++ b/onnxruntime/src/lib.rs @@ -590,6 +590,8 @@ pub struct CudaProviderOptions<'a> { pub user_compute_stream: Option<*mut c_void>, /// default_memory_arena_cfg pub default_memory_arena_cfg: Option<&'a mut ArenaCfg>, + /// tunable_op_enabled + pub tunable_op_enabled: i32, } impl<'a> From> for sys::OrtCUDAProviderOptions { @@ -613,6 +615,7 @@ impl<'a> From> for sys::OrtCUDAProviderOptions { } else { null_mut() }, + tunable_op_enabled: options.tunable_op_enabled, } } }