From bcd180df2b4322fc5e916f8cb4cdbc0655061e6e Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Mon, 27 Mar 2023 17:35:18 +0900 Subject: [PATCH 01/21] support iOS add aarch64-apple-ios add aarch64-apple-ios-sim --- .github/workflows/gen_bind.yaml | 4 + .github/workflows/general.yml | 18 + onnxruntime-sys/build.rs | 21 +- onnxruntime-sys/src/generated/bindings.rs | 6 + .../src/generated/ios/aarch64/bindings.rs | 6982 +++++++++++++++++ 5 files changed, 7030 insertions(+), 1 deletion(-) create mode 100644 onnxruntime-sys/src/generated/ios/aarch64/bindings.rs diff --git a/.github/workflows/gen_bind.yaml b/.github/workflows/gen_bind.yaml index cc623777..8c123dff 100644 --- a/.github/workflows/gen_bind.yaml +++ b/.github/workflows/gen_bind.yaml @@ -28,6 +28,10 @@ jobs: triple: x86_64-apple-darwin - os: macos-latest triple: aarch64-apple-darwin + - os: macos-latest + triple: aarch64-apple-ios + - os: macos-latest + triple: aarch64-apple-ios-sim runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/general.yml b/.github/workflows/general.yml index bd102793..29da10f6 100644 --- a/.github/workflows/general.yml +++ b/.github/workflows/general.yml @@ -39,6 +39,8 @@ jobs: - run: rustup target install i686-pc-windows-msvc - run: rustup target install x86_64-pc-windows-msvc - run: rustup target install aarch64-linux-android + - run: rustup target install aarch64-apple-ios + - run: rustup target install aarch64-apple-ios-sim # ****************************************************************** - name: Download prebuilt archive (CPU, x86_64-unknown-linux-gnu) uses: actions-rs/cargo@v1 @@ -64,6 +66,22 @@ jobs: - name: Verify prebuilt archive downloaded (CPU, x86_64-apple-darwin) run: ls -lh target/x86_64-apple-darwin/debug/build/onnxruntime-sys-*/out/onnxruntime-osx-x86_64-1.*.tgz # ****************************************************************** + - name: Download prebuilt archive (CPU, aarch64-apple-ios) + uses: actions-rs/cargo@v1 + with: + command: build + args: --target aarch64-apple-ios + - name: Verify prebuilt archive downloaded (CPU, aarch64-apple-ios) + run: ls -lh target/aarch64-apple-ios/debug/build/onnxruntime-sys-*/out/onnxruntime-ios-arm64-1.*.zip + # ****************************************************************** + - name: Download prebuilt archive (CPU, aarch64-apple-ios-sim) + uses: actions-rs/cargo@v1 + with: + command: build + args: --target aarch64-apple-ios-sim + - name: Verify prebuilt archive downloaded (CPU, aarch64-apple-ios-sim) + run: ls -lh target/aarch64-apple-ios-sim/debug/build/onnxruntime-sys-*/out/onnxruntime-ios-arm64-1.*.zip + # ****************************************************************** - name: Download prebuilt archive (CPU, i686-pc-windows-msvc) uses: actions-rs/cargo@v1 with: diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 5013e698..d80b5ffe 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -22,6 +22,9 @@ const ORT_RELEASE_BASE_URL: &str = "https://github.com/microsoft/onnxruntime/rel const ORT_MAVEN_RELEASE_BASE_URL: &str = "https://repo1.maven.org/maven2/com/microsoft/onnxruntime/onnxruntime-android"; +/// Base Url from which to download pre-build releases for ios/ +const ORT_COCOAPODS_RELEASE_BASE_URL: &str = "https://onnxruntimepackages.z14.web.core.windows.net"; + /// Environment variable selecting which strategy to use for finding the library /// Possibilities: /// * "download": Download a pre-built library from upstream. This is the default if `ORT_STRATEGY` is not set. @@ -77,6 +80,7 @@ fn main() { .join(&*TRIPLET.arch.as_onnx_android_str()); (include_dir, runtimes_dir) } + Os::IOs => (libort_install_dir.join("Headers"), libort_install_dir), _ => ( libort_install_dir.join("include"), libort_install_dir.join("lib"), @@ -382,6 +386,7 @@ enum Os { Linux, MacOs, Android, + IOs, } impl Os { @@ -391,6 +396,7 @@ impl Os { Os::Linux => "tgz", Os::MacOs => "tgz", Os::Android => "aar", + Os::IOs => "zip", } } } @@ -404,6 +410,7 @@ impl FromStr for Os { "macos" => Ok(Os::MacOs), "linux" => Ok(Os::Linux), "android" => Ok(Os::Android), + "ios" => Ok(Os::IOs), _ => Err(format!("Unsupported os: {}", s)), } } @@ -416,6 +423,7 @@ impl OnnxPrebuiltArchive for Os { Os::Linux => Cow::from("linux"), Os::MacOs => Cow::from("osx"), Os::Android => Cow::from("android"), + Os::IOs => Cow::from("ios"), } } } @@ -470,7 +478,8 @@ impl OnnxPrebuiltArchive for Triplet { self.os.as_onnx_str(), self.arch.as_onnx_str() )), - (Os::MacOs, Architecture::Arm64, Accelerator::None) => { + (Os::MacOs, Architecture::Arm64, Accelerator::None) + | (Os::IOs, Architecture::Arm64, Accelerator::None) => { Cow::from(format!("{}-{}", self.os.as_onnx_str(), "arm64")) } // onnxruntime-win-gpu-x64-1.8.1.zip @@ -521,6 +530,12 @@ fn prebuilt_archive_url() -> (PathBuf, String) { ORT_VERSION, TRIPLET.os.archive_extension() ), + Os::IOs => format!( + "{}/pod-archive-onnxruntime-c-{}.{}", + ORT_COCOAPODS_RELEASE_BASE_URL, + ORT_VERSION, + TRIPLET.os.archive_extension() + ), _ => format!( "{}/v{}/{}", ORT_RELEASE_BASE_URL, ORT_VERSION, prebuilt_archive @@ -573,6 +588,10 @@ fn prepare_libort_dir_prebuilt() -> PathBuf { #[cfg(not(feature = "directml"))] let extract_dir = match TRIPLET.os { Os::Android => extract_dir, + Os::IOs => extract_dir + .join("onnxruntime.xcframework") + .join("ios-arm64") + .join("onnxruntime.framework"), _ => extract_dir.join(prebuilt_archive.file_stem().unwrap()), }; diff --git a/onnxruntime-sys/src/generated/bindings.rs b/onnxruntime-sys/src/generated/bindings.rs index e49015db..6fc4ba1c 100644 --- a/onnxruntime-sys/src/generated/bindings.rs +++ b/onnxruntime-sys/src/generated/bindings.rs @@ -28,6 +28,12 @@ include!(concat!( "/src/generated/macos/aarch64/bindings.rs" )); +#[cfg(all(target_os = "ios", target_arch = "aarch64"))] +include!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/src/generated/ios/aarch64/bindings.rs" +)); + #[cfg(all(target_os = "windows", target_arch = "x86"))] include!(concat!( env!("CARGO_MANIFEST_DIR"), diff --git a/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs b/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs new file mode 100644 index 00000000..2eb0feb4 --- /dev/null +++ b/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs @@ -0,0 +1,6982 @@ +/* automatically generated by rust-bindgen 0.60.1 */ + +pub const ORT_API_VERSION: u32 = 13; +pub type __darwin_size_t = ::std::os::raw::c_ulong; +#[repr(u32)] +#[doc = " Copied from TensorProto::DataType"] +#[doc = " Currently, Ort doesn't support complex64, complex128"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum ONNXTensorElementDataType { + ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED = 0, + ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT = 1, + ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8 = 2, + ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8 = 3, + ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16 = 4, + ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16 = 5, + ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32 = 6, + ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64 = 7, + ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING = 8, + ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL = 9, + ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16 = 10, + ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE = 11, + ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32 = 12, + ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64 = 13, + ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64 = 14, + ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128 = 15, + ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16 = 16, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum ONNXType { + ONNX_TYPE_UNKNOWN = 0, + ONNX_TYPE_TENSOR = 1, + ONNX_TYPE_SEQUENCE = 2, + ONNX_TYPE_MAP = 3, + ONNX_TYPE_OPAQUE = 4, + ONNX_TYPE_SPARSETENSOR = 5, + ONNX_TYPE_OPTIONAL = 6, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtSparseFormat { + ORT_SPARSE_UNDEFINED = 0, + ORT_SPARSE_COO = 1, + ORT_SPARSE_CSRC = 2, + ORT_SPARSE_BLOCK_SPARSE = 4, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtSparseIndicesFormat { + ORT_SPARSE_COO_INDICES = 0, + ORT_SPARSE_CSR_INNER_INDICES = 1, + ORT_SPARSE_CSR_OUTER_INDICES = 2, + ORT_SPARSE_BLOCK_SPARSE_INDICES = 3, +} +#[repr(u32)] +#[doc = " \\brief Logging severity levels"] +#[doc = ""] +#[doc = " In typical API usage, specifying a logging severity level specifies the minimum severity of log messages to show."] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtLoggingLevel { + #[doc = "< Verbose informational messages (least severe)."] + ORT_LOGGING_LEVEL_VERBOSE = 0, + #[doc = "< Informational messages."] + ORT_LOGGING_LEVEL_INFO = 1, + #[doc = "< Warning messages."] + ORT_LOGGING_LEVEL_WARNING = 2, + #[doc = "< Error messages."] + ORT_LOGGING_LEVEL_ERROR = 3, + #[doc = "< Fatal error messages (most severe)."] + ORT_LOGGING_LEVEL_FATAL = 4, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtErrorCode { + ORT_OK = 0, + ORT_FAIL = 1, + ORT_INVALID_ARGUMENT = 2, + ORT_NO_SUCHFILE = 3, + ORT_NO_MODEL = 4, + ORT_ENGINE_ERROR = 5, + ORT_RUNTIME_EXCEPTION = 6, + ORT_INVALID_PROTOBUF = 7, + ORT_MODEL_LOADED = 8, + ORT_NOT_IMPLEMENTED = 9, + ORT_INVALID_GRAPH = 10, + ORT_EP_FAIL = 11, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtOpAttrType { + ORT_OP_ATTR_UNDEFINED = 0, + ORT_OP_ATTR_INT = 1, + ORT_OP_ATTR_INTS = 2, + ORT_OP_ATTR_FLOAT = 3, + ORT_OP_ATTR_FLOATS = 4, + ORT_OP_ATTR_STRING = 5, + ORT_OP_ATTR_STRINGS = 6, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtEnv { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtStatus { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtMemoryInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtIoBinding { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtSession { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtValue { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtRunOptions { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtTypeInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtTensorTypeAndShapeInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtSessionOptions { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCustomOpDomain { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtMapTypeInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtSequenceTypeInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtModelMetadata { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtThreadPoolParams { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtThreadingOptions { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtArenaCfg { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtPrepackedWeightsContainer { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtTensorRTProviderOptionsV2 { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCUDAProviderOptionsV2 { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCANNProviderOptions { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtOp { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtOpAttr { + _unused: [u8; 0], +} +pub type OrtStatusPtr = *mut OrtStatus; +#[doc = " \\brief Memory allocation interface"] +#[doc = ""] +#[doc = " Structure of function pointers that defines a memory allocator. This can be created and filled in by the user for custom allocators."] +#[doc = ""] +#[doc = " When an allocator is passed to any function, be sure that the allocator object is not destroyed until the last allocated object using it is freed."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtAllocator { + #[doc = "< Must be initialized to ORT_API_VERSION"] + pub version: u32, + #[doc = "< Returns a pointer to an allocated block of `size` bytes"] + pub Alloc: ::std::option::Option< + unsafe extern "C" fn(this_: *mut OrtAllocator, size: usize) -> *mut ::std::os::raw::c_void, + >, + #[doc = "< Free a block of memory previously allocated with OrtAllocator::Alloc"] + pub Free: ::std::option::Option< + unsafe extern "C" fn(this_: *mut OrtAllocator, p: *mut ::std::os::raw::c_void), + >, + #[doc = "< Return a pointer to an ::OrtMemoryInfo that describes this allocator"] + pub Info: ::std::option::Option< + unsafe extern "C" fn(this_: *const OrtAllocator) -> *const OrtMemoryInfo, + >, +} +#[test] +fn bindgen_test_layout_OrtAllocator() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(OrtAllocator)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtAllocator)) + ); + fn test_field_version() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtAllocator), + "::", + stringify!(version) + ) + ); + } + test_field_version(); + fn test_field_Alloc() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).Alloc) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtAllocator), + "::", + stringify!(Alloc) + ) + ); + } + test_field_Alloc(); + fn test_field_Free() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).Free) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtAllocator), + "::", + stringify!(Free) + ) + ); + } + test_field_Free(); + fn test_field_Info() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).Info) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtAllocator), + "::", + stringify!(Info) + ) + ); + } + test_field_Info(); +} +pub type OrtLoggingFunction = ::std::option::Option< + unsafe extern "C" fn( + param: *mut ::std::os::raw::c_void, + severity: OrtLoggingLevel, + category: *const ::std::os::raw::c_char, + logid: *const ::std::os::raw::c_char, + code_location: *const ::std::os::raw::c_char, + message: *const ::std::os::raw::c_char, + ), +>; +#[repr(u32)] +#[doc = " \\brief Graph optimization level"] +#[doc = ""] +#[doc = " Refer to https://www.onnxruntime.ai/docs/resources/graph-optimizations.html"] +#[doc = " for an in-depth understanding of Graph Optimizations"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum GraphOptimizationLevel { + ORT_DISABLE_ALL = 0, + ORT_ENABLE_BASIC = 1, + ORT_ENABLE_EXTENDED = 2, + ORT_ENABLE_ALL = 99, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum ExecutionMode { + ORT_SEQUENTIAL = 0, + ORT_PARALLEL = 1, +} +#[repr(u32)] +#[doc = " \\brief Language projection identifiers"] +#[doc = " /see OrtApi::SetLanguageProjection"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtLanguageProjection { + ORT_PROJECTION_C = 0, + ORT_PROJECTION_CPLUSPLUS = 1, + ORT_PROJECTION_CSHARP = 2, + ORT_PROJECTION_PYTHON = 3, + ORT_PROJECTION_JAVA = 4, + ORT_PROJECTION_WINML = 5, + ORT_PROJECTION_NODEJS = 6, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtKernelInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtKernelContext { + _unused: [u8; 0], +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtAllocatorType { + OrtInvalidAllocator = -1, + OrtDeviceAllocator = 0, + OrtArenaAllocator = 1, +} +impl OrtMemType { + pub const OrtMemTypeCPU: OrtMemType = OrtMemType::OrtMemTypeCPUOutput; +} +#[repr(i32)] +#[doc = " \\brief Memory types for allocated memory, execution provider specific types should be extended in each provider."] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtMemType { + #[doc = "< Any CPU memory used by non-CPU execution provider"] + OrtMemTypeCPUInput = -2, + #[doc = "< CPU accessible memory outputted by non-CPU execution provider, i.e. CUDA_PINNED"] + OrtMemTypeCPUOutput = -1, + #[doc = "< The default allocator for execution provider"] + OrtMemTypeDefault = 0, +} +#[repr(u32)] +#[doc = " \\brief Algorithm to use for cuDNN Convolution Op"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtCudnnConvAlgoSearch { + OrtCudnnConvAlgoSearchExhaustive = 0, + OrtCudnnConvAlgoSearchHeuristic = 1, + OrtCudnnConvAlgoSearchDefault = 2, +} +#[doc = " \\brief CUDA Provider Options"] +#[doc = ""] +#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_CUDA"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCUDAProviderOptions { + #[doc = " \\brief CUDA device Id"] + #[doc = " Defaults to 0."] + pub device_id: ::std::os::raw::c_int, + #[doc = " \\brief CUDA Convolution algorithm search configuration."] + #[doc = " See enum OrtCudnnConvAlgoSearch for more details."] + #[doc = " Defaults to OrtCudnnConvAlgoSearchExhaustive."] + pub cudnn_conv_algo_search: OrtCudnnConvAlgoSearch, + #[doc = " \\brief CUDA memory limit (To use all possible memory pass in maximum size_t)"] + #[doc = " Defaults to SIZE_MAX."] + #[doc = " \\note If a ::OrtArenaCfg has been applied, it will override this field"] + pub gpu_mem_limit: usize, + #[doc = " \\brief Strategy used to grow the memory arena"] + #[doc = " 0 = kNextPowerOfTwo
"] + #[doc = " 1 = kSameAsRequested
"] + #[doc = " Defaults to 0."] + #[doc = " \\note If a ::OrtArenaCfg has been applied, it will override this field"] + pub arena_extend_strategy: ::std::os::raw::c_int, + #[doc = " \\brief Flag indicating if copying needs to take place on the same stream as the compute stream in the CUDA EP"] + #[doc = " 0 = Use separate streams for copying and compute."] + #[doc = " 1 = Use the same stream for copying and compute."] + #[doc = " Defaults to 1."] + #[doc = " WARNING: Setting this to 0 may result in data races for some models."] + #[doc = " Please see issue #4829 for more details."] + pub do_copy_in_default_stream: ::std::os::raw::c_int, + #[doc = " \\brief Flag indicating if there is a user provided compute stream"] + #[doc = " Defaults to 0."] + pub has_user_compute_stream: ::std::os::raw::c_int, + #[doc = " \\brief User provided compute stream."] + #[doc = " If provided, please set `has_user_compute_stream` to 1."] + pub user_compute_stream: *mut ::std::os::raw::c_void, + #[doc = " \\brief CUDA memory arena configuration parameters"] + pub default_memory_arena_cfg: *mut OrtArenaCfg, +} +#[test] +fn bindgen_test_layout_OrtCUDAProviderOptions() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtCUDAProviderOptions)) + ); + fn test_field_device_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_id) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(device_id) + ) + ); + } + test_field_device_id(); + fn test_field_cudnn_conv_algo_search() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).cudnn_conv_algo_search) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(cudnn_conv_algo_search) + ) + ); + } + test_field_cudnn_conv_algo_search(); + fn test_field_gpu_mem_limit() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).gpu_mem_limit) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(gpu_mem_limit) + ) + ); + } + test_field_gpu_mem_limit(); + fn test_field_arena_extend_strategy() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).arena_extend_strategy) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(arena_extend_strategy) + ) + ); + } + test_field_arena_extend_strategy(); + fn test_field_do_copy_in_default_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).do_copy_in_default_stream) as usize - ptr as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(do_copy_in_default_stream) + ) + ); + } + test_field_do_copy_in_default_stream(); + fn test_field_has_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).has_user_compute_stream) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(has_user_compute_stream) + ) + ); + } + test_field_has_user_compute_stream(); + fn test_field_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).user_compute_stream) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(user_compute_stream) + ) + ); + } + test_field_user_compute_stream(); + fn test_field_default_memory_arena_cfg() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).default_memory_arena_cfg) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(default_memory_arena_cfg) + ) + ); + } + test_field_default_memory_arena_cfg(); +} +#[doc = " \\brief ROCM Provider Options"] +#[doc = ""] +#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_ROCM"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtROCMProviderOptions { + #[doc = " \\brief ROCM device Id"] + #[doc = " Defaults to 0."] + pub device_id: ::std::os::raw::c_int, + #[doc = " \\brief ROCM MIOpen Convolution algorithm exaustive search option."] + #[doc = " Defaults to 0 (false)."] + pub miopen_conv_exhaustive_search: ::std::os::raw::c_int, + #[doc = " \\brief ROCM memory limit (To use all possible memory pass in maximum size_t)"] + #[doc = " Defaults to SIZE_MAX."] + #[doc = " \\note If a ::OrtArenaCfg has been applied, it will override this field"] + pub gpu_mem_limit: usize, + #[doc = " \\brief Strategy used to grow the memory arena"] + #[doc = " 0 = kNextPowerOfTwo
"] + #[doc = " 1 = kSameAsRequested
"] + #[doc = " Defaults to 0."] + #[doc = " \\note If a ::OrtArenaCfg has been applied, it will override this field"] + pub arena_extend_strategy: ::std::os::raw::c_int, + #[doc = " \\brief Flag indicating if copying needs to take place on the same stream as the compute stream in the ROCM EP"] + #[doc = " 0 = Use separate streams for copying and compute."] + #[doc = " 1 = Use the same stream for copying and compute."] + #[doc = " Defaults to 1."] + #[doc = " WARNING: Setting this to 0 may result in data races for some models."] + #[doc = " Please see issue #4829 for more details."] + pub do_copy_in_default_stream: ::std::os::raw::c_int, + #[doc = " \\brief Flag indicating if there is a user provided compute stream"] + #[doc = " Defaults to 0."] + pub has_user_compute_stream: ::std::os::raw::c_int, + #[doc = " \\brief User provided compute stream."] + #[doc = " If provided, please set `has_user_compute_stream` to 1."] + pub user_compute_stream: *mut ::std::os::raw::c_void, + #[doc = " \\brief ROCM memory arena configuration parameters"] + pub default_memory_arena_cfg: *mut OrtArenaCfg, +} +#[test] +fn bindgen_test_layout_OrtROCMProviderOptions() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(OrtROCMProviderOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtROCMProviderOptions)) + ); + fn test_field_device_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_id) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(device_id) + ) + ); + } + test_field_device_id(); + fn test_field_miopen_conv_exhaustive_search() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).miopen_conv_exhaustive_search) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(miopen_conv_exhaustive_search) + ) + ); + } + test_field_miopen_conv_exhaustive_search(); + fn test_field_gpu_mem_limit() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).gpu_mem_limit) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(gpu_mem_limit) + ) + ); + } + test_field_gpu_mem_limit(); + fn test_field_arena_extend_strategy() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).arena_extend_strategy) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(arena_extend_strategy) + ) + ); + } + test_field_arena_extend_strategy(); + fn test_field_do_copy_in_default_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).do_copy_in_default_stream) as usize - ptr as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(do_copy_in_default_stream) + ) + ); + } + test_field_do_copy_in_default_stream(); + fn test_field_has_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).has_user_compute_stream) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(has_user_compute_stream) + ) + ); + } + test_field_has_user_compute_stream(); + fn test_field_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).user_compute_stream) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(user_compute_stream) + ) + ); + } + test_field_user_compute_stream(); + fn test_field_default_memory_arena_cfg() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).default_memory_arena_cfg) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(default_memory_arena_cfg) + ) + ); + } + test_field_default_memory_arena_cfg(); +} +#[doc = " \\brief TensorRT Provider Options"] +#[doc = ""] +#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_TensorRT"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtTensorRTProviderOptions { + #[doc = "< CUDA device id (0 = default device)"] + pub device_id: ::std::os::raw::c_int, + pub has_user_compute_stream: ::std::os::raw::c_int, + pub user_compute_stream: *mut ::std::os::raw::c_void, + pub trt_max_partition_iterations: ::std::os::raw::c_int, + pub trt_min_subgraph_size: ::std::os::raw::c_int, + pub trt_max_workspace_size: usize, + pub trt_fp16_enable: ::std::os::raw::c_int, + pub trt_int8_enable: ::std::os::raw::c_int, + pub trt_int8_calibration_table_name: *const ::std::os::raw::c_char, + pub trt_int8_use_native_calibration_table: ::std::os::raw::c_int, + pub trt_dla_enable: ::std::os::raw::c_int, + pub trt_dla_core: ::std::os::raw::c_int, + pub trt_dump_subgraphs: ::std::os::raw::c_int, + pub trt_engine_cache_enable: ::std::os::raw::c_int, + pub trt_engine_cache_path: *const ::std::os::raw::c_char, + pub trt_engine_decryption_enable: ::std::os::raw::c_int, + pub trt_engine_decryption_lib_path: *const ::std::os::raw::c_char, + pub trt_force_sequential_engine_build: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_OrtTensorRTProviderOptions() { + assert_eq!( + ::std::mem::size_of::(), + 104usize, + concat!("Size of: ", stringify!(OrtTensorRTProviderOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtTensorRTProviderOptions)) + ); + fn test_field_device_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_id) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(device_id) + ) + ); + } + test_field_device_id(); + fn test_field_has_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).has_user_compute_stream) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(has_user_compute_stream) + ) + ); + } + test_field_has_user_compute_stream(); + fn test_field_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).user_compute_stream) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(user_compute_stream) + ) + ); + } + test_field_user_compute_stream(); + fn test_field_trt_max_partition_iterations() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_max_partition_iterations) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_max_partition_iterations) + ) + ); + } + test_field_trt_max_partition_iterations(); + fn test_field_trt_min_subgraph_size() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_min_subgraph_size) as usize - ptr as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_min_subgraph_size) + ) + ); + } + test_field_trt_min_subgraph_size(); + fn test_field_trt_max_workspace_size() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_max_workspace_size) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_max_workspace_size) + ) + ); + } + test_field_trt_max_workspace_size(); + fn test_field_trt_fp16_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_fp16_enable) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_fp16_enable) + ) + ); + } + test_field_trt_fp16_enable(); + fn test_field_trt_int8_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_int8_enable) as usize - ptr as usize + }, + 36usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_int8_enable) + ) + ); + } + test_field_trt_int8_enable(); + fn test_field_trt_int8_calibration_table_name() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_int8_calibration_table_name) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_int8_calibration_table_name) + ) + ); + } + test_field_trt_int8_calibration_table_name(); + fn test_field_trt_int8_use_native_calibration_table() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_int8_use_native_calibration_table) as usize + - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_int8_use_native_calibration_table) + ) + ); + } + test_field_trt_int8_use_native_calibration_table(); + fn test_field_trt_dla_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_dla_enable) as usize - ptr as usize + }, + 52usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_dla_enable) + ) + ); + } + test_field_trt_dla_enable(); + fn test_field_trt_dla_core() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_dla_core) as usize - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_dla_core) + ) + ); + } + test_field_trt_dla_core(); + fn test_field_trt_dump_subgraphs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_dump_subgraphs) as usize - ptr as usize + }, + 60usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_dump_subgraphs) + ) + ); + } + test_field_trt_dump_subgraphs(); + fn test_field_trt_engine_cache_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_engine_cache_enable) as usize - ptr as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_engine_cache_enable) + ) + ); + } + test_field_trt_engine_cache_enable(); + fn test_field_trt_engine_cache_path() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_engine_cache_path) as usize - ptr as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_engine_cache_path) + ) + ); + } + test_field_trt_engine_cache_path(); + fn test_field_trt_engine_decryption_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_engine_decryption_enable) as usize - ptr as usize + }, + 80usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_engine_decryption_enable) + ) + ); + } + test_field_trt_engine_decryption_enable(); + fn test_field_trt_engine_decryption_lib_path() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_engine_decryption_lib_path) as usize - ptr as usize + }, + 88usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_engine_decryption_lib_path) + ) + ); + } + test_field_trt_engine_decryption_lib_path(); + fn test_field_trt_force_sequential_engine_build() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_force_sequential_engine_build) as usize + - ptr as usize + }, + 96usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_force_sequential_engine_build) + ) + ); + } + test_field_trt_force_sequential_engine_build(); +} +#[doc = " \\brief MIGraphX Provider Options"] +#[doc = ""] +#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_MIGraphX"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtMIGraphXProviderOptions { + pub device_id: ::std::os::raw::c_int, + pub migraphx_fp16_enable: ::std::os::raw::c_int, + pub migraphx_int8_enable: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_OrtMIGraphXProviderOptions() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(OrtMIGraphXProviderOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(OrtMIGraphXProviderOptions)) + ); + fn test_field_device_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_id) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtMIGraphXProviderOptions), + "::", + stringify!(device_id) + ) + ); + } + test_field_device_id(); + fn test_field_migraphx_fp16_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).migraphx_fp16_enable) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(OrtMIGraphXProviderOptions), + "::", + stringify!(migraphx_fp16_enable) + ) + ); + } + test_field_migraphx_fp16_enable(); + fn test_field_migraphx_int8_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).migraphx_int8_enable) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtMIGraphXProviderOptions), + "::", + stringify!(migraphx_int8_enable) + ) + ); + } + test_field_migraphx_int8_enable(); +} +#[doc = " \\brief OpenVINO Provider Options"] +#[doc = ""] +#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_OpenVINO"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtOpenVINOProviderOptions { + #[doc = " \\brief Device type string"] + #[doc = ""] + #[doc = " Valid settings are one of: \"CPU_FP32\", \"CPU_FP16\", \"GPU_FP32\", \"GPU_FP16\", \"MYRIAD_FP16\", \"VAD-M_FP16\" or \"VAD-F_FP32\""] + pub device_type: *const ::std::os::raw::c_char, + #[doc = "< 0 = disabled, nonzero = enabled"] + pub enable_vpu_fast_compile: ::std::os::raw::c_uchar, + 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 context: *mut ::std::os::raw::c_void, + #[doc = "< 0 = disabled, nonzero = enabled"] + pub enable_opencl_throttling: ::std::os::raw::c_uchar, + #[doc = "< 0 = disabled, nonzero = enabled"] + pub enable_dynamic_shapes: ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_OrtOpenVINOProviderOptions() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtOpenVINOProviderOptions)) + ); + fn test_field_device_type() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_type) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(device_type) + ) + ); + } + test_field_device_type(); + fn test_field_enable_vpu_fast_compile() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).enable_vpu_fast_compile) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(enable_vpu_fast_compile) + ) + ); + } + test_field_enable_vpu_fast_compile(); + fn test_field_device_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_id) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(device_id) + ) + ); + } + test_field_device_id(); + fn test_field_num_of_threads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).num_of_threads) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(num_of_threads) + ) + ); + } + test_field_num_of_threads(); + fn test_field_use_compiled_network() { + 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 + }, + 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) + ) + ); + } + test_field_blob_dump_path(); + fn test_field_context() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(context) + ) + ); + } + test_field_context(); + fn test_field_enable_opencl_throttling() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(enable_opencl_throttling) + ) + ); + } + test_field_enable_opencl_throttling(); + fn test_field_enable_dynamic_shapes() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize + }, + 57usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(enable_dynamic_shapes) + ) + ); + } + test_field_enable_dynamic_shapes(); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtTrainingApi { + _unused: [u8; 0], +} +#[doc = " \\brief The helper interface to get the right version of OrtApi"] +#[doc = ""] +#[doc = " Get a pointer to this structure through ::OrtGetApiBase"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtApiBase { + #[doc = " \\brief Get a pointer to the requested version of the ::OrtApi"] + #[doc = ""] + #[doc = " \\param[in] version Must be ::ORT_API_VERSION"] + #[doc = " \\return The ::OrtApi for the version requested, nullptr will be returned if this version is unsupported, for example when using a runtime"] + #[doc = " older than the version created with this header file."] + pub GetApi: ::std::option::Option *const OrtApi>, + #[doc = "< Returns a null terminated string of the version of the Onnxruntime library (eg: \"1.8.1\")"] + pub GetVersionString: + ::std::option::Option *const ::std::os::raw::c_char>, +} +#[test] +fn bindgen_test_layout_OrtApiBase() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(OrtApiBase)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtApiBase)) + ); + fn test_field_GetApi() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetApi) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtApiBase), + "::", + stringify!(GetApi) + ) + ); + } + test_field_GetApi(); + fn test_field_GetVersionString() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVersionString) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtApiBase), + "::", + stringify!(GetVersionString) + ) + ); + } + test_field_GetVersionString(); +} +extern "C" { + #[doc = " \\brief The Onnxruntime library's entry point to access the C API"] + #[doc = ""] + #[doc = " Call this to get the a pointer to an ::OrtApiBase"] + pub fn OrtGetApiBase() -> *const OrtApiBase; +} +#[doc = " \\brief Thread work loop function"] +#[doc = ""] +#[doc = " Onnxruntime will provide the working loop on custom thread creation"] +#[doc = " Argument is an onnxruntime built-in type which will be provided when thread pool calls OrtCustomCreateThreadFn"] +pub type OrtThreadWorkerFn = + ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCustomHandleType { + pub __place_holder: ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout_OrtCustomHandleType() { + assert_eq!( + ::std::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(OrtCustomHandleType)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(OrtCustomHandleType)) + ); + fn test_field___place_holder() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).__place_holder) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomHandleType), + "::", + stringify!(__place_holder) + ) + ); + } + test_field___place_holder(); +} +pub type OrtCustomThreadHandle = *const OrtCustomHandleType; +#[doc = " \\brief Ort custom thread creation function"] +#[doc = ""] +#[doc = " The function should return a thread handle to be used in onnxruntime thread pools"] +#[doc = " Onnxruntime will throw exception on return value of nullptr or 0, indicating that the function failed to create a thread"] +pub type OrtCustomCreateThreadFn = ::std::option::Option< + unsafe extern "C" fn( + ort_custom_thread_creation_options: *mut ::std::os::raw::c_void, + ort_thread_worker_fn: OrtThreadWorkerFn, + ort_worker_fn_param: *mut ::std::os::raw::c_void, + ) -> OrtCustomThreadHandle, +>; +#[doc = " \\brief Custom thread join function"] +#[doc = ""] +#[doc = " Onnxruntime thread pool destructor will call the function to join a custom thread."] +#[doc = " Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn"] +pub type OrtCustomJoinThreadFn = + ::std::option::Option; +#[doc = " \\brief The C API"] +#[doc = ""] +#[doc = " All C API functions are defined inside this structure as pointers to functions."] +#[doc = " Call OrtApiBase::GetApi to get a pointer to it"] +#[doc = ""] +#[doc = " \\nosubgrouping"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtApi { + #[doc = " \\brief Create an OrtStatus from a null terminated string"] + #[doc = ""] + #[doc = " \\param[in] code"] + #[doc = " \\param[in] msg A null-terminated string. Its contents will be copied."] + #[doc = " \\return A new OrtStatus object, must be destroyed with OrtApi::ReleaseStatus"] + pub CreateStatus: ::std::option::Option< + unsafe extern "C" fn( + code: OrtErrorCode, + msg: *const ::std::os::raw::c_char, + ) -> *mut OrtStatus, + >, + #[doc = " \\brief Get OrtErrorCode from OrtStatus"] + #[doc = ""] + #[doc = " \\param[in] status"] + #[doc = " \\return OrtErrorCode that \\p status was created with"] + pub GetErrorCode: + ::std::option::Option OrtErrorCode>, + #[doc = " \\brief Get error string from OrtStatus"] + #[doc = ""] + #[doc = " \\param[in] status"] + #[doc = " \\return The error message inside the `status`. Do not free the returned value."] + pub GetErrorMessage: ::std::option::Option< + unsafe extern "C" fn(status: *const OrtStatus) -> *const ::std::os::raw::c_char, + >, + pub CreateEnv: ::std::option::Option< + unsafe extern "C" fn( + log_severity_level: OrtLoggingLevel, + logid: *const ::std::os::raw::c_char, + out: *mut *mut OrtEnv, + ) -> OrtStatusPtr, + >, + pub CreateEnvWithCustomLogger: ::std::option::Option< + unsafe extern "C" fn( + logging_function: OrtLoggingFunction, + logger_param: *mut ::std::os::raw::c_void, + log_severity_level: OrtLoggingLevel, + logid: *const ::std::os::raw::c_char, + out: *mut *mut OrtEnv, + ) -> OrtStatusPtr, + >, + pub EnableTelemetryEvents: + ::std::option::Option OrtStatusPtr>, + pub DisableTelemetryEvents: + ::std::option::Option OrtStatusPtr>, + pub CreateSession: ::std::option::Option< + unsafe extern "C" fn( + env: *const OrtEnv, + model_path: *const ::std::os::raw::c_char, + options: *const OrtSessionOptions, + out: *mut *mut OrtSession, + ) -> OrtStatusPtr, + >, + pub CreateSessionFromArray: ::std::option::Option< + unsafe extern "C" fn( + env: *const OrtEnv, + model_data: *const ::std::os::raw::c_void, + model_data_length: usize, + options: *const OrtSessionOptions, + out: *mut *mut OrtSession, + ) -> OrtStatusPtr, + >, + pub Run: ::std::option::Option< + unsafe extern "C" fn( + session: *mut OrtSession, + run_options: *const OrtRunOptions, + input_names: *const *const ::std::os::raw::c_char, + inputs: *const *const OrtValue, + input_len: usize, + output_names: *const *const ::std::os::raw::c_char, + output_names_len: usize, + outputs: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub CreateSessionOptions: ::std::option::Option< + unsafe extern "C" fn(options: *mut *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub SetOptimizedModelFilePath: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + optimized_model_filepath: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub CloneSessionOptions: ::std::option::Option< + unsafe extern "C" fn( + in_options: *const OrtSessionOptions, + out_options: *mut *mut OrtSessionOptions, + ) -> OrtStatusPtr, + >, + pub SetSessionExecutionMode: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + execution_mode: ExecutionMode, + ) -> OrtStatusPtr, + >, + pub EnableProfiling: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + profile_file_prefix: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub DisableProfiling: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub EnableMemPattern: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub DisableMemPattern: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub EnableCpuMemArena: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub DisableCpuMemArena: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub SetSessionLogId: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + logid: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub SetSessionLogVerbosityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + session_log_verbosity_level: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub SetSessionLogSeverityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + session_log_severity_level: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub SetSessionGraphOptimizationLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + graph_optimization_level: GraphOptimizationLevel, + ) -> OrtStatusPtr, + >, + pub SetIntraOpNumThreads: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + intra_op_num_threads: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub SetInterOpNumThreads: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + inter_op_num_threads: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub CreateCustomOpDomain: ::std::option::Option< + unsafe extern "C" fn( + domain: *const ::std::os::raw::c_char, + out: *mut *mut OrtCustomOpDomain, + ) -> OrtStatusPtr, + >, + pub CustomOpDomain_Add: ::std::option::Option< + unsafe extern "C" fn( + custom_op_domain: *mut OrtCustomOpDomain, + op: *const OrtCustomOp, + ) -> OrtStatusPtr, + >, + pub AddCustomOpDomain: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + custom_op_domain: *mut OrtCustomOpDomain, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsLibrary: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + library_path: *const ::std::os::raw::c_char, + library_handle: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub SessionGetInputCount: ::std::option::Option< + unsafe extern "C" fn(session: *const OrtSession, out: *mut usize) -> OrtStatusPtr, + >, + pub SessionGetOutputCount: ::std::option::Option< + unsafe extern "C" fn(session: *const OrtSession, out: *mut usize) -> OrtStatusPtr, + >, + pub SessionGetOverridableInitializerCount: ::std::option::Option< + unsafe extern "C" fn(session: *const OrtSession, out: *mut usize) -> OrtStatusPtr, + >, + pub SessionGetInputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub SessionGetOutputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub SessionGetOverridableInitializerTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub SessionGetInputName: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub SessionGetOutputName: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub SessionGetOverridableInitializerName: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub CreateRunOptions: + ::std::option::Option OrtStatusPtr>, + pub RunOptionsSetRunLogVerbosityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtRunOptions, + log_verbosity_level: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub RunOptionsSetRunLogSeverityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtRunOptions, + log_severity_level: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub RunOptionsSetRunTag: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtRunOptions, + run_tag: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RunOptionsGetRunLogVerbosityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtRunOptions, + log_verbosity_level: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub RunOptionsGetRunLogSeverityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtRunOptions, + log_severity_level: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub RunOptionsGetRunTag: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtRunOptions, + run_tag: *mut *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RunOptionsSetTerminate: + ::std::option::Option OrtStatusPtr>, + pub RunOptionsUnsetTerminate: + ::std::option::Option OrtStatusPtr>, + pub CreateTensorAsOrtValue: ::std::option::Option< + unsafe extern "C" fn( + allocator: *mut OrtAllocator, + shape: *const i64, + shape_len: usize, + type_: ONNXTensorElementDataType, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub CreateTensorWithDataAsOrtValue: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtMemoryInfo, + p_data: *mut ::std::os::raw::c_void, + p_data_len: usize, + shape: *const i64, + shape_len: usize, + type_: ONNXTensorElementDataType, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub IsTensor: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetTensorMutableData: ::std::option::Option< + unsafe extern "C" fn( + value: *mut OrtValue, + out: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub FillStringTensor: ::std::option::Option< + unsafe extern "C" fn( + value: *mut OrtValue, + s: *const *const ::std::os::raw::c_char, + s_len: usize, + ) -> OrtStatusPtr, + >, + pub GetStringTensorDataLength: ::std::option::Option< + unsafe extern "C" fn(value: *const OrtValue, len: *mut usize) -> OrtStatusPtr, + >, + pub GetStringTensorContent: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + s: *mut ::std::os::raw::c_void, + s_len: usize, + offsets: *mut usize, + offsets_len: usize, + ) -> OrtStatusPtr, + >, + pub CastTypeInfoToTensorInfo: ::std::option::Option< + unsafe extern "C" fn( + type_info: *const OrtTypeInfo, + out: *mut *const OrtTensorTypeAndShapeInfo, + ) -> OrtStatusPtr, + >, + pub GetOnnxTypeFromTypeInfo: ::std::option::Option< + unsafe extern "C" fn(type_info: *const OrtTypeInfo, out: *mut ONNXType) -> OrtStatusPtr, + >, + pub CreateTensorTypeAndShapeInfo: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtTensorTypeAndShapeInfo) -> OrtStatusPtr, + >, + pub SetTensorElementType: ::std::option::Option< + unsafe extern "C" fn( + info: *mut OrtTensorTypeAndShapeInfo, + type_: ONNXTensorElementDataType, + ) -> OrtStatusPtr, + >, + pub SetDimensions: ::std::option::Option< + unsafe extern "C" fn( + info: *mut OrtTensorTypeAndShapeInfo, + dim_values: *const i64, + dim_count: usize, + ) -> OrtStatusPtr, + >, + pub GetTensorElementType: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtTensorTypeAndShapeInfo, + out: *mut ONNXTensorElementDataType, + ) -> OrtStatusPtr, + >, + pub GetDimensionsCount: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtTensorTypeAndShapeInfo, + out: *mut usize, + ) -> OrtStatusPtr, + >, + pub GetDimensions: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtTensorTypeAndShapeInfo, + dim_values: *mut i64, + dim_values_length: usize, + ) -> OrtStatusPtr, + >, + pub GetSymbolicDimensions: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtTensorTypeAndShapeInfo, + dim_params: *mut *const ::std::os::raw::c_char, + dim_params_length: usize, + ) -> OrtStatusPtr, + >, + pub GetTensorShapeElementCount: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtTensorTypeAndShapeInfo, + out: *mut usize, + ) -> OrtStatusPtr, + >, + pub GetTensorTypeAndShape: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + out: *mut *mut OrtTensorTypeAndShapeInfo, + ) -> OrtStatusPtr, + >, + pub GetTypeInfo: ::std::option::Option< + unsafe extern "C" fn(value: *const OrtValue, out: *mut *mut OrtTypeInfo) -> OrtStatusPtr, + >, + pub GetValueType: ::std::option::Option< + unsafe extern "C" fn(value: *const OrtValue, out: *mut ONNXType) -> OrtStatusPtr, + >, + pub CreateMemoryInfo: ::std::option::Option< + unsafe extern "C" fn( + name: *const ::std::os::raw::c_char, + type_: OrtAllocatorType, + id: ::std::os::raw::c_int, + mem_type: OrtMemType, + out: *mut *mut OrtMemoryInfo, + ) -> OrtStatusPtr, + >, + pub CreateCpuMemoryInfo: ::std::option::Option< + unsafe extern "C" fn( + type_: OrtAllocatorType, + mem_type: OrtMemType, + out: *mut *mut OrtMemoryInfo, + ) -> OrtStatusPtr, + >, + pub CompareMemoryInfo: ::std::option::Option< + unsafe extern "C" fn( + info1: *const OrtMemoryInfo, + info2: *const OrtMemoryInfo, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub MemoryInfoGetName: ::std::option::Option< + unsafe extern "C" fn( + ptr: *const OrtMemoryInfo, + out: *mut *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub MemoryInfoGetId: ::std::option::Option< + unsafe extern "C" fn( + ptr: *const OrtMemoryInfo, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub MemoryInfoGetMemType: ::std::option::Option< + unsafe extern "C" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemType) -> OrtStatusPtr, + >, + pub MemoryInfoGetType: ::std::option::Option< + unsafe extern "C" fn(ptr: *const OrtMemoryInfo, out: *mut OrtAllocatorType) -> OrtStatusPtr, + >, + pub AllocatorAlloc: ::std::option::Option< + unsafe extern "C" fn( + ort_allocator: *mut OrtAllocator, + size: usize, + out: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub AllocatorFree: ::std::option::Option< + unsafe extern "C" fn( + ort_allocator: *mut OrtAllocator, + p: *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub AllocatorGetInfo: ::std::option::Option< + unsafe extern "C" fn( + ort_allocator: *const OrtAllocator, + out: *mut *const OrtMemoryInfo, + ) -> OrtStatusPtr, + >, + pub GetAllocatorWithDefaultOptions: + ::std::option::Option OrtStatusPtr>, + pub AddFreeDimensionOverride: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + dim_denotation: *const ::std::os::raw::c_char, + dim_value: i64, + ) -> OrtStatusPtr, + >, + pub GetValue: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + index: ::std::os::raw::c_int, + allocator: *mut OrtAllocator, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub GetValueCount: ::std::option::Option< + unsafe extern "C" fn(value: *const OrtValue, out: *mut usize) -> OrtStatusPtr, + >, + pub CreateValue: ::std::option::Option< + unsafe extern "C" fn( + in_: *const *const OrtValue, + num_values: usize, + value_type: ONNXType, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub CreateOpaqueValue: ::std::option::Option< + unsafe extern "C" fn( + domain_name: *const ::std::os::raw::c_char, + type_name: *const ::std::os::raw::c_char, + data_container: *const ::std::os::raw::c_void, + data_container_size: usize, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub GetOpaqueValue: ::std::option::Option< + unsafe extern "C" fn( + domain_name: *const ::std::os::raw::c_char, + type_name: *const ::std::os::raw::c_char, + in_: *const OrtValue, + data_container: *mut ::std::os::raw::c_void, + data_container_size: usize, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_float: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + out: *mut f32, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_int64: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + out: *mut i64, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_string: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelContext_GetInputCount: ::std::option::Option< + unsafe extern "C" fn(context: *const OrtKernelContext, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelContext_GetOutputCount: ::std::option::Option< + unsafe extern "C" fn(context: *const OrtKernelContext, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelContext_GetInput: ::std::option::Option< + unsafe extern "C" fn( + context: *const OrtKernelContext, + index: usize, + out: *mut *const OrtValue, + ) -> OrtStatusPtr, + >, + pub KernelContext_GetOutput: ::std::option::Option< + unsafe extern "C" fn( + context: *mut OrtKernelContext, + index: usize, + dim_values: *const i64, + dim_count: usize, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub ReleaseEnv: ::std::option::Option, + pub ReleaseStatus: ::std::option::Option, + pub ReleaseMemoryInfo: ::std::option::Option, + pub ReleaseSession: ::std::option::Option, + pub ReleaseValue: ::std::option::Option, + pub ReleaseRunOptions: ::std::option::Option, + pub ReleaseTypeInfo: ::std::option::Option, + pub ReleaseTensorTypeAndShapeInfo: + ::std::option::Option, + pub ReleaseSessionOptions: + ::std::option::Option, + pub ReleaseCustomOpDomain: + ::std::option::Option, + pub GetDenotationFromTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + type_info: *const OrtTypeInfo, + denotation: *mut *const ::std::os::raw::c_char, + len: *mut usize, + ) -> OrtStatusPtr, + >, + pub CastTypeInfoToMapTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + type_info: *const OrtTypeInfo, + out: *mut *const OrtMapTypeInfo, + ) -> OrtStatusPtr, + >, + pub CastTypeInfoToSequenceTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + type_info: *const OrtTypeInfo, + out: *mut *const OrtSequenceTypeInfo, + ) -> OrtStatusPtr, + >, + pub GetMapKeyType: ::std::option::Option< + unsafe extern "C" fn( + map_type_info: *const OrtMapTypeInfo, + out: *mut ONNXTensorElementDataType, + ) -> OrtStatusPtr, + >, + pub GetMapValueType: ::std::option::Option< + unsafe extern "C" fn( + map_type_info: *const OrtMapTypeInfo, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub GetSequenceElementType: ::std::option::Option< + unsafe extern "C" fn( + sequence_type_info: *const OrtSequenceTypeInfo, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub ReleaseMapTypeInfo: ::std::option::Option, + pub ReleaseSequenceTypeInfo: + ::std::option::Option, + pub SessionEndProfiling: ::std::option::Option< + unsafe extern "C" fn( + session: *mut OrtSession, + allocator: *mut OrtAllocator, + out: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub SessionGetModelMetadata: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + out: *mut *mut OrtModelMetadata, + ) -> OrtStatusPtr, + >, + pub ModelMetadataGetProducerName: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub ModelMetadataGetGraphName: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub ModelMetadataGetDomain: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub ModelMetadataGetDescription: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub ModelMetadataLookupCustomMetadataMap: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + key: *const ::std::os::raw::c_char, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub ModelMetadataGetVersion: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + value: *mut i64, + ) -> OrtStatusPtr, + >, + pub ReleaseModelMetadata: + ::std::option::Option, + pub CreateEnvWithGlobalThreadPools: ::std::option::Option< + unsafe extern "C" fn( + log_severity_level: OrtLoggingLevel, + logid: *const ::std::os::raw::c_char, + tp_options: *const OrtThreadingOptions, + out: *mut *mut OrtEnv, + ) -> OrtStatusPtr, + >, + pub DisablePerSessionThreads: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub CreateThreadingOptions: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtThreadingOptions) -> OrtStatusPtr, + >, + pub ReleaseThreadingOptions: + ::std::option::Option, + pub ModelMetadataGetCustomMetadataMapKeys: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + keys: *mut *mut *mut ::std::os::raw::c_char, + num_keys: *mut i64, + ) -> OrtStatusPtr, + >, + pub AddFreeDimensionOverrideByName: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + dim_name: *const ::std::os::raw::c_char, + dim_value: i64, + ) -> OrtStatusPtr, + >, + pub GetAvailableProviders: ::std::option::Option< + unsafe extern "C" fn( + out_ptr: *mut *mut *mut ::std::os::raw::c_char, + provider_length: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub ReleaseAvailableProviders: ::std::option::Option< + unsafe extern "C" fn( + ptr: *mut *mut ::std::os::raw::c_char, + providers_length: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetStringTensorElementLength: ::std::option::Option< + unsafe extern "C" fn(value: *const OrtValue, index: usize, out: *mut usize) -> OrtStatusPtr, + >, + pub GetStringTensorElement: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + s_len: usize, + index: usize, + s: *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub FillStringTensorElement: ::std::option::Option< + unsafe extern "C" fn( + value: *mut OrtValue, + s: *const ::std::os::raw::c_char, + index: usize, + ) -> OrtStatusPtr, + >, + pub AddSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub CreateAllocator: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + mem_info: *const OrtMemoryInfo, + out: *mut *mut OrtAllocator, + ) -> OrtStatusPtr, + >, + pub ReleaseAllocator: ::std::option::Option, + pub RunWithBinding: ::std::option::Option< + unsafe extern "C" fn( + session: *mut OrtSession, + run_options: *const OrtRunOptions, + binding_ptr: *const OrtIoBinding, + ) -> OrtStatusPtr, + >, + pub CreateIoBinding: ::std::option::Option< + unsafe extern "C" fn(session: *mut OrtSession, out: *mut *mut OrtIoBinding) -> OrtStatusPtr, + >, + pub ReleaseIoBinding: ::std::option::Option, + pub BindInput: ::std::option::Option< + unsafe extern "C" fn( + binding_ptr: *mut OrtIoBinding, + name: *const ::std::os::raw::c_char, + val_ptr: *const OrtValue, + ) -> OrtStatusPtr, + >, + pub BindOutput: ::std::option::Option< + unsafe extern "C" fn( + binding_ptr: *mut OrtIoBinding, + name: *const ::std::os::raw::c_char, + val_ptr: *const OrtValue, + ) -> OrtStatusPtr, + >, + pub BindOutputToDevice: ::std::option::Option< + unsafe extern "C" fn( + binding_ptr: *mut OrtIoBinding, + name: *const ::std::os::raw::c_char, + mem_info_ptr: *const OrtMemoryInfo, + ) -> OrtStatusPtr, + >, + pub GetBoundOutputNames: ::std::option::Option< + unsafe extern "C" fn( + binding_ptr: *const OrtIoBinding, + allocator: *mut OrtAllocator, + buffer: *mut *mut ::std::os::raw::c_char, + lengths: *mut *mut usize, + count: *mut usize, + ) -> OrtStatusPtr, + >, + pub GetBoundOutputValues: ::std::option::Option< + unsafe extern "C" fn( + binding_ptr: *const OrtIoBinding, + allocator: *mut OrtAllocator, + output: *mut *mut *mut OrtValue, + output_count: *mut usize, + ) -> OrtStatusPtr, + >, + #[doc = " \\brief Clears any previously set Inputs for an ::OrtIoBinding"] + pub ClearBoundInputs: + ::std::option::Option, + #[doc = " \\brief Clears any previously set Outputs for an ::OrtIoBinding"] + pub ClearBoundOutputs: + ::std::option::Option, + pub TensorAt: ::std::option::Option< + unsafe extern "C" fn( + value: *mut OrtValue, + location_values: *const i64, + location_values_count: usize, + out: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub CreateAndRegisterAllocator: ::std::option::Option< + unsafe extern "C" fn( + env: *mut OrtEnv, + mem_info: *const OrtMemoryInfo, + arena_cfg: *const OrtArenaCfg, + ) -> OrtStatusPtr, + >, + pub SetLanguageProjection: ::std::option::Option< + unsafe extern "C" fn( + ort_env: *const OrtEnv, + projection: OrtLanguageProjection, + ) -> OrtStatusPtr, + >, + pub SessionGetProfilingStartTimeNs: ::std::option::Option< + unsafe extern "C" fn(session: *const OrtSession, out: *mut u64) -> OrtStatusPtr, + >, + pub SetGlobalIntraOpNumThreads: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + intra_op_num_threads: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub SetGlobalInterOpNumThreads: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + inter_op_num_threads: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub SetGlobalSpinControl: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + allow_spinning: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub AddInitializer: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + name: *const ::std::os::raw::c_char, + val: *const OrtValue, + ) -> OrtStatusPtr, + >, + pub CreateEnvWithCustomLoggerAndGlobalThreadPools: ::std::option::Option< + unsafe extern "C" fn( + logging_function: OrtLoggingFunction, + logger_param: *mut ::std::os::raw::c_void, + log_severity_level: OrtLoggingLevel, + logid: *const ::std::os::raw::c_char, + tp_options: *const OrtThreadingOptions, + out: *mut *mut OrtEnv, + ) -> OrtStatusPtr, + >, + pub SessionOptionsAppendExecutionProvider_CUDA: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + cuda_options: *const OrtCUDAProviderOptions, + ) -> OrtStatusPtr, + >, + pub SessionOptionsAppendExecutionProvider_ROCM: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + rocm_options: *const OrtROCMProviderOptions, + ) -> OrtStatusPtr, + >, + pub SessionOptionsAppendExecutionProvider_OpenVINO: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + provider_options: *const OrtOpenVINOProviderOptions, + ) -> OrtStatusPtr, + >, + pub SetGlobalDenormalAsZero: ::std::option::Option< + unsafe extern "C" fn(tp_options: *mut OrtThreadingOptions) -> OrtStatusPtr, + >, + pub CreateArenaCfg: ::std::option::Option< + unsafe extern "C" fn( + max_mem: usize, + arena_extend_strategy: ::std::os::raw::c_int, + initial_chunk_size_bytes: ::std::os::raw::c_int, + max_dead_bytes_per_chunk: ::std::os::raw::c_int, + out: *mut *mut OrtArenaCfg, + ) -> OrtStatusPtr, + >, + pub ReleaseArenaCfg: ::std::option::Option, + pub ModelMetadataGetGraphDescription: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub SessionOptionsAppendExecutionProvider_TensorRT: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + tensorrt_options: *const OrtTensorRTProviderOptions, + ) -> OrtStatusPtr, + >, + pub SetCurrentGpuDeviceId: ::std::option::Option< + unsafe extern "C" fn(device_id: ::std::os::raw::c_int) -> OrtStatusPtr, + >, + pub GetCurrentGpuDeviceId: ::std::option::Option< + unsafe extern "C" fn(device_id: *mut ::std::os::raw::c_int) -> OrtStatusPtr, + >, + pub KernelInfoGetAttributeArray_float: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + out: *mut f32, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttributeArray_int64: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + out: *mut i64, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub CreateArenaCfgV2: ::std::option::Option< + unsafe extern "C" fn( + arena_config_keys: *const *const ::std::os::raw::c_char, + arena_config_values: *const usize, + num_keys: usize, + out: *mut *mut OrtArenaCfg, + ) -> OrtStatusPtr, + >, + pub AddRunConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtRunOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub CreatePrepackedWeightsContainer: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtPrepackedWeightsContainer) -> OrtStatusPtr, + >, + pub ReleasePrepackedWeightsContainer: + ::std::option::Option, + pub CreateSessionWithPrepackedWeightsContainer: ::std::option::Option< + unsafe extern "C" fn( + env: *const OrtEnv, + model_path: *const ::std::os::raw::c_char, + options: *const OrtSessionOptions, + prepacked_weights_container: *mut OrtPrepackedWeightsContainer, + out: *mut *mut OrtSession, + ) -> OrtStatusPtr, + >, + pub CreateSessionFromArrayWithPrepackedWeightsContainer: ::std::option::Option< + unsafe extern "C" fn( + env: *const OrtEnv, + model_data: *const ::std::os::raw::c_void, + model_data_length: usize, + options: *const OrtSessionOptions, + prepacked_weights_container: *mut OrtPrepackedWeightsContainer, + out: *mut *mut OrtSession, + ) -> OrtStatusPtr, + >, + pub SessionOptionsAppendExecutionProvider_TensorRT_V2: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + tensorrt_options: *const OrtTensorRTProviderOptionsV2, + ) -> OrtStatusPtr, + >, + pub CreateTensorRTProviderOptions: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtTensorRTProviderOptionsV2) -> OrtStatusPtr, + >, + pub UpdateTensorRTProviderOptions: ::std::option::Option< + unsafe extern "C" fn( + tensorrt_options: *mut OrtTensorRTProviderOptionsV2, + provider_options_keys: *const *const ::std::os::raw::c_char, + provider_options_values: *const *const ::std::os::raw::c_char, + num_keys: usize, + ) -> OrtStatusPtr, + >, + pub GetTensorRTProviderOptionsAsString: ::std::option::Option< + unsafe extern "C" fn( + tensorrt_options: *const OrtTensorRTProviderOptionsV2, + allocator: *mut OrtAllocator, + ptr: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + #[doc = " \\brief Release an ::OrtTensorRTProviderOptionsV2"] + #[doc = ""] + #[doc = " \\note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does"] + pub ReleaseTensorRTProviderOptions: + ::std::option::Option, + pub EnableOrtCustomOps: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub RegisterAllocator: ::std::option::Option< + unsafe extern "C" fn(env: *mut OrtEnv, allocator: *mut OrtAllocator) -> OrtStatusPtr, + >, + pub UnregisterAllocator: ::std::option::Option< + unsafe extern "C" fn(env: *mut OrtEnv, mem_info: *const OrtMemoryInfo) -> OrtStatusPtr, + >, + pub IsSparseTensor: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub CreateSparseTensorAsOrtValue: ::std::option::Option< + unsafe extern "C" fn( + allocator: *mut OrtAllocator, + dense_shape: *const i64, + dense_shape_len: usize, + type_: ONNXTensorElementDataType, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub FillSparseTensorCoo: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + data_mem_info: *const OrtMemoryInfo, + values_shape: *const i64, + values_shape_len: usize, + values: *const ::std::os::raw::c_void, + indices_data: *const i64, + indices_num: usize, + ) -> OrtStatusPtr, + >, + pub FillSparseTensorCsr: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + data_mem_info: *const OrtMemoryInfo, + values_shape: *const i64, + values_shape_len: usize, + values: *const ::std::os::raw::c_void, + inner_indices_data: *const i64, + inner_indices_num: usize, + outer_indices_data: *const i64, + outer_indices_num: usize, + ) -> OrtStatusPtr, + >, + pub FillSparseTensorBlockSparse: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + data_mem_info: *const OrtMemoryInfo, + values_shape: *const i64, + values_shape_len: usize, + values: *const ::std::os::raw::c_void, + indices_shape_data: *const i64, + indices_shape_len: usize, + indices_data: *const i32, + ) -> OrtStatusPtr, + >, + pub CreateSparseTensorWithValuesAsOrtValue: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtMemoryInfo, + p_data: *mut ::std::os::raw::c_void, + dense_shape: *const i64, + dense_shape_len: usize, + values_shape: *const i64, + values_shape_len: usize, + type_: ONNXTensorElementDataType, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub UseCooIndices: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + indices_data: *mut i64, + indices_num: usize, + ) -> OrtStatusPtr, + >, + pub UseCsrIndices: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + inner_data: *mut i64, + inner_num: usize, + outer_data: *mut i64, + outer_num: usize, + ) -> OrtStatusPtr, + >, + pub UseBlockSparseIndices: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + indices_shape: *const i64, + indices_shape_len: usize, + indices_data: *mut i32, + ) -> OrtStatusPtr, + >, + pub GetSparseTensorFormat: ::std::option::Option< + unsafe extern "C" fn(ort_value: *const OrtValue, out: *mut OrtSparseFormat) -> OrtStatusPtr, + >, + pub GetSparseTensorValuesTypeAndShape: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *const OrtValue, + out: *mut *mut OrtTensorTypeAndShapeInfo, + ) -> OrtStatusPtr, + >, + pub GetSparseTensorValues: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *const OrtValue, + out: *mut *const ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub GetSparseTensorIndicesTypeShape: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *const OrtValue, + indices_format: OrtSparseIndicesFormat, + out: *mut *mut OrtTensorTypeAndShapeInfo, + ) -> OrtStatusPtr, + >, + pub GetSparseTensorIndices: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *const OrtValue, + indices_format: OrtSparseIndicesFormat, + num_indices: *mut usize, + indices: *mut *const ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub HasValue: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub KernelContext_GetGPUComputeStream: ::std::option::Option< + unsafe extern "C" fn( + context: *const OrtKernelContext, + out: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub GetTensorMemoryInfo: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + mem_info: *mut *const OrtMemoryInfo, + ) -> OrtStatusPtr, + >, + pub GetExecutionProviderApi: ::std::option::Option< + unsafe extern "C" fn( + provider_name: *const ::std::os::raw::c_char, + version: u32, + provider_api: *mut *const ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub SessionOptionsSetCustomCreateThreadFn: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + ort_custom_create_thread_fn: OrtCustomCreateThreadFn, + ) -> OrtStatusPtr, + >, + pub SessionOptionsSetCustomThreadCreationOptions: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + ort_custom_thread_creation_options: *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub SessionOptionsSetCustomJoinThreadFn: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + ort_custom_join_thread_fn: OrtCustomJoinThreadFn, + ) -> OrtStatusPtr, + >, + pub SetGlobalCustomCreateThreadFn: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + ort_custom_create_thread_fn: OrtCustomCreateThreadFn, + ) -> OrtStatusPtr, + >, + pub SetGlobalCustomThreadCreationOptions: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + ort_custom_thread_creation_options: *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub SetGlobalCustomJoinThreadFn: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + ort_custom_join_thread_fn: OrtCustomJoinThreadFn, + ) -> OrtStatusPtr, + >, + pub SynchronizeBoundInputs: + ::std::option::Option OrtStatusPtr>, + pub SynchronizeBoundOutputs: + ::std::option::Option OrtStatusPtr>, + pub SessionOptionsAppendExecutionProvider_CUDA_V2: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + cuda_options: *const OrtCUDAProviderOptionsV2, + ) -> OrtStatusPtr, + >, + pub CreateCUDAProviderOptions: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtCUDAProviderOptionsV2) -> OrtStatusPtr, + >, + pub UpdateCUDAProviderOptions: ::std::option::Option< + unsafe extern "C" fn( + cuda_options: *mut OrtCUDAProviderOptionsV2, + provider_options_keys: *const *const ::std::os::raw::c_char, + provider_options_values: *const *const ::std::os::raw::c_char, + num_keys: usize, + ) -> OrtStatusPtr, + >, + pub GetCUDAProviderOptionsAsString: ::std::option::Option< + unsafe extern "C" fn( + cuda_options: *const OrtCUDAProviderOptionsV2, + allocator: *mut OrtAllocator, + ptr: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + #[doc = " \\brief Release an ::OrtCUDAProviderOptionsV2"] + #[doc = ""] + #[doc = " \\note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does"] + #[doc = ""] + #[doc = " \\since Version 1.11."] + pub ReleaseCUDAProviderOptions: + ::std::option::Option, + pub SessionOptionsAppendExecutionProvider_MIGraphX: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + migraphx_options: *const OrtMIGraphXProviderOptions, + ) -> OrtStatusPtr, + >, + pub AddExternalInitializers: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + initializer_names: *const *const ::std::os::raw::c_char, + initializers: *const *const OrtValue, + initializers_num: usize, + ) -> OrtStatusPtr, + >, + pub CreateOpAttr: ::std::option::Option< + unsafe extern "C" fn( + name: *const ::std::os::raw::c_char, + data: *const ::std::os::raw::c_void, + len: ::std::os::raw::c_int, + type_: OrtOpAttrType, + op_attr: *mut *mut OrtOpAttr, + ) -> OrtStatusPtr, + >, + pub ReleaseOpAttr: ::std::option::Option, + pub CreateOp: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + op_name: *const ::std::os::raw::c_char, + domain: *const ::std::os::raw::c_char, + version: ::std::os::raw::c_int, + type_constraint_names: *mut *const ::std::os::raw::c_char, + type_constraint_values: *const ONNXTensorElementDataType, + type_constraint_count: ::std::os::raw::c_int, + attr_values: *const *const OrtOpAttr, + attr_count: ::std::os::raw::c_int, + input_count: ::std::os::raw::c_int, + output_count: ::std::os::raw::c_int, + ort_op: *mut *mut OrtOp, + ) -> OrtStatusPtr, + >, + pub InvokeOp: ::std::option::Option< + unsafe extern "C" fn( + context: *const OrtKernelContext, + ort_op: *const OrtOp, + input_values: *const *const OrtValue, + input_count: ::std::os::raw::c_int, + output_values: *const *mut OrtValue, + output_count: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub ReleaseOp: ::std::option::Option, + pub SessionOptionsAppendExecutionProvider: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + provider_name: *const ::std::os::raw::c_char, + provider_options_keys: *const *const ::std::os::raw::c_char, + provider_options_values: *const *const ::std::os::raw::c_char, + num_keys: usize, + ) -> OrtStatusPtr, + >, + pub CopyKernelInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + info_copy: *mut *mut OrtKernelInfo, + ) -> OrtStatusPtr, + >, + pub ReleaseKernelInfo: ::std::option::Option, + pub GetTrainingApi: + ::std::option::Option *const OrtTrainingApi>, + pub SessionOptionsAppendExecutionProvider_CANN: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + cann_options: *const OrtCANNProviderOptions, + ) -> OrtStatusPtr, + >, + pub CreateCANNProviderOptions: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtCANNProviderOptions) -> OrtStatusPtr, + >, + pub UpdateCANNProviderOptions: ::std::option::Option< + unsafe extern "C" fn( + cann_options: *mut OrtCANNProviderOptions, + provider_options_keys: *const *const ::std::os::raw::c_char, + provider_options_values: *const *const ::std::os::raw::c_char, + num_keys: usize, + ) -> OrtStatusPtr, + >, + pub GetCANNProviderOptionsAsString: ::std::option::Option< + unsafe extern "C" fn( + cann_options: *const OrtCANNProviderOptions, + allocator: *mut OrtAllocator, + ptr: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + #[doc = " \\brief Release an OrtCANNProviderOptions"] + #[doc = ""] + #[doc = " \\param[in] the pointer of OrtCANNProviderOptions which will been deleted"] + #[doc = ""] + #[doc = " \\since Version 1.13."] + pub ReleaseCANNProviderOptions: + ::std::option::Option, +} +#[test] +fn bindgen_test_layout_OrtApi() { + assert_eq!( + ::std::mem::size_of::(), + 1800usize, + concat!("Size of: ", stringify!(OrtApi)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtApi)) + ); + fn test_field_CreateStatus() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateStatus) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateStatus) + ) + ); + } + test_field_CreateStatus(); + fn test_field_GetErrorCode() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetErrorCode) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetErrorCode) + ) + ); + } + test_field_GetErrorCode(); + fn test_field_GetErrorMessage() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetErrorMessage) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetErrorMessage) + ) + ); + } + test_field_GetErrorMessage(); + fn test_field_CreateEnv() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateEnv) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateEnv) + ) + ); + } + test_field_CreateEnv(); + fn test_field_CreateEnvWithCustomLogger() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateEnvWithCustomLogger) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateEnvWithCustomLogger) + ) + ); + } + test_field_CreateEnvWithCustomLogger(); + fn test_field_EnableTelemetryEvents() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).EnableTelemetryEvents) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(EnableTelemetryEvents) + ) + ); + } + test_field_EnableTelemetryEvents(); + fn test_field_DisableTelemetryEvents() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).DisableTelemetryEvents) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(DisableTelemetryEvents) + ) + ); + } + test_field_DisableTelemetryEvents(); + fn test_field_CreateSession() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSession) as usize - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSession) + ) + ); + } + test_field_CreateSession(); + fn test_field_CreateSessionFromArray() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSessionFromArray) as usize - ptr as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSessionFromArray) + ) + ); + } + test_field_CreateSessionFromArray(); + fn test_field_Run() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).Run) as usize - ptr as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(Run) + ) + ); + } + test_field_Run(); + fn test_field_CreateSessionOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSessionOptions) as usize - ptr as usize + }, + 80usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSessionOptions) + ) + ); + } + test_field_CreateSessionOptions(); + fn test_field_SetOptimizedModelFilePath() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetOptimizedModelFilePath) as usize - ptr as usize + }, + 88usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetOptimizedModelFilePath) + ) + ); + } + test_field_SetOptimizedModelFilePath(); + fn test_field_CloneSessionOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CloneSessionOptions) as usize - ptr as usize + }, + 96usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CloneSessionOptions) + ) + ); + } + test_field_CloneSessionOptions(); + fn test_field_SetSessionExecutionMode() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetSessionExecutionMode) as usize - ptr as usize + }, + 104usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetSessionExecutionMode) + ) + ); + } + test_field_SetSessionExecutionMode(); + fn test_field_EnableProfiling() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).EnableProfiling) as usize - ptr as usize + }, + 112usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(EnableProfiling) + ) + ); + } + test_field_EnableProfiling(); + fn test_field_DisableProfiling() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).DisableProfiling) as usize - ptr as usize + }, + 120usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(DisableProfiling) + ) + ); + } + test_field_DisableProfiling(); + fn test_field_EnableMemPattern() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).EnableMemPattern) as usize - ptr as usize + }, + 128usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(EnableMemPattern) + ) + ); + } + test_field_EnableMemPattern(); + fn test_field_DisableMemPattern() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).DisableMemPattern) as usize - ptr as usize + }, + 136usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(DisableMemPattern) + ) + ); + } + test_field_DisableMemPattern(); + fn test_field_EnableCpuMemArena() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).EnableCpuMemArena) as usize - ptr as usize + }, + 144usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(EnableCpuMemArena) + ) + ); + } + test_field_EnableCpuMemArena(); + fn test_field_DisableCpuMemArena() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).DisableCpuMemArena) as usize - ptr as usize + }, + 152usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(DisableCpuMemArena) + ) + ); + } + test_field_DisableCpuMemArena(); + fn test_field_SetSessionLogId() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetSessionLogId) as usize - ptr as usize + }, + 160usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetSessionLogId) + ) + ); + } + test_field_SetSessionLogId(); + fn test_field_SetSessionLogVerbosityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetSessionLogVerbosityLevel) as usize - ptr as usize + }, + 168usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetSessionLogVerbosityLevel) + ) + ); + } + test_field_SetSessionLogVerbosityLevel(); + fn test_field_SetSessionLogSeverityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetSessionLogSeverityLevel) as usize - ptr as usize + }, + 176usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetSessionLogSeverityLevel) + ) + ); + } + test_field_SetSessionLogSeverityLevel(); + fn test_field_SetSessionGraphOptimizationLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetSessionGraphOptimizationLevel) as usize + - ptr as usize + }, + 184usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetSessionGraphOptimizationLevel) + ) + ); + } + test_field_SetSessionGraphOptimizationLevel(); + fn test_field_SetIntraOpNumThreads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetIntraOpNumThreads) as usize - ptr as usize + }, + 192usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetIntraOpNumThreads) + ) + ); + } + test_field_SetIntraOpNumThreads(); + fn test_field_SetInterOpNumThreads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetInterOpNumThreads) as usize - ptr as usize + }, + 200usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetInterOpNumThreads) + ) + ); + } + test_field_SetInterOpNumThreads(); + fn test_field_CreateCustomOpDomain() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateCustomOpDomain) as usize - ptr as usize + }, + 208usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateCustomOpDomain) + ) + ); + } + test_field_CreateCustomOpDomain(); + fn test_field_CustomOpDomain_Add() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CustomOpDomain_Add) as usize - ptr as usize + }, + 216usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CustomOpDomain_Add) + ) + ); + } + test_field_CustomOpDomain_Add(); + fn test_field_AddCustomOpDomain() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddCustomOpDomain) as usize - ptr as usize + }, + 224usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddCustomOpDomain) + ) + ); + } + test_field_AddCustomOpDomain(); + fn test_field_RegisterCustomOpsLibrary() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsLibrary) as usize - ptr as usize + }, + 232usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsLibrary) + ) + ); + } + test_field_RegisterCustomOpsLibrary(); + fn test_field_SessionGetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetInputCount) as usize - ptr as usize + }, + 240usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetInputCount) + ) + ); + } + test_field_SessionGetInputCount(); + fn test_field_SessionGetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOutputCount) as usize - ptr as usize + }, + 248usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOutputCount) + ) + ); + } + test_field_SessionGetOutputCount(); + fn test_field_SessionGetOverridableInitializerCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOverridableInitializerCount) as usize + - ptr as usize + }, + 256usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOverridableInitializerCount) + ) + ); + } + test_field_SessionGetOverridableInitializerCount(); + fn test_field_SessionGetInputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetInputTypeInfo) as usize - ptr as usize + }, + 264usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetInputTypeInfo) + ) + ); + } + test_field_SessionGetInputTypeInfo(); + fn test_field_SessionGetOutputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOutputTypeInfo) as usize - ptr as usize + }, + 272usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOutputTypeInfo) + ) + ); + } + test_field_SessionGetOutputTypeInfo(); + fn test_field_SessionGetOverridableInitializerTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOverridableInitializerTypeInfo) as usize + - ptr as usize + }, + 280usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOverridableInitializerTypeInfo) + ) + ); + } + test_field_SessionGetOverridableInitializerTypeInfo(); + fn test_field_SessionGetInputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetInputName) as usize - ptr as usize + }, + 288usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetInputName) + ) + ); + } + test_field_SessionGetInputName(); + fn test_field_SessionGetOutputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOutputName) as usize - ptr as usize + }, + 296usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOutputName) + ) + ); + } + test_field_SessionGetOutputName(); + fn test_field_SessionGetOverridableInitializerName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOverridableInitializerName) as usize + - ptr as usize + }, + 304usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOverridableInitializerName) + ) + ); + } + test_field_SessionGetOverridableInitializerName(); + fn test_field_CreateRunOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateRunOptions) as usize - ptr as usize + }, + 312usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateRunOptions) + ) + ); + } + test_field_CreateRunOptions(); + fn test_field_RunOptionsSetRunLogVerbosityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsSetRunLogVerbosityLevel) as usize + - ptr as usize + }, + 320usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsSetRunLogVerbosityLevel) + ) + ); + } + test_field_RunOptionsSetRunLogVerbosityLevel(); + fn test_field_RunOptionsSetRunLogSeverityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsSetRunLogSeverityLevel) as usize + - ptr as usize + }, + 328usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsSetRunLogSeverityLevel) + ) + ); + } + test_field_RunOptionsSetRunLogSeverityLevel(); + fn test_field_RunOptionsSetRunTag() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsSetRunTag) as usize - ptr as usize + }, + 336usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsSetRunTag) + ) + ); + } + test_field_RunOptionsSetRunTag(); + fn test_field_RunOptionsGetRunLogVerbosityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsGetRunLogVerbosityLevel) as usize + - ptr as usize + }, + 344usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsGetRunLogVerbosityLevel) + ) + ); + } + test_field_RunOptionsGetRunLogVerbosityLevel(); + fn test_field_RunOptionsGetRunLogSeverityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsGetRunLogSeverityLevel) as usize + - ptr as usize + }, + 352usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsGetRunLogSeverityLevel) + ) + ); + } + test_field_RunOptionsGetRunLogSeverityLevel(); + fn test_field_RunOptionsGetRunTag() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsGetRunTag) as usize - ptr as usize + }, + 360usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsGetRunTag) + ) + ); + } + test_field_RunOptionsGetRunTag(); + fn test_field_RunOptionsSetTerminate() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsSetTerminate) as usize - ptr as usize + }, + 368usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsSetTerminate) + ) + ); + } + test_field_RunOptionsSetTerminate(); + fn test_field_RunOptionsUnsetTerminate() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsUnsetTerminate) as usize - ptr as usize + }, + 376usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsUnsetTerminate) + ) + ); + } + test_field_RunOptionsUnsetTerminate(); + fn test_field_CreateTensorAsOrtValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateTensorAsOrtValue) as usize - ptr as usize + }, + 384usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateTensorAsOrtValue) + ) + ); + } + test_field_CreateTensorAsOrtValue(); + fn test_field_CreateTensorWithDataAsOrtValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateTensorWithDataAsOrtValue) as usize - ptr as usize + }, + 392usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateTensorWithDataAsOrtValue) + ) + ); + } + test_field_CreateTensorWithDataAsOrtValue(); + fn test_field_IsTensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).IsTensor) as usize - ptr as usize + }, + 400usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(IsTensor) + ) + ); + } + test_field_IsTensor(); + fn test_field_GetTensorMutableData() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorMutableData) as usize - ptr as usize + }, + 408usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorMutableData) + ) + ); + } + test_field_GetTensorMutableData(); + fn test_field_FillStringTensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).FillStringTensor) as usize - ptr as usize + }, + 416usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(FillStringTensor) + ) + ); + } + test_field_FillStringTensor(); + fn test_field_GetStringTensorDataLength() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetStringTensorDataLength) as usize - ptr as usize + }, + 424usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetStringTensorDataLength) + ) + ); + } + test_field_GetStringTensorDataLength(); + fn test_field_GetStringTensorContent() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetStringTensorContent) as usize - ptr as usize + }, + 432usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetStringTensorContent) + ) + ); + } + test_field_GetStringTensorContent(); + fn test_field_CastTypeInfoToTensorInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CastTypeInfoToTensorInfo) as usize - ptr as usize + }, + 440usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CastTypeInfoToTensorInfo) + ) + ); + } + test_field_CastTypeInfoToTensorInfo(); + fn test_field_GetOnnxTypeFromTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetOnnxTypeFromTypeInfo) as usize - ptr as usize + }, + 448usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetOnnxTypeFromTypeInfo) + ) + ); + } + test_field_GetOnnxTypeFromTypeInfo(); + fn test_field_CreateTensorTypeAndShapeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateTensorTypeAndShapeInfo) as usize - ptr as usize + }, + 456usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateTensorTypeAndShapeInfo) + ) + ); + } + test_field_CreateTensorTypeAndShapeInfo(); + fn test_field_SetTensorElementType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetTensorElementType) as usize - ptr as usize + }, + 464usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetTensorElementType) + ) + ); + } + test_field_SetTensorElementType(); + fn test_field_SetDimensions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetDimensions) as usize - ptr as usize + }, + 472usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetDimensions) + ) + ); + } + test_field_SetDimensions(); + fn test_field_GetTensorElementType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorElementType) as usize - ptr as usize + }, + 480usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorElementType) + ) + ); + } + test_field_GetTensorElementType(); + fn test_field_GetDimensionsCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetDimensionsCount) as usize - ptr as usize + }, + 488usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetDimensionsCount) + ) + ); + } + test_field_GetDimensionsCount(); + fn test_field_GetDimensions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetDimensions) as usize - ptr as usize + }, + 496usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetDimensions) + ) + ); + } + test_field_GetDimensions(); + fn test_field_GetSymbolicDimensions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSymbolicDimensions) as usize - ptr as usize + }, + 504usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSymbolicDimensions) + ) + ); + } + test_field_GetSymbolicDimensions(); + fn test_field_GetTensorShapeElementCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorShapeElementCount) as usize - ptr as usize + }, + 512usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorShapeElementCount) + ) + ); + } + test_field_GetTensorShapeElementCount(); + fn test_field_GetTensorTypeAndShape() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorTypeAndShape) as usize - ptr as usize + }, + 520usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorTypeAndShape) + ) + ); + } + test_field_GetTensorTypeAndShape(); + fn test_field_GetTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTypeInfo) as usize - ptr as usize + }, + 528usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTypeInfo) + ) + ); + } + test_field_GetTypeInfo(); + fn test_field_GetValueType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetValueType) as usize - ptr as usize + }, + 536usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetValueType) + ) + ); + } + test_field_GetValueType(); + fn test_field_CreateMemoryInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateMemoryInfo) as usize - ptr as usize + }, + 544usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateMemoryInfo) + ) + ); + } + test_field_CreateMemoryInfo(); + fn test_field_CreateCpuMemoryInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateCpuMemoryInfo) as usize - ptr as usize + }, + 552usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateCpuMemoryInfo) + ) + ); + } + test_field_CreateCpuMemoryInfo(); + fn test_field_CompareMemoryInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CompareMemoryInfo) as usize - ptr as usize + }, + 560usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CompareMemoryInfo) + ) + ); + } + test_field_CompareMemoryInfo(); + fn test_field_MemoryInfoGetName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetName) as usize - ptr as usize + }, + 568usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetName) + ) + ); + } + test_field_MemoryInfoGetName(); + fn test_field_MemoryInfoGetId() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetId) as usize - ptr as usize + }, + 576usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetId) + ) + ); + } + test_field_MemoryInfoGetId(); + fn test_field_MemoryInfoGetMemType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetMemType) as usize - ptr as usize + }, + 584usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetMemType) + ) + ); + } + test_field_MemoryInfoGetMemType(); + fn test_field_MemoryInfoGetType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetType) as usize - ptr as usize + }, + 592usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetType) + ) + ); + } + test_field_MemoryInfoGetType(); + fn test_field_AllocatorAlloc() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AllocatorAlloc) as usize - ptr as usize + }, + 600usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AllocatorAlloc) + ) + ); + } + test_field_AllocatorAlloc(); + fn test_field_AllocatorFree() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AllocatorFree) as usize - ptr as usize + }, + 608usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AllocatorFree) + ) + ); + } + test_field_AllocatorFree(); + fn test_field_AllocatorGetInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AllocatorGetInfo) as usize - ptr as usize + }, + 616usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AllocatorGetInfo) + ) + ); + } + test_field_AllocatorGetInfo(); + fn test_field_GetAllocatorWithDefaultOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetAllocatorWithDefaultOptions) as usize - ptr as usize + }, + 624usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetAllocatorWithDefaultOptions) + ) + ); + } + test_field_GetAllocatorWithDefaultOptions(); + fn test_field_AddFreeDimensionOverride() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddFreeDimensionOverride) as usize - ptr as usize + }, + 632usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddFreeDimensionOverride) + ) + ); + } + test_field_AddFreeDimensionOverride(); + fn test_field_GetValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetValue) as usize - ptr as usize + }, + 640usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetValue) + ) + ); + } + test_field_GetValue(); + fn test_field_GetValueCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetValueCount) as usize - ptr as usize + }, + 648usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetValueCount) + ) + ); + } + test_field_GetValueCount(); + fn test_field_CreateValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateValue) as usize - ptr as usize + }, + 656usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateValue) + ) + ); + } + test_field_CreateValue(); + fn test_field_CreateOpaqueValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateOpaqueValue) as usize - ptr as usize + }, + 664usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateOpaqueValue) + ) + ); + } + test_field_CreateOpaqueValue(); + fn test_field_GetOpaqueValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetOpaqueValue) as usize - ptr as usize + }, + 672usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetOpaqueValue) + ) + ); + } + test_field_GetOpaqueValue(); + fn test_field_KernelInfoGetAttribute_float() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_float) as usize - ptr as usize + }, + 680usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_float) + ) + ); + } + test_field_KernelInfoGetAttribute_float(); + fn test_field_KernelInfoGetAttribute_int64() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_int64) as usize - ptr as usize + }, + 688usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_int64) + ) + ); + } + test_field_KernelInfoGetAttribute_int64(); + fn test_field_KernelInfoGetAttribute_string() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_string) as usize - ptr as usize + }, + 696usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_string) + ) + ); + } + test_field_KernelInfoGetAttribute_string(); + fn test_field_KernelContext_GetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetInputCount) as usize - ptr as usize + }, + 704usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetInputCount) + ) + ); + } + test_field_KernelContext_GetInputCount(); + fn test_field_KernelContext_GetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetOutputCount) as usize - ptr as usize + }, + 712usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetOutputCount) + ) + ); + } + test_field_KernelContext_GetOutputCount(); + fn test_field_KernelContext_GetInput() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetInput) as usize - ptr as usize + }, + 720usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetInput) + ) + ); + } + test_field_KernelContext_GetInput(); + fn test_field_KernelContext_GetOutput() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetOutput) as usize - ptr as usize + }, + 728usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetOutput) + ) + ); + } + test_field_KernelContext_GetOutput(); + fn test_field_ReleaseEnv() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseEnv) as usize - ptr as usize + }, + 736usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseEnv) + ) + ); + } + test_field_ReleaseEnv(); + fn test_field_ReleaseStatus() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseStatus) as usize - ptr as usize + }, + 744usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseStatus) + ) + ); + } + test_field_ReleaseStatus(); + fn test_field_ReleaseMemoryInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseMemoryInfo) as usize - ptr as usize + }, + 752usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseMemoryInfo) + ) + ); + } + test_field_ReleaseMemoryInfo(); + fn test_field_ReleaseSession() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseSession) as usize - ptr as usize + }, + 760usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseSession) + ) + ); + } + test_field_ReleaseSession(); + fn test_field_ReleaseValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseValue) as usize - ptr as usize + }, + 768usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseValue) + ) + ); + } + test_field_ReleaseValue(); + fn test_field_ReleaseRunOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseRunOptions) as usize - ptr as usize + }, + 776usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseRunOptions) + ) + ); + } + test_field_ReleaseRunOptions(); + fn test_field_ReleaseTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseTypeInfo) as usize - ptr as usize + }, + 784usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseTypeInfo) + ) + ); + } + test_field_ReleaseTypeInfo(); + fn test_field_ReleaseTensorTypeAndShapeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseTensorTypeAndShapeInfo) as usize - ptr as usize + }, + 792usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseTensorTypeAndShapeInfo) + ) + ); + } + test_field_ReleaseTensorTypeAndShapeInfo(); + fn test_field_ReleaseSessionOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseSessionOptions) as usize - ptr as usize + }, + 800usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseSessionOptions) + ) + ); + } + test_field_ReleaseSessionOptions(); + fn test_field_ReleaseCustomOpDomain() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseCustomOpDomain) as usize - ptr as usize + }, + 808usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseCustomOpDomain) + ) + ); + } + test_field_ReleaseCustomOpDomain(); + fn test_field_GetDenotationFromTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetDenotationFromTypeInfo) as usize - ptr as usize + }, + 816usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetDenotationFromTypeInfo) + ) + ); + } + test_field_GetDenotationFromTypeInfo(); + fn test_field_CastTypeInfoToMapTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CastTypeInfoToMapTypeInfo) as usize - ptr as usize + }, + 824usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CastTypeInfoToMapTypeInfo) + ) + ); + } + test_field_CastTypeInfoToMapTypeInfo(); + fn test_field_CastTypeInfoToSequenceTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CastTypeInfoToSequenceTypeInfo) as usize - ptr as usize + }, + 832usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CastTypeInfoToSequenceTypeInfo) + ) + ); + } + test_field_CastTypeInfoToSequenceTypeInfo(); + fn test_field_GetMapKeyType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetMapKeyType) as usize - ptr as usize + }, + 840usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetMapKeyType) + ) + ); + } + test_field_GetMapKeyType(); + fn test_field_GetMapValueType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetMapValueType) as usize - ptr as usize + }, + 848usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetMapValueType) + ) + ); + } + test_field_GetMapValueType(); + fn test_field_GetSequenceElementType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSequenceElementType) as usize - ptr as usize + }, + 856usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSequenceElementType) + ) + ); + } + test_field_GetSequenceElementType(); + fn test_field_ReleaseMapTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseMapTypeInfo) as usize - ptr as usize + }, + 864usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseMapTypeInfo) + ) + ); + } + test_field_ReleaseMapTypeInfo(); + fn test_field_ReleaseSequenceTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseSequenceTypeInfo) as usize - ptr as usize + }, + 872usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseSequenceTypeInfo) + ) + ); + } + test_field_ReleaseSequenceTypeInfo(); + fn test_field_SessionEndProfiling() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionEndProfiling) as usize - ptr as usize + }, + 880usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionEndProfiling) + ) + ); + } + test_field_SessionEndProfiling(); + fn test_field_SessionGetModelMetadata() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetModelMetadata) as usize - ptr as usize + }, + 888usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetModelMetadata) + ) + ); + } + test_field_SessionGetModelMetadata(); + fn test_field_ModelMetadataGetProducerName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetProducerName) as usize - ptr as usize + }, + 896usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetProducerName) + ) + ); + } + test_field_ModelMetadataGetProducerName(); + fn test_field_ModelMetadataGetGraphName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetGraphName) as usize - ptr as usize + }, + 904usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetGraphName) + ) + ); + } + test_field_ModelMetadataGetGraphName(); + fn test_field_ModelMetadataGetDomain() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetDomain) as usize - ptr as usize + }, + 912usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetDomain) + ) + ); + } + test_field_ModelMetadataGetDomain(); + fn test_field_ModelMetadataGetDescription() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetDescription) as usize - ptr as usize + }, + 920usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetDescription) + ) + ); + } + test_field_ModelMetadataGetDescription(); + fn test_field_ModelMetadataLookupCustomMetadataMap() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataLookupCustomMetadataMap) as usize + - ptr as usize + }, + 928usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataLookupCustomMetadataMap) + ) + ); + } + test_field_ModelMetadataLookupCustomMetadataMap(); + fn test_field_ModelMetadataGetVersion() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetVersion) as usize - ptr as usize + }, + 936usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetVersion) + ) + ); + } + test_field_ModelMetadataGetVersion(); + fn test_field_ReleaseModelMetadata() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseModelMetadata) as usize - ptr as usize + }, + 944usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseModelMetadata) + ) + ); + } + test_field_ReleaseModelMetadata(); + fn test_field_CreateEnvWithGlobalThreadPools() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateEnvWithGlobalThreadPools) as usize - ptr as usize + }, + 952usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateEnvWithGlobalThreadPools) + ) + ); + } + test_field_CreateEnvWithGlobalThreadPools(); + fn test_field_DisablePerSessionThreads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).DisablePerSessionThreads) as usize - ptr as usize + }, + 960usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(DisablePerSessionThreads) + ) + ); + } + test_field_DisablePerSessionThreads(); + fn test_field_CreateThreadingOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateThreadingOptions) as usize - ptr as usize + }, + 968usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateThreadingOptions) + ) + ); + } + test_field_CreateThreadingOptions(); + fn test_field_ReleaseThreadingOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseThreadingOptions) as usize - ptr as usize + }, + 976usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseThreadingOptions) + ) + ); + } + test_field_ReleaseThreadingOptions(); + fn test_field_ModelMetadataGetCustomMetadataMapKeys() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetCustomMetadataMapKeys) as usize + - ptr as usize + }, + 984usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetCustomMetadataMapKeys) + ) + ); + } + test_field_ModelMetadataGetCustomMetadataMapKeys(); + fn test_field_AddFreeDimensionOverrideByName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddFreeDimensionOverrideByName) as usize - ptr as usize + }, + 992usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddFreeDimensionOverrideByName) + ) + ); + } + test_field_AddFreeDimensionOverrideByName(); + fn test_field_GetAvailableProviders() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetAvailableProviders) as usize - ptr as usize + }, + 1000usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetAvailableProviders) + ) + ); + } + test_field_GetAvailableProviders(); + fn test_field_ReleaseAvailableProviders() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseAvailableProviders) as usize - ptr as usize + }, + 1008usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseAvailableProviders) + ) + ); + } + test_field_ReleaseAvailableProviders(); + fn test_field_GetStringTensorElementLength() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetStringTensorElementLength) as usize - ptr as usize + }, + 1016usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetStringTensorElementLength) + ) + ); + } + test_field_GetStringTensorElementLength(); + fn test_field_GetStringTensorElement() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetStringTensorElement) as usize - ptr as usize + }, + 1024usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetStringTensorElement) + ) + ); + } + test_field_GetStringTensorElement(); + fn test_field_FillStringTensorElement() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).FillStringTensorElement) as usize - ptr as usize + }, + 1032usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(FillStringTensorElement) + ) + ); + } + test_field_FillStringTensorElement(); + fn test_field_AddSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddSessionConfigEntry) as usize - ptr as usize + }, + 1040usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddSessionConfigEntry) + ) + ); + } + test_field_AddSessionConfigEntry(); + fn test_field_CreateAllocator() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateAllocator) as usize - ptr as usize + }, + 1048usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateAllocator) + ) + ); + } + test_field_CreateAllocator(); + fn test_field_ReleaseAllocator() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseAllocator) as usize - ptr as usize + }, + 1056usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseAllocator) + ) + ); + } + test_field_ReleaseAllocator(); + fn test_field_RunWithBinding() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunWithBinding) as usize - ptr as usize + }, + 1064usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunWithBinding) + ) + ); + } + test_field_RunWithBinding(); + fn test_field_CreateIoBinding() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateIoBinding) as usize - ptr as usize + }, + 1072usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateIoBinding) + ) + ); + } + test_field_CreateIoBinding(); + fn test_field_ReleaseIoBinding() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseIoBinding) as usize - ptr as usize + }, + 1080usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseIoBinding) + ) + ); + } + test_field_ReleaseIoBinding(); + fn test_field_BindInput() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).BindInput) as usize - ptr as usize + }, + 1088usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(BindInput) + ) + ); + } + test_field_BindInput(); + fn test_field_BindOutput() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).BindOutput) as usize - ptr as usize + }, + 1096usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(BindOutput) + ) + ); + } + test_field_BindOutput(); + fn test_field_BindOutputToDevice() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).BindOutputToDevice) as usize - ptr as usize + }, + 1104usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(BindOutputToDevice) + ) + ); + } + test_field_BindOutputToDevice(); + fn test_field_GetBoundOutputNames() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetBoundOutputNames) as usize - ptr as usize + }, + 1112usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetBoundOutputNames) + ) + ); + } + test_field_GetBoundOutputNames(); + fn test_field_GetBoundOutputValues() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetBoundOutputValues) as usize - ptr as usize + }, + 1120usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetBoundOutputValues) + ) + ); + } + test_field_GetBoundOutputValues(); + fn test_field_ClearBoundInputs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ClearBoundInputs) as usize - ptr as usize + }, + 1128usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ClearBoundInputs) + ) + ); + } + test_field_ClearBoundInputs(); + fn test_field_ClearBoundOutputs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ClearBoundOutputs) as usize - ptr as usize + }, + 1136usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ClearBoundOutputs) + ) + ); + } + test_field_ClearBoundOutputs(); + fn test_field_TensorAt() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).TensorAt) as usize - ptr as usize + }, + 1144usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(TensorAt) + ) + ); + } + test_field_TensorAt(); + fn test_field_CreateAndRegisterAllocator() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateAndRegisterAllocator) as usize - ptr as usize + }, + 1152usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateAndRegisterAllocator) + ) + ); + } + test_field_CreateAndRegisterAllocator(); + fn test_field_SetLanguageProjection() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetLanguageProjection) as usize - ptr as usize + }, + 1160usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetLanguageProjection) + ) + ); + } + test_field_SetLanguageProjection(); + fn test_field_SessionGetProfilingStartTimeNs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetProfilingStartTimeNs) as usize - ptr as usize + }, + 1168usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetProfilingStartTimeNs) + ) + ); + } + test_field_SessionGetProfilingStartTimeNs(); + fn test_field_SetGlobalIntraOpNumThreads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalIntraOpNumThreads) as usize - ptr as usize + }, + 1176usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalIntraOpNumThreads) + ) + ); + } + test_field_SetGlobalIntraOpNumThreads(); + fn test_field_SetGlobalInterOpNumThreads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalInterOpNumThreads) as usize - ptr as usize + }, + 1184usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalInterOpNumThreads) + ) + ); + } + test_field_SetGlobalInterOpNumThreads(); + fn test_field_SetGlobalSpinControl() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalSpinControl) as usize - ptr as usize + }, + 1192usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalSpinControl) + ) + ); + } + test_field_SetGlobalSpinControl(); + fn test_field_AddInitializer() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddInitializer) as usize - ptr as usize + }, + 1200usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddInitializer) + ) + ); + } + test_field_AddInitializer(); + fn test_field_CreateEnvWithCustomLoggerAndGlobalThreadPools() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateEnvWithCustomLoggerAndGlobalThreadPools) as usize + - ptr as usize + }, + 1208usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateEnvWithCustomLoggerAndGlobalThreadPools) + ) + ); + } + test_field_CreateEnvWithCustomLoggerAndGlobalThreadPools(); + fn test_field_SessionOptionsAppendExecutionProvider_CUDA() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_CUDA) as usize + - ptr as usize + }, + 1216usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_CUDA) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_CUDA(); + fn test_field_SessionOptionsAppendExecutionProvider_ROCM() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_ROCM) as usize + - ptr as usize + }, + 1224usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_ROCM) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_ROCM(); + fn test_field_SessionOptionsAppendExecutionProvider_OpenVINO() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_OpenVINO) as usize + - ptr as usize + }, + 1232usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_OpenVINO) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_OpenVINO(); + fn test_field_SetGlobalDenormalAsZero() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalDenormalAsZero) as usize - ptr as usize + }, + 1240usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalDenormalAsZero) + ) + ); + } + test_field_SetGlobalDenormalAsZero(); + fn test_field_CreateArenaCfg() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateArenaCfg) as usize - ptr as usize + }, + 1248usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateArenaCfg) + ) + ); + } + test_field_CreateArenaCfg(); + fn test_field_ReleaseArenaCfg() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseArenaCfg) as usize - ptr as usize + }, + 1256usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseArenaCfg) + ) + ); + } + test_field_ReleaseArenaCfg(); + fn test_field_ModelMetadataGetGraphDescription() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetGraphDescription) as usize + - ptr as usize + }, + 1264usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetGraphDescription) + ) + ); + } + test_field_ModelMetadataGetGraphDescription(); + fn test_field_SessionOptionsAppendExecutionProvider_TensorRT() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_TensorRT) as usize + - ptr as usize + }, + 1272usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_TensorRT) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_TensorRT(); + fn test_field_SetCurrentGpuDeviceId() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetCurrentGpuDeviceId) as usize - ptr as usize + }, + 1280usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetCurrentGpuDeviceId) + ) + ); + } + test_field_SetCurrentGpuDeviceId(); + fn test_field_GetCurrentGpuDeviceId() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetCurrentGpuDeviceId) as usize - ptr as usize + }, + 1288usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetCurrentGpuDeviceId) + ) + ); + } + test_field_GetCurrentGpuDeviceId(); + fn test_field_KernelInfoGetAttributeArray_float() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttributeArray_float) as usize + - ptr as usize + }, + 1296usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttributeArray_float) + ) + ); + } + test_field_KernelInfoGetAttributeArray_float(); + fn test_field_KernelInfoGetAttributeArray_int64() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttributeArray_int64) as usize + - ptr as usize + }, + 1304usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttributeArray_int64) + ) + ); + } + test_field_KernelInfoGetAttributeArray_int64(); + fn test_field_CreateArenaCfgV2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateArenaCfgV2) as usize - ptr as usize + }, + 1312usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateArenaCfgV2) + ) + ); + } + test_field_CreateArenaCfgV2(); + fn test_field_AddRunConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddRunConfigEntry) as usize - ptr as usize + }, + 1320usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddRunConfigEntry) + ) + ); + } + test_field_AddRunConfigEntry(); + fn test_field_CreatePrepackedWeightsContainer() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreatePrepackedWeightsContainer) as usize - ptr as usize + }, + 1328usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreatePrepackedWeightsContainer) + ) + ); + } + test_field_CreatePrepackedWeightsContainer(); + fn test_field_ReleasePrepackedWeightsContainer() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleasePrepackedWeightsContainer) as usize + - ptr as usize + }, + 1336usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleasePrepackedWeightsContainer) + ) + ); + } + test_field_ReleasePrepackedWeightsContainer(); + fn test_field_CreateSessionWithPrepackedWeightsContainer() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSessionWithPrepackedWeightsContainer) as usize + - ptr as usize + }, + 1344usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSessionWithPrepackedWeightsContainer) + ) + ); + } + test_field_CreateSessionWithPrepackedWeightsContainer(); + fn test_field_CreateSessionFromArrayWithPrepackedWeightsContainer() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSessionFromArrayWithPrepackedWeightsContainer) + as usize + - ptr as usize + }, + 1352usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSessionFromArrayWithPrepackedWeightsContainer) + ) + ); + } + test_field_CreateSessionFromArrayWithPrepackedWeightsContainer(); + fn test_field_SessionOptionsAppendExecutionProvider_TensorRT_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_TensorRT_V2) + as usize + - ptr as usize + }, + 1360usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_TensorRT_V2) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_TensorRT_V2(); + fn test_field_CreateTensorRTProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateTensorRTProviderOptions) as usize - ptr as usize + }, + 1368usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateTensorRTProviderOptions) + ) + ); + } + test_field_CreateTensorRTProviderOptions(); + fn test_field_UpdateTensorRTProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateTensorRTProviderOptions) as usize - ptr as usize + }, + 1376usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateTensorRTProviderOptions) + ) + ); + } + test_field_UpdateTensorRTProviderOptions(); + fn test_field_GetTensorRTProviderOptionsAsString() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorRTProviderOptionsAsString) as usize + - ptr as usize + }, + 1384usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorRTProviderOptionsAsString) + ) + ); + } + test_field_GetTensorRTProviderOptionsAsString(); + fn test_field_ReleaseTensorRTProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseTensorRTProviderOptions) as usize - ptr as usize + }, + 1392usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseTensorRTProviderOptions) + ) + ); + } + test_field_ReleaseTensorRTProviderOptions(); + fn test_field_EnableOrtCustomOps() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).EnableOrtCustomOps) as usize - ptr as usize + }, + 1400usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(EnableOrtCustomOps) + ) + ); + } + test_field_EnableOrtCustomOps(); + fn test_field_RegisterAllocator() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterAllocator) as usize - ptr as usize + }, + 1408usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterAllocator) + ) + ); + } + test_field_RegisterAllocator(); + fn test_field_UnregisterAllocator() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UnregisterAllocator) as usize - ptr as usize + }, + 1416usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UnregisterAllocator) + ) + ); + } + test_field_UnregisterAllocator(); + fn test_field_IsSparseTensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).IsSparseTensor) as usize - ptr as usize + }, + 1424usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(IsSparseTensor) + ) + ); + } + test_field_IsSparseTensor(); + fn test_field_CreateSparseTensorAsOrtValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSparseTensorAsOrtValue) as usize - ptr as usize + }, + 1432usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSparseTensorAsOrtValue) + ) + ); + } + test_field_CreateSparseTensorAsOrtValue(); + fn test_field_FillSparseTensorCoo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).FillSparseTensorCoo) as usize - ptr as usize + }, + 1440usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(FillSparseTensorCoo) + ) + ); + } + test_field_FillSparseTensorCoo(); + fn test_field_FillSparseTensorCsr() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).FillSparseTensorCsr) as usize - ptr as usize + }, + 1448usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(FillSparseTensorCsr) + ) + ); + } + test_field_FillSparseTensorCsr(); + fn test_field_FillSparseTensorBlockSparse() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).FillSparseTensorBlockSparse) as usize - ptr as usize + }, + 1456usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(FillSparseTensorBlockSparse) + ) + ); + } + test_field_FillSparseTensorBlockSparse(); + fn test_field_CreateSparseTensorWithValuesAsOrtValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSparseTensorWithValuesAsOrtValue) as usize + - ptr as usize + }, + 1464usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSparseTensorWithValuesAsOrtValue) + ) + ); + } + test_field_CreateSparseTensorWithValuesAsOrtValue(); + fn test_field_UseCooIndices() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UseCooIndices) as usize - ptr as usize + }, + 1472usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UseCooIndices) + ) + ); + } + test_field_UseCooIndices(); + fn test_field_UseCsrIndices() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UseCsrIndices) as usize - ptr as usize + }, + 1480usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UseCsrIndices) + ) + ); + } + test_field_UseCsrIndices(); + fn test_field_UseBlockSparseIndices() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UseBlockSparseIndices) as usize - ptr as usize + }, + 1488usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UseBlockSparseIndices) + ) + ); + } + test_field_UseBlockSparseIndices(); + fn test_field_GetSparseTensorFormat() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSparseTensorFormat) as usize - ptr as usize + }, + 1496usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSparseTensorFormat) + ) + ); + } + test_field_GetSparseTensorFormat(); + fn test_field_GetSparseTensorValuesTypeAndShape() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSparseTensorValuesTypeAndShape) as usize + - ptr as usize + }, + 1504usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSparseTensorValuesTypeAndShape) + ) + ); + } + test_field_GetSparseTensorValuesTypeAndShape(); + fn test_field_GetSparseTensorValues() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSparseTensorValues) as usize - ptr as usize + }, + 1512usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSparseTensorValues) + ) + ); + } + test_field_GetSparseTensorValues(); + fn test_field_GetSparseTensorIndicesTypeShape() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSparseTensorIndicesTypeShape) as usize - ptr as usize + }, + 1520usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSparseTensorIndicesTypeShape) + ) + ); + } + test_field_GetSparseTensorIndicesTypeShape(); + fn test_field_GetSparseTensorIndices() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSparseTensorIndices) as usize - ptr as usize + }, + 1528usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSparseTensorIndices) + ) + ); + } + test_field_GetSparseTensorIndices(); + fn test_field_HasValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).HasValue) as usize - ptr as usize + }, + 1536usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(HasValue) + ) + ); + } + test_field_HasValue(); + fn test_field_KernelContext_GetGPUComputeStream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetGPUComputeStream) as usize + - ptr as usize + }, + 1544usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetGPUComputeStream) + ) + ); + } + test_field_KernelContext_GetGPUComputeStream(); + fn test_field_GetTensorMemoryInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorMemoryInfo) as usize - ptr as usize + }, + 1552usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorMemoryInfo) + ) + ); + } + test_field_GetTensorMemoryInfo(); + fn test_field_GetExecutionProviderApi() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetExecutionProviderApi) as usize - ptr as usize + }, + 1560usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetExecutionProviderApi) + ) + ); + } + test_field_GetExecutionProviderApi(); + fn test_field_SessionOptionsSetCustomCreateThreadFn() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsSetCustomCreateThreadFn) as usize + - ptr as usize + }, + 1568usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsSetCustomCreateThreadFn) + ) + ); + } + test_field_SessionOptionsSetCustomCreateThreadFn(); + fn test_field_SessionOptionsSetCustomThreadCreationOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsSetCustomThreadCreationOptions) as usize + - ptr as usize + }, + 1576usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsSetCustomThreadCreationOptions) + ) + ); + } + test_field_SessionOptionsSetCustomThreadCreationOptions(); + fn test_field_SessionOptionsSetCustomJoinThreadFn() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsSetCustomJoinThreadFn) as usize + - ptr as usize + }, + 1584usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsSetCustomJoinThreadFn) + ) + ); + } + test_field_SessionOptionsSetCustomJoinThreadFn(); + fn test_field_SetGlobalCustomCreateThreadFn() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalCustomCreateThreadFn) as usize - ptr as usize + }, + 1592usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalCustomCreateThreadFn) + ) + ); + } + test_field_SetGlobalCustomCreateThreadFn(); + fn test_field_SetGlobalCustomThreadCreationOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalCustomThreadCreationOptions) as usize + - ptr as usize + }, + 1600usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalCustomThreadCreationOptions) + ) + ); + } + test_field_SetGlobalCustomThreadCreationOptions(); + fn test_field_SetGlobalCustomJoinThreadFn() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalCustomJoinThreadFn) as usize - ptr as usize + }, + 1608usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalCustomJoinThreadFn) + ) + ); + } + test_field_SetGlobalCustomJoinThreadFn(); + fn test_field_SynchronizeBoundInputs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SynchronizeBoundInputs) as usize - ptr as usize + }, + 1616usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SynchronizeBoundInputs) + ) + ); + } + test_field_SynchronizeBoundInputs(); + fn test_field_SynchronizeBoundOutputs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SynchronizeBoundOutputs) as usize - ptr as usize + }, + 1624usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SynchronizeBoundOutputs) + ) + ); + } + test_field_SynchronizeBoundOutputs(); + fn test_field_SessionOptionsAppendExecutionProvider_CUDA_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_CUDA_V2) as usize + - ptr as usize + }, + 1632usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_CUDA_V2) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_CUDA_V2(); + fn test_field_CreateCUDAProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateCUDAProviderOptions) as usize - ptr as usize + }, + 1640usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateCUDAProviderOptions) + ) + ); + } + test_field_CreateCUDAProviderOptions(); + fn test_field_UpdateCUDAProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateCUDAProviderOptions) as usize - ptr as usize + }, + 1648usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateCUDAProviderOptions) + ) + ); + } + test_field_UpdateCUDAProviderOptions(); + fn test_field_GetCUDAProviderOptionsAsString() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetCUDAProviderOptionsAsString) as usize - ptr as usize + }, + 1656usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetCUDAProviderOptionsAsString) + ) + ); + } + test_field_GetCUDAProviderOptionsAsString(); + fn test_field_ReleaseCUDAProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseCUDAProviderOptions) as usize - ptr as usize + }, + 1664usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseCUDAProviderOptions) + ) + ); + } + test_field_ReleaseCUDAProviderOptions(); + fn test_field_SessionOptionsAppendExecutionProvider_MIGraphX() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_MIGraphX) as usize + - ptr as usize + }, + 1672usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_MIGraphX) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_MIGraphX(); + fn test_field_AddExternalInitializers() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddExternalInitializers) as usize - ptr as usize + }, + 1680usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddExternalInitializers) + ) + ); + } + test_field_AddExternalInitializers(); + fn test_field_CreateOpAttr() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateOpAttr) as usize - ptr as usize + }, + 1688usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateOpAttr) + ) + ); + } + test_field_CreateOpAttr(); + fn test_field_ReleaseOpAttr() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseOpAttr) as usize - ptr as usize + }, + 1696usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseOpAttr) + ) + ); + } + test_field_ReleaseOpAttr(); + fn test_field_CreateOp() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateOp) as usize - ptr as usize + }, + 1704usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateOp) + ) + ); + } + test_field_CreateOp(); + fn test_field_InvokeOp() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).InvokeOp) as usize - ptr as usize + }, + 1712usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(InvokeOp) + ) + ); + } + test_field_InvokeOp(); + fn test_field_ReleaseOp() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseOp) as usize - ptr as usize + }, + 1720usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseOp) + ) + ); + } + test_field_ReleaseOp(); + fn test_field_SessionOptionsAppendExecutionProvider() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider) as usize + - ptr as usize + }, + 1728usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider(); + fn test_field_CopyKernelInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CopyKernelInfo) as usize - ptr as usize + }, + 1736usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CopyKernelInfo) + ) + ); + } + test_field_CopyKernelInfo(); + fn test_field_ReleaseKernelInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseKernelInfo) as usize - ptr as usize + }, + 1744usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseKernelInfo) + ) + ); + } + test_field_ReleaseKernelInfo(); + fn test_field_GetTrainingApi() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTrainingApi) as usize - ptr as usize + }, + 1752usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTrainingApi) + ) + ); + } + test_field_GetTrainingApi(); + fn test_field_SessionOptionsAppendExecutionProvider_CANN() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_CANN) as usize + - ptr as usize + }, + 1760usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_CANN) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_CANN(); + fn test_field_CreateCANNProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateCANNProviderOptions) as usize - ptr as usize + }, + 1768usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateCANNProviderOptions) + ) + ); + } + test_field_CreateCANNProviderOptions(); + fn test_field_UpdateCANNProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateCANNProviderOptions) as usize - ptr as usize + }, + 1776usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateCANNProviderOptions) + ) + ); + } + test_field_UpdateCANNProviderOptions(); + fn test_field_GetCANNProviderOptionsAsString() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetCANNProviderOptionsAsString) as usize - ptr as usize + }, + 1784usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetCANNProviderOptionsAsString) + ) + ); + } + test_field_GetCANNProviderOptionsAsString(); + fn test_field_ReleaseCANNProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseCANNProviderOptions) as usize - ptr as usize + }, + 1792usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseCANNProviderOptions) + ) + ); + } + test_field_ReleaseCANNProviderOptions(); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtCustomOpInputOutputCharacteristic { + INPUT_OUTPUT_REQUIRED = 0, + INPUT_OUTPUT_OPTIONAL = 1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCustomOp { + pub version: u32, + pub CreateKernel: ::std::option::Option< + unsafe extern "C" fn( + op: *const OrtCustomOp, + api: *const OrtApi, + info: *const OrtKernelInfo, + ) -> *mut ::std::os::raw::c_void, + >, + pub GetName: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> *const ::std::os::raw::c_char, + >, + pub GetExecutionProviderType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> *const ::std::os::raw::c_char, + >, + pub GetInputType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> ONNXTensorElementDataType, + >, + pub GetInputTypeCount: + ::std::option::Option usize>, + pub GetOutputType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> ONNXTensorElementDataType, + >, + pub GetOutputTypeCount: + ::std::option::Option usize>, + pub KernelCompute: ::std::option::Option< + unsafe extern "C" fn( + op_kernel: *mut ::std::os::raw::c_void, + context: *mut OrtKernelContext, + ), + >, + pub KernelDestroy: + ::std::option::Option, + pub GetInputCharacteristic: ::std::option::Option< + unsafe extern "C" fn( + op: *const OrtCustomOp, + index: usize, + ) -> OrtCustomOpInputOutputCharacteristic, + >, + pub GetOutputCharacteristic: ::std::option::Option< + unsafe extern "C" fn( + op: *const OrtCustomOp, + index: usize, + ) -> OrtCustomOpInputOutputCharacteristic, + >, +} +#[test] +fn bindgen_test_layout_OrtCustomOp() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(OrtCustomOp)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtCustomOp)) + ); + fn test_field_version() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(version) + ) + ); + } + test_field_version(); + fn test_field_CreateKernel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateKernel) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(CreateKernel) + ) + ); + } + test_field_CreateKernel(); + fn test_field_GetName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetName) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetName) + ) + ); + } + test_field_GetName(); + fn test_field_GetExecutionProviderType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetExecutionProviderType) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetExecutionProviderType) + ) + ); + } + test_field_GetExecutionProviderType(); + fn test_field_GetInputType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputType) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputType) + ) + ); + } + test_field_GetInputType(); + fn test_field_GetInputTypeCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputTypeCount) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputTypeCount) + ) + ); + } + test_field_GetInputTypeCount(); + fn test_field_GetOutputType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetOutputType) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetOutputType) + ) + ); + } + test_field_GetOutputType(); + fn test_field_GetOutputTypeCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetOutputTypeCount) as usize - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetOutputTypeCount) + ) + ); + } + test_field_GetOutputTypeCount(); + fn test_field_KernelCompute() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelCompute) as usize - ptr as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(KernelCompute) + ) + ); + } + test_field_KernelCompute(); + fn test_field_KernelDestroy() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelDestroy) as usize - ptr as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(KernelDestroy) + ) + ); + } + test_field_KernelDestroy(); + fn test_field_GetInputCharacteristic() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputCharacteristic) as usize - ptr as usize + }, + 80usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputCharacteristic) + ) + ); + } + test_field_GetInputCharacteristic(); + fn test_field_GetOutputCharacteristic() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetOutputCharacteristic) as usize - ptr as usize + }, + 88usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetOutputCharacteristic) + ) + ); + } + test_field_GetOutputCharacteristic(); +} +extern "C" { + pub fn OrtSessionOptionsAppendExecutionProvider_CUDA( + options: *mut OrtSessionOptions, + device_id: ::std::os::raw::c_int, + ) -> OrtStatusPtr; +} +extern "C" { + pub fn OrtSessionOptionsAppendExecutionProvider_MIGraphX( + options: *mut OrtSessionOptions, + device_id: ::std::os::raw::c_int, + ) -> OrtStatusPtr; +} From 75423fc0cb81040b94e2136abf9c1c99ce369aa5 Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Wed, 29 Mar 2023 00:30:10 +0900 Subject: [PATCH 02/21] change iOS library target to ios-arm64 and ios-arm64_x86_64-simulator --- onnxruntime-sys/build.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index d80b5ffe..0dc261b5 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -588,10 +588,7 @@ fn prepare_libort_dir_prebuilt() -> PathBuf { #[cfg(not(feature = "directml"))] let extract_dir = match TRIPLET.os { Os::Android => extract_dir, - Os::IOs => extract_dir - .join("onnxruntime.xcframework") - .join("ios-arm64") - .join("onnxruntime.framework"), + Os::IOs => extract_dir, _ => extract_dir.join(prebuilt_archive.file_stem().unwrap()), }; From b666249a837ec9a58a171edf87fd37aeb2f46773 Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Thu, 30 Mar 2023 03:00:06 +0900 Subject: [PATCH 03/21] add compile strategy for only iOS --- onnxruntime-sys/Cargo.toml | 1 + onnxruntime-sys/build.rs | 129 +++++++++++++++++++++++++++++++++---- 2 files changed, 116 insertions(+), 14 deletions(-) diff --git a/onnxruntime-sys/Cargo.toml b/onnxruntime-sys/Cargo.toml index 4892420d..0179a184 100644 --- a/onnxruntime-sys/Cargo.toml +++ b/onnxruntime-sys/Cargo.toml @@ -20,6 +20,7 @@ keywords = ["neuralnetworks", "onnx", "bindings"] once_cell = "1.13.0" bindgen = { version = "0.60.1", optional = true } ureq = "2.1" +git2 = "0.16.1" # Used on Windows zip = "0.6.2" diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 0dc261b5..9fec3560 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -1,10 +1,12 @@ #![allow(dead_code)] +use git2::{build::CheckoutBuilder, Repository}; use std::{ borrow::Cow, env, fs, io::{self, Read, Write}, path::{Path, PathBuf}, + process::Command, str::FromStr, }; @@ -22,8 +24,11 @@ const ORT_RELEASE_BASE_URL: &str = "https://github.com/microsoft/onnxruntime/rel const ORT_MAVEN_RELEASE_BASE_URL: &str = "https://repo1.maven.org/maven2/com/microsoft/onnxruntime/onnxruntime-android"; -/// Base Url from which to download pre-build releases for ios/ -const ORT_COCOAPODS_RELEASE_BASE_URL: &str = "https://onnxruntimepackages.z14.web.core.windows.net"; +/// onnxruntime repository/ +const ORT_REPOSITORY_URL: &str = "https://github.com/microsoft/onnxruntime.git"; + +/// Minimum iOS version of the target platform/ +const IOS_MINIMAL_DEPLOY_TARGET: &str = "16.0"; /// Environment variable selecting which strategy to use for finding the library /// Possibilities: @@ -80,7 +85,6 @@ fn main() { .join(&*TRIPLET.arch.as_onnx_android_str()); (include_dir, runtimes_dir) } - Os::IOs => (libort_install_dir.join("Headers"), libort_install_dir), _ => ( libort_install_dir.join("include"), libort_install_dir.join("lib"), @@ -478,8 +482,7 @@ impl OnnxPrebuiltArchive for Triplet { self.os.as_onnx_str(), self.arch.as_onnx_str() )), - (Os::MacOs, Architecture::Arm64, Accelerator::None) - | (Os::IOs, Architecture::Arm64, Accelerator::None) => { + (Os::MacOs, Architecture::Arm64, Accelerator::None) => { Cow::from(format!("{}-{}", self.os.as_onnx_str(), "arm64")) } // onnxruntime-win-gpu-x64-1.8.1.zip @@ -530,12 +533,6 @@ fn prebuilt_archive_url() -> (PathBuf, String) { ORT_VERSION, TRIPLET.os.archive_extension() ), - Os::IOs => format!( - "{}/pod-archive-onnxruntime-c-{}.{}", - ORT_COCOAPODS_RELEASE_BASE_URL, - ORT_VERSION, - TRIPLET.os.archive_extension() - ), _ => format!( "{}/v{}/{}", ORT_RELEASE_BASE_URL, ORT_VERSION, prebuilt_archive @@ -588,7 +585,6 @@ fn prepare_libort_dir_prebuilt() -> PathBuf { #[cfg(not(feature = "directml"))] let extract_dir = match TRIPLET.os { Os::Android => extract_dir, - Os::IOs => extract_dir, _ => extract_dir.join(prebuilt_archive.file_stem().unwrap()), }; @@ -605,7 +601,7 @@ fn prepare_libort_dir() -> PathBuf { .unwrap_or_else(|_| "unknown") ); match strategy.as_ref().map(String::as_str) { - Ok("download") | Err(_) => prepare_libort_dir_prebuilt(), + Ok("download") => prepare_libort_dir_prebuilt(), Ok("system") => PathBuf::from(match env::var(ORT_ENV_SYSTEM_LIB_LOCATION) { Ok(p) => p, Err(e) => { @@ -615,7 +611,112 @@ fn prepare_libort_dir() -> PathBuf { ); } }), - Ok("compile") => unimplemented!(), + Ok("compile") | Err(_) => prepare_libort_dir_compiled(), _ => panic!("Unknown value for {:?}", ORT_ENV_STRATEGY), } } + +fn prepare_libort_dir_compiled() -> PathBuf { + // Compile is only support iOS currently. + + if !matches!(TRIPLET.os, Os::IOs) { + panic!("Compile strategy is only support iOS currently"); + } + + let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); + let onnxruntime_dir = out_dir.join("onnxruntime"); + let build_dir = onnxruntime_dir.join("build"); + + // Clone microsoft/onnxruntime + let repo = match Repository::clone(ORT_REPOSITORY_URL, &onnxruntime_dir) { + Ok(repo) => repo, + Err(e) => panic!("Failed to clone onnxruntime: {}", e), + }; + // checkout commit annotated by tag + let reference = format!("refs/tags/v{}", ORT_VERSION); + let reference = match repo.find_reference(&reference) { + Ok(reference) => reference, + Err(e) => panic!("Failed to find tag v{}: {}", ORT_VERSION, e), + }; + repo.set_head(reference.name().unwrap()).unwrap(); + repo.checkout_head(Some(&mut CheckoutBuilder::new().force())) + .unwrap(); + + let commit = match reference.peel_to_commit() { + Ok(commit) => commit, + Err(e) => panic!("Failed to peel HEAD: {}", e), + }; + let commit_id = commit.id(); + + // build onnxruntime + let build_script = onnxruntime_dir.join("build.sh"); + let ios_sysroot = if env::var("TARGET").unwrap().contains("sim") { + "iphonesimulator" + } else { + "iphoneos" + }; + let arch = if matches!(TRIPLET.arch, Architecture::Arm64) { + "arm64" + } else { + "x86_64" + }; + let status = Command::new(build_script) + .args([ + "--config", + "Release", + "--build_dir", + build_dir.to_str().unwrap(), + "--skip_tests", + "--build_shared_lib", + "--use_xcode", + "--ios", + "--ios_sysroot", + ios_sysroot, + "--osx_arch", + arch, + "--apple_deploy_target", + IOS_MINIMAL_DEPLOY_TARGET, + ]) + .status() + .expect("Failed to execute onnxruntime build process"); + if !status.success() { + panic!("Failed to build onnxruntime: {:?}", status.code()); + } + + // copy files + let copy_script = onnxruntime_dir + .join("tools") + .join("ci_build") + .join("github") + .join("linux") + .join("copy_strip_binary.sh"); + + let os = if env::var("TARGET").unwrap().contains("sim") { + "ios-sim" + } else { + "ios" + }; + let artifact_name = format!("onnxruntime-{}-{}", os, arch); + let status = Command::new(copy_script) + .args([ + "-r", + build_dir.to_str().unwrap(), + "-a", + &artifact_name, + "-l", + (format!("libonnxruntime.{}.dylib", ORT_VERSION).as_str()), + "-c", + (format!("Release/Release-{}", ios_sysroot).as_str()), + "-s", + onnxruntime_dir.to_str().unwrap(), + "-t", + &commit_id.to_string(), + ]) + .status() + .expect("Failed to execute copy process"); + if !status.success() { + panic!("Failed to copy onnxruntime: {:?}", status.code()); + } + + build_dir.join(artifact_name) +} From 0df261bf143dc880ba9efb1651c0486fdf92e54b Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Thu, 30 Mar 2023 04:00:21 +0900 Subject: [PATCH 04/21] change output dir --- onnxruntime-sys/build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 9fec3560..5652f46b 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -700,7 +700,7 @@ fn prepare_libort_dir_compiled() -> PathBuf { let status = Command::new(copy_script) .args([ "-r", - build_dir.to_str().unwrap(), + out_dir.to_str().unwrap(), "-a", &artifact_name, "-l", @@ -718,5 +718,5 @@ fn prepare_libort_dir_compiled() -> PathBuf { panic!("Failed to copy onnxruntime: {:?}", status.code()); } - build_dir.join(artifact_name) + out_dir.join(artifact_name) } From c7e13ee185dc1078137779a8f64de8a60bb7e948 Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Thu, 30 Mar 2023 15:50:57 +0900 Subject: [PATCH 05/21] fix iOS compile process change build directory change default strategy compile to download use compile strategy for iOS build on GitHub actions --- .github/actions/auto_gen_bind_pr/action.yaml | 3 +++ onnxruntime-sys/build.rs | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/actions/auto_gen_bind_pr/action.yaml b/.github/actions/auto_gen_bind_pr/action.yaml index 4ac7bfbd..ed0cc3e7 100644 --- a/.github/actions/auto_gen_bind_pr/action.yaml +++ b/.github/actions/auto_gen_bind_pr/action.yaml @@ -33,6 +33,9 @@ runs: - uses: actions-rs/toolchain@v1 with: toolchain: stable + - name: Set env for iOS build + if: inputs.triple == 'aarch64-apple-ios' || inputs.triple == 'aarch64-apple-ios-sim' + run: echo "ORT_STRATEGY=compile" >> "$GITHUB_ENV" - name: install triple run: rustup target add ${{ inputs.triple }} shell: bash diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 5652f46b..8f62d5ba 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -601,7 +601,7 @@ fn prepare_libort_dir() -> PathBuf { .unwrap_or_else(|_| "unknown") ); match strategy.as_ref().map(String::as_str) { - Ok("download") => prepare_libort_dir_prebuilt(), + Ok("download") | Err(_) => prepare_libort_dir_prebuilt(), Ok("system") => PathBuf::from(match env::var(ORT_ENV_SYSTEM_LIB_LOCATION) { Ok(p) => p, Err(e) => { @@ -611,7 +611,7 @@ fn prepare_libort_dir() -> PathBuf { ); } }), - Ok("compile") | Err(_) => prepare_libort_dir_compiled(), + Ok("compile") => prepare_libort_dir_compiled(), _ => panic!("Unknown value for {:?}", ORT_ENV_STRATEGY), } } @@ -700,7 +700,7 @@ fn prepare_libort_dir_compiled() -> PathBuf { let status = Command::new(copy_script) .args([ "-r", - out_dir.to_str().unwrap(), + build_dir.to_str().unwrap(), "-a", &artifact_name, "-l", @@ -718,5 +718,8 @@ fn prepare_libort_dir_compiled() -> PathBuf { panic!("Failed to copy onnxruntime: {:?}", status.code()); } + // move artifact directory + fs::rename(build_dir.join(&artifact_name), out_dir.join(&artifact_name)).unwrap(); + out_dir.join(artifact_name) } From 2d3f1b504f8c232f8b366d6e1959796dd305f9ec Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Thu, 30 Mar 2023 15:54:56 +0900 Subject: [PATCH 06/21] fix action shell --- .github/actions/auto_gen_bind_pr/action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/auto_gen_bind_pr/action.yaml b/.github/actions/auto_gen_bind_pr/action.yaml index ed0cc3e7..d1ab1dd7 100644 --- a/.github/actions/auto_gen_bind_pr/action.yaml +++ b/.github/actions/auto_gen_bind_pr/action.yaml @@ -35,6 +35,7 @@ runs: toolchain: stable - name: Set env for iOS build if: inputs.triple == 'aarch64-apple-ios' || inputs.triple == 'aarch64-apple-ios-sim' + shell: bash run: echo "ORT_STRATEGY=compile" >> "$GITHUB_ENV" - name: install triple run: rustup target add ${{ inputs.triple }} From 86691fc9cc8a3f0b700b28ffea30e9579e44bf37 Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Thu, 30 Mar 2023 16:04:27 +0900 Subject: [PATCH 07/21] fix compiling performance and unused github action --- .github/workflows/general.yml | 18 ------------------ onnxruntime-sys/build.rs | 1 + 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/general.yml b/.github/workflows/general.yml index 29da10f6..bd102793 100644 --- a/.github/workflows/general.yml +++ b/.github/workflows/general.yml @@ -39,8 +39,6 @@ jobs: - run: rustup target install i686-pc-windows-msvc - run: rustup target install x86_64-pc-windows-msvc - run: rustup target install aarch64-linux-android - - run: rustup target install aarch64-apple-ios - - run: rustup target install aarch64-apple-ios-sim # ****************************************************************** - name: Download prebuilt archive (CPU, x86_64-unknown-linux-gnu) uses: actions-rs/cargo@v1 @@ -66,22 +64,6 @@ jobs: - name: Verify prebuilt archive downloaded (CPU, x86_64-apple-darwin) run: ls -lh target/x86_64-apple-darwin/debug/build/onnxruntime-sys-*/out/onnxruntime-osx-x86_64-1.*.tgz # ****************************************************************** - - name: Download prebuilt archive (CPU, aarch64-apple-ios) - uses: actions-rs/cargo@v1 - with: - command: build - args: --target aarch64-apple-ios - - name: Verify prebuilt archive downloaded (CPU, aarch64-apple-ios) - run: ls -lh target/aarch64-apple-ios/debug/build/onnxruntime-sys-*/out/onnxruntime-ios-arm64-1.*.zip - # ****************************************************************** - - name: Download prebuilt archive (CPU, aarch64-apple-ios-sim) - uses: actions-rs/cargo@v1 - with: - command: build - args: --target aarch64-apple-ios-sim - - name: Verify prebuilt archive downloaded (CPU, aarch64-apple-ios-sim) - run: ls -lh target/aarch64-apple-ios-sim/debug/build/onnxruntime-sys-*/out/onnxruntime-ios-arm64-1.*.zip - # ****************************************************************** - name: Download prebuilt archive (CPU, i686-pc-windows-msvc) uses: actions-rs/cargo@v1 with: diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 8f62d5ba..3fa9f1b1 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -667,6 +667,7 @@ fn prepare_libort_dir_compiled() -> PathBuf { "--build_dir", build_dir.to_str().unwrap(), "--skip_tests", + "--parallel", "--build_shared_lib", "--use_xcode", "--ios", From 164d9a54ac92e59166d8296cde508a00e568d7fa Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Thu, 30 Mar 2023 23:57:57 +0900 Subject: [PATCH 08/21] fix output directory --- onnxruntime-sys/build.rs | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 3fa9f1b1..bae8d12c 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -626,7 +626,7 @@ fn prepare_libort_dir_compiled() -> PathBuf { let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); let onnxruntime_dir = out_dir.join("onnxruntime"); let build_dir = onnxruntime_dir.join("build"); - + let extract_dir = out_dir.join(format!("{}_{}_cpu", ORT_PREBUILT_EXTRACT_DIR, ORT_VERSION)); // Clone microsoft/onnxruntime let repo = match Repository::clone(ORT_REPOSITORY_URL, &onnxruntime_dir) { Ok(repo) => repo, @@ -642,12 +642,6 @@ fn prepare_libort_dir_compiled() -> PathBuf { repo.checkout_head(Some(&mut CheckoutBuilder::new().force())) .unwrap(); - let commit = match reference.peel_to_commit() { - Ok(commit) => commit, - Err(e) => panic!("Failed to peel HEAD: {}", e), - }; - let commit_id = commit.id(); - // build onnxruntime let build_script = onnxruntime_dir.join("build.sh"); let ios_sysroot = if env::var("TARGET").unwrap().contains("sim") { @@ -684,6 +678,13 @@ fn prepare_libort_dir_compiled() -> PathBuf { panic!("Failed to build onnxruntime: {:?}", status.code()); } + // get commit id for copy files + let commit = match reference.peel_to_commit() { + Ok(commit) => commit, + Err(e) => panic!("Failed to peel HEAD: {}", e), + }; + let commit_id = commit.id(); + // copy files let copy_script = onnxruntime_dir .join("tools") @@ -691,13 +692,13 @@ fn prepare_libort_dir_compiled() -> PathBuf { .join("github") .join("linux") .join("copy_strip_binary.sh"); - let os = if env::var("TARGET").unwrap().contains("sim") { "ios-sim" } else { "ios" }; let artifact_name = format!("onnxruntime-{}-{}", os, arch); + let status = Command::new(copy_script) .args([ "-r", @@ -720,7 +721,12 @@ fn prepare_libort_dir_compiled() -> PathBuf { } // move artifact directory - fs::rename(build_dir.join(&artifact_name), out_dir.join(&artifact_name)).unwrap(); - - out_dir.join(artifact_name) + fs::create_dir_all(&extract_dir).unwrap(); + fs::rename( + build_dir.join(&artifact_name), + extract_dir.join(&artifact_name), + ) + .unwrap(); + + extract_dir.join(artifact_name) } From 26619b8ab6f7eb8c22e0e341e3c34dd0e00d4a63 Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Sat, 1 Apr 2023 00:08:58 +0900 Subject: [PATCH 09/21] change iOS default strategy to download use cocoapods prebuild --- .github/actions/auto_gen_bind_pr/action.yaml | 4 - onnxruntime-sys/build.rs | 78 +++++++++++++++----- 2 files changed, 61 insertions(+), 21 deletions(-) diff --git a/.github/actions/auto_gen_bind_pr/action.yaml b/.github/actions/auto_gen_bind_pr/action.yaml index d1ab1dd7..4ac7bfbd 100644 --- a/.github/actions/auto_gen_bind_pr/action.yaml +++ b/.github/actions/auto_gen_bind_pr/action.yaml @@ -33,10 +33,6 @@ runs: - uses: actions-rs/toolchain@v1 with: toolchain: stable - - name: Set env for iOS build - if: inputs.triple == 'aarch64-apple-ios' || inputs.triple == 'aarch64-apple-ios-sim' - shell: bash - run: echo "ORT_STRATEGY=compile" >> "$GITHUB_ENV" - name: install triple run: rustup target add ${{ inputs.triple }} shell: bash diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index bae8d12c..e2de0353 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -24,6 +24,9 @@ const ORT_RELEASE_BASE_URL: &str = "https://github.com/microsoft/onnxruntime/rel const ORT_MAVEN_RELEASE_BASE_URL: &str = "https://repo1.maven.org/maven2/com/microsoft/onnxruntime/onnxruntime-android"; +/// Base Url from which to download pre-build releases for ios/ +const ORT_COCOAPODS_RELEASE_BASE_URL: &str = "https://onnxruntimepackages.z14.web.core.windows.net"; + /// onnxruntime repository/ const ORT_REPOSITORY_URL: &str = "https://github.com/microsoft/onnxruntime.git"; @@ -85,6 +88,10 @@ fn main() { .join(&*TRIPLET.arch.as_onnx_android_str()); (include_dir, runtimes_dir) } + Os::IOs => ( + libort_install_dir.join("Headers"), + libort_install_dir.join("onnxruntime"), + ), _ => ( libort_install_dir.join("include"), libort_install_dir.join("lib"), @@ -115,14 +122,22 @@ fn main() { }; if let Ok(ort_lib_out_dir) = env::var(ORT_ENV_OUT_DIR) { output_onnxruntime_library(&lib_dir, &ort_lib_out_dir); - for entry in lib_dir.read_dir().unwrap().flat_map(|e| e.ok()) { - let path = entry.path(); - if path.is_file() { - let file_name = path.file_name().unwrap().to_str().unwrap(); - println!( - "cargo:rerun-if-changed={}", - Path::new(&ort_lib_out_dir).join(file_name).display() - ); + if matches!(TRIPLET.os, Os::IOs) { + let file_name = lib_dir.file_name().unwrap().to_str().unwrap(); + println!( + "cargo:rerun-if-changed={}", + Path::new(&ort_lib_out_dir).join(file_name).display() + ); + } else { + for entry in lib_dir.read_dir().unwrap().flat_map(|e| e.ok()) { + let path = entry.path(); + if path.is_file() { + let file_name = path.file_name().unwrap().to_str().unwrap(); + println!( + "cargo:rerun-if-changed={}", + Path::new(&ort_lib_out_dir).join(file_name).display() + ); + } } } } @@ -147,14 +162,24 @@ fn output_onnxruntime_library(ort_lib_dir: impl AsRef, ort_lib_out_dir: im let ort_lib_out_dir = ort_lib_out_dir.as_ref(); fs::create_dir_all(ort_lib_out_dir).unwrap(); - for entry in ort_lib_dir.read_dir().unwrap().filter_map(|e| e.ok()) { - let path = entry.path(); - if path.is_file() { - fs::copy( - &path, - ort_lib_out_dir.join(path.file_name().unwrap().to_str().unwrap()), - ) - .unwrap(); + if matches!(TRIPLET.os, Os::IOs) { + let hoge = ort_lib_out_dir.join(ort_lib_dir.file_name().unwrap().to_str().unwrap()); + print!("{}", hoge.display()); + fs::copy( + ort_lib_dir, + ort_lib_out_dir.join(ort_lib_dir.file_name().unwrap().to_str().unwrap()), + ) + .unwrap(); + } else { + for entry in ort_lib_dir.read_dir().unwrap().filter_map(|e| e.ok()) { + let path = entry.path(); + if path.is_file() { + fs::copy( + &path, + ort_lib_out_dir.join(path.file_name().unwrap().to_str().unwrap()), + ) + .unwrap(); + } } } } @@ -482,7 +507,8 @@ impl OnnxPrebuiltArchive for Triplet { self.os.as_onnx_str(), self.arch.as_onnx_str() )), - (Os::MacOs, Architecture::Arm64, Accelerator::None) => { + (Os::MacOs, Architecture::Arm64, Accelerator::None) + | (Os::IOs, Architecture::Arm64, Accelerator::None) => { Cow::from(format!("{}-{}", self.os.as_onnx_str(), "arm64")) } // onnxruntime-win-gpu-x64-1.8.1.zip @@ -533,6 +559,12 @@ fn prebuilt_archive_url() -> (PathBuf, String) { ORT_VERSION, TRIPLET.os.archive_extension() ), + Os::IOs => format!( + "{}/pod-archive-onnxruntime-c-{}.{}", + ORT_COCOAPODS_RELEASE_BASE_URL, + ORT_VERSION, + TRIPLET.os.archive_extension() + ), _ => format!( "{}/v{}/{}", ORT_RELEASE_BASE_URL, ORT_VERSION, prebuilt_archive @@ -585,9 +617,21 @@ fn prepare_libort_dir_prebuilt() -> PathBuf { #[cfg(not(feature = "directml"))] let extract_dir = match TRIPLET.os { Os::Android => extract_dir, + Os::IOs => extract_dir.join("onnxruntime.xcframework"), _ => extract_dir.join(prebuilt_archive.file_stem().unwrap()), }; + let extract_dir = if matches!(TRIPLET.os, Os::IOs) { + match TRIPLET.arch { + Architecture::Arm64 => extract_dir.join("ios-arm64"), + Architecture::X86_64 => extract_dir.join("ios-arm64_x86_64-simulator"), + _ => extract_dir, + } + .join("onnxruntime.framework") + } else { + extract_dir + }; + extract_dir } From 772df58cc4a0cf8ed4a6c8a426203f7607b973ea Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Sat, 1 Apr 2023 00:24:14 +0900 Subject: [PATCH 10/21] fix iOS device target --- onnxruntime-sys/build.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index e2de0353..87b42a9c 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -621,18 +621,18 @@ fn prepare_libort_dir_prebuilt() -> PathBuf { _ => extract_dir.join(prebuilt_archive.file_stem().unwrap()), }; - let extract_dir = if matches!(TRIPLET.os, Os::IOs) { - match TRIPLET.arch { - Architecture::Arm64 => extract_dir.join("ios-arm64"), - Architecture::X86_64 => extract_dir.join("ios-arm64_x86_64-simulator"), - _ => extract_dir, + // if env::var("TARGET").unwrap().contains("sim") + + if matches!(TRIPLET.os, Os::IOs) { + if env::var("TARGET").unwrap().contains("sim") { + extract_dir.join("ios-arm64_x86_64-simulator") + } else { + extract_dir.join("ios-arm64") } .join("onnxruntime.framework") } else { extract_dir - }; - - extract_dir + } } fn prepare_libort_dir() -> PathBuf { From 2935b14d7aabea047e59cd2704baed7522136a9c Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Mon, 3 Apr 2023 01:50:24 +0900 Subject: [PATCH 11/21] add x86_64-apple-ios target and remove static lib --- .github/actions/auto_gen_bind_pr/action.yaml | 4 ++++ .github/workflows/gen_bind.yaml | 2 ++ onnxruntime-sys/build.rs | 11 ----------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/actions/auto_gen_bind_pr/action.yaml b/.github/actions/auto_gen_bind_pr/action.yaml index 4ac7bfbd..0a5e5890 100644 --- a/.github/actions/auto_gen_bind_pr/action.yaml +++ b/.github/actions/auto_gen_bind_pr/action.yaml @@ -33,6 +33,10 @@ runs: - uses: actions-rs/toolchain@v1 with: toolchain: stable + - name: Set env for iOS build + if: inputs.triple == 'aarch64-apple-ios' || inputs.triple == 'aarch64-apple-ios-sim' || inputs.triple == 'x86_64-apple-ios' + shell: bash + run: echo "ORT_STRATEGY=compile" >> "$GITHUB_ENV" - name: install triple run: rustup target add ${{ inputs.triple }} shell: bash diff --git a/.github/workflows/gen_bind.yaml b/.github/workflows/gen_bind.yaml index 8c123dff..d9a4a9db 100644 --- a/.github/workflows/gen_bind.yaml +++ b/.github/workflows/gen_bind.yaml @@ -32,6 +32,8 @@ jobs: triple: aarch64-apple-ios - os: macos-latest triple: aarch64-apple-ios-sim + - os: macos-latest + triple: x86_64-apple-ios runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 87b42a9c..650bd445 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -24,9 +24,6 @@ const ORT_RELEASE_BASE_URL: &str = "https://github.com/microsoft/onnxruntime/rel const ORT_MAVEN_RELEASE_BASE_URL: &str = "https://repo1.maven.org/maven2/com/microsoft/onnxruntime/onnxruntime-android"; -/// Base Url from which to download pre-build releases for ios/ -const ORT_COCOAPODS_RELEASE_BASE_URL: &str = "https://onnxruntimepackages.z14.web.core.windows.net"; - /// onnxruntime repository/ const ORT_REPOSITORY_URL: &str = "https://github.com/microsoft/onnxruntime.git"; @@ -559,12 +556,6 @@ fn prebuilt_archive_url() -> (PathBuf, String) { ORT_VERSION, TRIPLET.os.archive_extension() ), - Os::IOs => format!( - "{}/pod-archive-onnxruntime-c-{}.{}", - ORT_COCOAPODS_RELEASE_BASE_URL, - ORT_VERSION, - TRIPLET.os.archive_extension() - ), _ => format!( "{}/v{}/{}", ORT_RELEASE_BASE_URL, ORT_VERSION, prebuilt_archive @@ -621,8 +612,6 @@ fn prepare_libort_dir_prebuilt() -> PathBuf { _ => extract_dir.join(prebuilt_archive.file_stem().unwrap()), }; - // if env::var("TARGET").unwrap().contains("sim") - if matches!(TRIPLET.os, Os::IOs) { if env::var("TARGET").unwrap().contains("sim") { extract_dir.join("ios-arm64_x86_64-simulator") From c30c6f69b8106a4b0988e23b550e39311c0fe4a9 Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Mon, 3 Apr 2023 23:23:38 +0900 Subject: [PATCH 12/21] remove download strategy for iOS and fix x86_64-apple-ios target build add x86_64-apple-ios target bindings --- onnxruntime-sys/build.rs | 81 +- .../src/generated/ios/x86_64/bindings.rs | 6982 +++++++++++++++++ 2 files changed, 7005 insertions(+), 58 deletions(-) create mode 100644 onnxruntime-sys/src/generated/ios/x86_64/bindings.rs diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 650bd445..33efb6a0 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -85,10 +85,6 @@ fn main() { .join(&*TRIPLET.arch.as_onnx_android_str()); (include_dir, runtimes_dir) } - Os::IOs => ( - libort_install_dir.join("Headers"), - libort_install_dir.join("onnxruntime"), - ), _ => ( libort_install_dir.join("include"), libort_install_dir.join("lib"), @@ -119,22 +115,14 @@ fn main() { }; if let Ok(ort_lib_out_dir) = env::var(ORT_ENV_OUT_DIR) { output_onnxruntime_library(&lib_dir, &ort_lib_out_dir); - if matches!(TRIPLET.os, Os::IOs) { - let file_name = lib_dir.file_name().unwrap().to_str().unwrap(); - println!( - "cargo:rerun-if-changed={}", - Path::new(&ort_lib_out_dir).join(file_name).display() - ); - } else { - for entry in lib_dir.read_dir().unwrap().flat_map(|e| e.ok()) { - let path = entry.path(); - if path.is_file() { - let file_name = path.file_name().unwrap().to_str().unwrap(); - println!( - "cargo:rerun-if-changed={}", - Path::new(&ort_lib_out_dir).join(file_name).display() - ); - } + for entry in lib_dir.read_dir().unwrap().flat_map(|e| e.ok()) { + let path = entry.path(); + if path.is_file() { + let file_name = path.file_name().unwrap().to_str().unwrap(); + println!( + "cargo:rerun-if-changed={}", + Path::new(&ort_lib_out_dir).join(file_name).display() + ); } } } @@ -159,24 +147,14 @@ fn output_onnxruntime_library(ort_lib_dir: impl AsRef, ort_lib_out_dir: im let ort_lib_out_dir = ort_lib_out_dir.as_ref(); fs::create_dir_all(ort_lib_out_dir).unwrap(); - if matches!(TRIPLET.os, Os::IOs) { - let hoge = ort_lib_out_dir.join(ort_lib_dir.file_name().unwrap().to_str().unwrap()); - print!("{}", hoge.display()); - fs::copy( - ort_lib_dir, - ort_lib_out_dir.join(ort_lib_dir.file_name().unwrap().to_str().unwrap()), - ) - .unwrap(); - } else { - for entry in ort_lib_dir.read_dir().unwrap().filter_map(|e| e.ok()) { - let path = entry.path(); - if path.is_file() { - fs::copy( - &path, - ort_lib_out_dir.join(path.file_name().unwrap().to_str().unwrap()), - ) - .unwrap(); - } + for entry in ort_lib_dir.read_dir().unwrap().filter_map(|e| e.ok()) { + let path = entry.path(); + if path.is_file() { + fs::copy( + &path, + ort_lib_out_dir.join(path.file_name().unwrap().to_str().unwrap()), + ) + .unwrap(); } } } @@ -504,8 +482,7 @@ impl OnnxPrebuiltArchive for Triplet { self.os.as_onnx_str(), self.arch.as_onnx_str() )), - (Os::MacOs, Architecture::Arm64, Accelerator::None) - | (Os::IOs, Architecture::Arm64, Accelerator::None) => { + (Os::MacOs, Architecture::Arm64, Accelerator::None) => { Cow::from(format!("{}-{}", self.os.as_onnx_str(), "arm64")) } // onnxruntime-win-gpu-x64-1.8.1.zip @@ -608,20 +585,10 @@ fn prepare_libort_dir_prebuilt() -> PathBuf { #[cfg(not(feature = "directml"))] let extract_dir = match TRIPLET.os { Os::Android => extract_dir, - Os::IOs => extract_dir.join("onnxruntime.xcframework"), _ => extract_dir.join(prebuilt_archive.file_stem().unwrap()), }; - if matches!(TRIPLET.os, Os::IOs) { - if env::var("TARGET").unwrap().contains("sim") { - extract_dir.join("ios-arm64_x86_64-simulator") - } else { - extract_dir.join("ios-arm64") - } - .join("onnxruntime.framework") - } else { - extract_dir - } + extract_dir } fn prepare_libort_dir() -> PathBuf { @@ -656,6 +623,8 @@ fn prepare_libort_dir_compiled() -> PathBuf { panic!("Compile strategy is only support iOS currently"); } + let is_simulator = env::var("TARGET").unwrap().ends_with("sim") + || env::var("TARGET").unwrap().starts_with("x86_64"); let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); let onnxruntime_dir = out_dir.join("onnxruntime"); let build_dir = onnxruntime_dir.join("build"); @@ -677,7 +646,7 @@ fn prepare_libort_dir_compiled() -> PathBuf { // build onnxruntime let build_script = onnxruntime_dir.join("build.sh"); - let ios_sysroot = if env::var("TARGET").unwrap().contains("sim") { + let ios_sysroot = if is_simulator { "iphonesimulator" } else { "iphoneos" @@ -725,11 +694,7 @@ fn prepare_libort_dir_compiled() -> PathBuf { .join("github") .join("linux") .join("copy_strip_binary.sh"); - let os = if env::var("TARGET").unwrap().contains("sim") { - "ios-sim" - } else { - "ios" - }; + let os = if is_simulator { "ios-sim" } else { "ios" }; let artifact_name = format!("onnxruntime-{}-{}", os, arch); let status = Command::new(copy_script) @@ -750,7 +715,7 @@ fn prepare_libort_dir_compiled() -> PathBuf { .status() .expect("Failed to execute copy process"); if !status.success() { - panic!("Failed to copy onnxruntime: {:?}", status.code()); + panic!("Failed to copy onnxruntime: {:?}", status.code().unwrap()); } // move artifact directory diff --git a/onnxruntime-sys/src/generated/ios/x86_64/bindings.rs b/onnxruntime-sys/src/generated/ios/x86_64/bindings.rs new file mode 100644 index 00000000..2eb0feb4 --- /dev/null +++ b/onnxruntime-sys/src/generated/ios/x86_64/bindings.rs @@ -0,0 +1,6982 @@ +/* automatically generated by rust-bindgen 0.60.1 */ + +pub const ORT_API_VERSION: u32 = 13; +pub type __darwin_size_t = ::std::os::raw::c_ulong; +#[repr(u32)] +#[doc = " Copied from TensorProto::DataType"] +#[doc = " Currently, Ort doesn't support complex64, complex128"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum ONNXTensorElementDataType { + ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED = 0, + ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT = 1, + ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8 = 2, + ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8 = 3, + ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16 = 4, + ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16 = 5, + ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32 = 6, + ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64 = 7, + ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING = 8, + ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL = 9, + ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16 = 10, + ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE = 11, + ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32 = 12, + ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64 = 13, + ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64 = 14, + ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128 = 15, + ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16 = 16, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum ONNXType { + ONNX_TYPE_UNKNOWN = 0, + ONNX_TYPE_TENSOR = 1, + ONNX_TYPE_SEQUENCE = 2, + ONNX_TYPE_MAP = 3, + ONNX_TYPE_OPAQUE = 4, + ONNX_TYPE_SPARSETENSOR = 5, + ONNX_TYPE_OPTIONAL = 6, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtSparseFormat { + ORT_SPARSE_UNDEFINED = 0, + ORT_SPARSE_COO = 1, + ORT_SPARSE_CSRC = 2, + ORT_SPARSE_BLOCK_SPARSE = 4, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtSparseIndicesFormat { + ORT_SPARSE_COO_INDICES = 0, + ORT_SPARSE_CSR_INNER_INDICES = 1, + ORT_SPARSE_CSR_OUTER_INDICES = 2, + ORT_SPARSE_BLOCK_SPARSE_INDICES = 3, +} +#[repr(u32)] +#[doc = " \\brief Logging severity levels"] +#[doc = ""] +#[doc = " In typical API usage, specifying a logging severity level specifies the minimum severity of log messages to show."] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtLoggingLevel { + #[doc = "< Verbose informational messages (least severe)."] + ORT_LOGGING_LEVEL_VERBOSE = 0, + #[doc = "< Informational messages."] + ORT_LOGGING_LEVEL_INFO = 1, + #[doc = "< Warning messages."] + ORT_LOGGING_LEVEL_WARNING = 2, + #[doc = "< Error messages."] + ORT_LOGGING_LEVEL_ERROR = 3, + #[doc = "< Fatal error messages (most severe)."] + ORT_LOGGING_LEVEL_FATAL = 4, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtErrorCode { + ORT_OK = 0, + ORT_FAIL = 1, + ORT_INVALID_ARGUMENT = 2, + ORT_NO_SUCHFILE = 3, + ORT_NO_MODEL = 4, + ORT_ENGINE_ERROR = 5, + ORT_RUNTIME_EXCEPTION = 6, + ORT_INVALID_PROTOBUF = 7, + ORT_MODEL_LOADED = 8, + ORT_NOT_IMPLEMENTED = 9, + ORT_INVALID_GRAPH = 10, + ORT_EP_FAIL = 11, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtOpAttrType { + ORT_OP_ATTR_UNDEFINED = 0, + ORT_OP_ATTR_INT = 1, + ORT_OP_ATTR_INTS = 2, + ORT_OP_ATTR_FLOAT = 3, + ORT_OP_ATTR_FLOATS = 4, + ORT_OP_ATTR_STRING = 5, + ORT_OP_ATTR_STRINGS = 6, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtEnv { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtStatus { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtMemoryInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtIoBinding { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtSession { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtValue { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtRunOptions { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtTypeInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtTensorTypeAndShapeInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtSessionOptions { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCustomOpDomain { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtMapTypeInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtSequenceTypeInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtModelMetadata { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtThreadPoolParams { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtThreadingOptions { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtArenaCfg { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtPrepackedWeightsContainer { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtTensorRTProviderOptionsV2 { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCUDAProviderOptionsV2 { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCANNProviderOptions { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtOp { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtOpAttr { + _unused: [u8; 0], +} +pub type OrtStatusPtr = *mut OrtStatus; +#[doc = " \\brief Memory allocation interface"] +#[doc = ""] +#[doc = " Structure of function pointers that defines a memory allocator. This can be created and filled in by the user for custom allocators."] +#[doc = ""] +#[doc = " When an allocator is passed to any function, be sure that the allocator object is not destroyed until the last allocated object using it is freed."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtAllocator { + #[doc = "< Must be initialized to ORT_API_VERSION"] + pub version: u32, + #[doc = "< Returns a pointer to an allocated block of `size` bytes"] + pub Alloc: ::std::option::Option< + unsafe extern "C" fn(this_: *mut OrtAllocator, size: usize) -> *mut ::std::os::raw::c_void, + >, + #[doc = "< Free a block of memory previously allocated with OrtAllocator::Alloc"] + pub Free: ::std::option::Option< + unsafe extern "C" fn(this_: *mut OrtAllocator, p: *mut ::std::os::raw::c_void), + >, + #[doc = "< Return a pointer to an ::OrtMemoryInfo that describes this allocator"] + pub Info: ::std::option::Option< + unsafe extern "C" fn(this_: *const OrtAllocator) -> *const OrtMemoryInfo, + >, +} +#[test] +fn bindgen_test_layout_OrtAllocator() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(OrtAllocator)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtAllocator)) + ); + fn test_field_version() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtAllocator), + "::", + stringify!(version) + ) + ); + } + test_field_version(); + fn test_field_Alloc() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).Alloc) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtAllocator), + "::", + stringify!(Alloc) + ) + ); + } + test_field_Alloc(); + fn test_field_Free() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).Free) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtAllocator), + "::", + stringify!(Free) + ) + ); + } + test_field_Free(); + fn test_field_Info() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).Info) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtAllocator), + "::", + stringify!(Info) + ) + ); + } + test_field_Info(); +} +pub type OrtLoggingFunction = ::std::option::Option< + unsafe extern "C" fn( + param: *mut ::std::os::raw::c_void, + severity: OrtLoggingLevel, + category: *const ::std::os::raw::c_char, + logid: *const ::std::os::raw::c_char, + code_location: *const ::std::os::raw::c_char, + message: *const ::std::os::raw::c_char, + ), +>; +#[repr(u32)] +#[doc = " \\brief Graph optimization level"] +#[doc = ""] +#[doc = " Refer to https://www.onnxruntime.ai/docs/resources/graph-optimizations.html"] +#[doc = " for an in-depth understanding of Graph Optimizations"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum GraphOptimizationLevel { + ORT_DISABLE_ALL = 0, + ORT_ENABLE_BASIC = 1, + ORT_ENABLE_EXTENDED = 2, + ORT_ENABLE_ALL = 99, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum ExecutionMode { + ORT_SEQUENTIAL = 0, + ORT_PARALLEL = 1, +} +#[repr(u32)] +#[doc = " \\brief Language projection identifiers"] +#[doc = " /see OrtApi::SetLanguageProjection"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtLanguageProjection { + ORT_PROJECTION_C = 0, + ORT_PROJECTION_CPLUSPLUS = 1, + ORT_PROJECTION_CSHARP = 2, + ORT_PROJECTION_PYTHON = 3, + ORT_PROJECTION_JAVA = 4, + ORT_PROJECTION_WINML = 5, + ORT_PROJECTION_NODEJS = 6, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtKernelInfo { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtKernelContext { + _unused: [u8; 0], +} +#[repr(i32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtAllocatorType { + OrtInvalidAllocator = -1, + OrtDeviceAllocator = 0, + OrtArenaAllocator = 1, +} +impl OrtMemType { + pub const OrtMemTypeCPU: OrtMemType = OrtMemType::OrtMemTypeCPUOutput; +} +#[repr(i32)] +#[doc = " \\brief Memory types for allocated memory, execution provider specific types should be extended in each provider."] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtMemType { + #[doc = "< Any CPU memory used by non-CPU execution provider"] + OrtMemTypeCPUInput = -2, + #[doc = "< CPU accessible memory outputted by non-CPU execution provider, i.e. CUDA_PINNED"] + OrtMemTypeCPUOutput = -1, + #[doc = "< The default allocator for execution provider"] + OrtMemTypeDefault = 0, +} +#[repr(u32)] +#[doc = " \\brief Algorithm to use for cuDNN Convolution Op"] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtCudnnConvAlgoSearch { + OrtCudnnConvAlgoSearchExhaustive = 0, + OrtCudnnConvAlgoSearchHeuristic = 1, + OrtCudnnConvAlgoSearchDefault = 2, +} +#[doc = " \\brief CUDA Provider Options"] +#[doc = ""] +#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_CUDA"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCUDAProviderOptions { + #[doc = " \\brief CUDA device Id"] + #[doc = " Defaults to 0."] + pub device_id: ::std::os::raw::c_int, + #[doc = " \\brief CUDA Convolution algorithm search configuration."] + #[doc = " See enum OrtCudnnConvAlgoSearch for more details."] + #[doc = " Defaults to OrtCudnnConvAlgoSearchExhaustive."] + pub cudnn_conv_algo_search: OrtCudnnConvAlgoSearch, + #[doc = " \\brief CUDA memory limit (To use all possible memory pass in maximum size_t)"] + #[doc = " Defaults to SIZE_MAX."] + #[doc = " \\note If a ::OrtArenaCfg has been applied, it will override this field"] + pub gpu_mem_limit: usize, + #[doc = " \\brief Strategy used to grow the memory arena"] + #[doc = " 0 = kNextPowerOfTwo
"] + #[doc = " 1 = kSameAsRequested
"] + #[doc = " Defaults to 0."] + #[doc = " \\note If a ::OrtArenaCfg has been applied, it will override this field"] + pub arena_extend_strategy: ::std::os::raw::c_int, + #[doc = " \\brief Flag indicating if copying needs to take place on the same stream as the compute stream in the CUDA EP"] + #[doc = " 0 = Use separate streams for copying and compute."] + #[doc = " 1 = Use the same stream for copying and compute."] + #[doc = " Defaults to 1."] + #[doc = " WARNING: Setting this to 0 may result in data races for some models."] + #[doc = " Please see issue #4829 for more details."] + pub do_copy_in_default_stream: ::std::os::raw::c_int, + #[doc = " \\brief Flag indicating if there is a user provided compute stream"] + #[doc = " Defaults to 0."] + pub has_user_compute_stream: ::std::os::raw::c_int, + #[doc = " \\brief User provided compute stream."] + #[doc = " If provided, please set `has_user_compute_stream` to 1."] + pub user_compute_stream: *mut ::std::os::raw::c_void, + #[doc = " \\brief CUDA memory arena configuration parameters"] + pub default_memory_arena_cfg: *mut OrtArenaCfg, +} +#[test] +fn bindgen_test_layout_OrtCUDAProviderOptions() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtCUDAProviderOptions)) + ); + fn test_field_device_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_id) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(device_id) + ) + ); + } + test_field_device_id(); + fn test_field_cudnn_conv_algo_search() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).cudnn_conv_algo_search) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(cudnn_conv_algo_search) + ) + ); + } + test_field_cudnn_conv_algo_search(); + fn test_field_gpu_mem_limit() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).gpu_mem_limit) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(gpu_mem_limit) + ) + ); + } + test_field_gpu_mem_limit(); + fn test_field_arena_extend_strategy() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).arena_extend_strategy) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(arena_extend_strategy) + ) + ); + } + test_field_arena_extend_strategy(); + fn test_field_do_copy_in_default_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).do_copy_in_default_stream) as usize - ptr as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(do_copy_in_default_stream) + ) + ); + } + test_field_do_copy_in_default_stream(); + fn test_field_has_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).has_user_compute_stream) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(has_user_compute_stream) + ) + ); + } + test_field_has_user_compute_stream(); + fn test_field_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).user_compute_stream) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(user_compute_stream) + ) + ); + } + test_field_user_compute_stream(); + fn test_field_default_memory_arena_cfg() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).default_memory_arena_cfg) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(default_memory_arena_cfg) + ) + ); + } + test_field_default_memory_arena_cfg(); +} +#[doc = " \\brief ROCM Provider Options"] +#[doc = ""] +#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_ROCM"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtROCMProviderOptions { + #[doc = " \\brief ROCM device Id"] + #[doc = " Defaults to 0."] + pub device_id: ::std::os::raw::c_int, + #[doc = " \\brief ROCM MIOpen Convolution algorithm exaustive search option."] + #[doc = " Defaults to 0 (false)."] + pub miopen_conv_exhaustive_search: ::std::os::raw::c_int, + #[doc = " \\brief ROCM memory limit (To use all possible memory pass in maximum size_t)"] + #[doc = " Defaults to SIZE_MAX."] + #[doc = " \\note If a ::OrtArenaCfg has been applied, it will override this field"] + pub gpu_mem_limit: usize, + #[doc = " \\brief Strategy used to grow the memory arena"] + #[doc = " 0 = kNextPowerOfTwo
"] + #[doc = " 1 = kSameAsRequested
"] + #[doc = " Defaults to 0."] + #[doc = " \\note If a ::OrtArenaCfg has been applied, it will override this field"] + pub arena_extend_strategy: ::std::os::raw::c_int, + #[doc = " \\brief Flag indicating if copying needs to take place on the same stream as the compute stream in the ROCM EP"] + #[doc = " 0 = Use separate streams for copying and compute."] + #[doc = " 1 = Use the same stream for copying and compute."] + #[doc = " Defaults to 1."] + #[doc = " WARNING: Setting this to 0 may result in data races for some models."] + #[doc = " Please see issue #4829 for more details."] + pub do_copy_in_default_stream: ::std::os::raw::c_int, + #[doc = " \\brief Flag indicating if there is a user provided compute stream"] + #[doc = " Defaults to 0."] + pub has_user_compute_stream: ::std::os::raw::c_int, + #[doc = " \\brief User provided compute stream."] + #[doc = " If provided, please set `has_user_compute_stream` to 1."] + pub user_compute_stream: *mut ::std::os::raw::c_void, + #[doc = " \\brief ROCM memory arena configuration parameters"] + pub default_memory_arena_cfg: *mut OrtArenaCfg, +} +#[test] +fn bindgen_test_layout_OrtROCMProviderOptions() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(OrtROCMProviderOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtROCMProviderOptions)) + ); + fn test_field_device_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_id) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(device_id) + ) + ); + } + test_field_device_id(); + fn test_field_miopen_conv_exhaustive_search() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).miopen_conv_exhaustive_search) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(miopen_conv_exhaustive_search) + ) + ); + } + test_field_miopen_conv_exhaustive_search(); + fn test_field_gpu_mem_limit() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).gpu_mem_limit) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(gpu_mem_limit) + ) + ); + } + test_field_gpu_mem_limit(); + fn test_field_arena_extend_strategy() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).arena_extend_strategy) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(arena_extend_strategy) + ) + ); + } + test_field_arena_extend_strategy(); + fn test_field_do_copy_in_default_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).do_copy_in_default_stream) as usize - ptr as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(do_copy_in_default_stream) + ) + ); + } + test_field_do_copy_in_default_stream(); + fn test_field_has_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).has_user_compute_stream) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(has_user_compute_stream) + ) + ); + } + test_field_has_user_compute_stream(); + fn test_field_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).user_compute_stream) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(user_compute_stream) + ) + ); + } + test_field_user_compute_stream(); + fn test_field_default_memory_arena_cfg() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).default_memory_arena_cfg) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(default_memory_arena_cfg) + ) + ); + } + test_field_default_memory_arena_cfg(); +} +#[doc = " \\brief TensorRT Provider Options"] +#[doc = ""] +#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_TensorRT"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtTensorRTProviderOptions { + #[doc = "< CUDA device id (0 = default device)"] + pub device_id: ::std::os::raw::c_int, + pub has_user_compute_stream: ::std::os::raw::c_int, + pub user_compute_stream: *mut ::std::os::raw::c_void, + pub trt_max_partition_iterations: ::std::os::raw::c_int, + pub trt_min_subgraph_size: ::std::os::raw::c_int, + pub trt_max_workspace_size: usize, + pub trt_fp16_enable: ::std::os::raw::c_int, + pub trt_int8_enable: ::std::os::raw::c_int, + pub trt_int8_calibration_table_name: *const ::std::os::raw::c_char, + pub trt_int8_use_native_calibration_table: ::std::os::raw::c_int, + pub trt_dla_enable: ::std::os::raw::c_int, + pub trt_dla_core: ::std::os::raw::c_int, + pub trt_dump_subgraphs: ::std::os::raw::c_int, + pub trt_engine_cache_enable: ::std::os::raw::c_int, + pub trt_engine_cache_path: *const ::std::os::raw::c_char, + pub trt_engine_decryption_enable: ::std::os::raw::c_int, + pub trt_engine_decryption_lib_path: *const ::std::os::raw::c_char, + pub trt_force_sequential_engine_build: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_OrtTensorRTProviderOptions() { + assert_eq!( + ::std::mem::size_of::(), + 104usize, + concat!("Size of: ", stringify!(OrtTensorRTProviderOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtTensorRTProviderOptions)) + ); + fn test_field_device_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_id) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(device_id) + ) + ); + } + test_field_device_id(); + fn test_field_has_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).has_user_compute_stream) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(has_user_compute_stream) + ) + ); + } + test_field_has_user_compute_stream(); + fn test_field_user_compute_stream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).user_compute_stream) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(user_compute_stream) + ) + ); + } + test_field_user_compute_stream(); + fn test_field_trt_max_partition_iterations() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_max_partition_iterations) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_max_partition_iterations) + ) + ); + } + test_field_trt_max_partition_iterations(); + fn test_field_trt_min_subgraph_size() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_min_subgraph_size) as usize - ptr as usize + }, + 20usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_min_subgraph_size) + ) + ); + } + test_field_trt_min_subgraph_size(); + fn test_field_trt_max_workspace_size() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_max_workspace_size) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_max_workspace_size) + ) + ); + } + test_field_trt_max_workspace_size(); + fn test_field_trt_fp16_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_fp16_enable) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_fp16_enable) + ) + ); + } + test_field_trt_fp16_enable(); + fn test_field_trt_int8_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_int8_enable) as usize - ptr as usize + }, + 36usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_int8_enable) + ) + ); + } + test_field_trt_int8_enable(); + fn test_field_trt_int8_calibration_table_name() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_int8_calibration_table_name) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_int8_calibration_table_name) + ) + ); + } + test_field_trt_int8_calibration_table_name(); + fn test_field_trt_int8_use_native_calibration_table() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_int8_use_native_calibration_table) as usize + - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_int8_use_native_calibration_table) + ) + ); + } + test_field_trt_int8_use_native_calibration_table(); + fn test_field_trt_dla_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_dla_enable) as usize - ptr as usize + }, + 52usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_dla_enable) + ) + ); + } + test_field_trt_dla_enable(); + fn test_field_trt_dla_core() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_dla_core) as usize - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_dla_core) + ) + ); + } + test_field_trt_dla_core(); + fn test_field_trt_dump_subgraphs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_dump_subgraphs) as usize - ptr as usize + }, + 60usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_dump_subgraphs) + ) + ); + } + test_field_trt_dump_subgraphs(); + fn test_field_trt_engine_cache_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_engine_cache_enable) as usize - ptr as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_engine_cache_enable) + ) + ); + } + test_field_trt_engine_cache_enable(); + fn test_field_trt_engine_cache_path() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_engine_cache_path) as usize - ptr as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_engine_cache_path) + ) + ); + } + test_field_trt_engine_cache_path(); + fn test_field_trt_engine_decryption_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_engine_decryption_enable) as usize - ptr as usize + }, + 80usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_engine_decryption_enable) + ) + ); + } + test_field_trt_engine_decryption_enable(); + fn test_field_trt_engine_decryption_lib_path() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_engine_decryption_lib_path) as usize - ptr as usize + }, + 88usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_engine_decryption_lib_path) + ) + ); + } + test_field_trt_engine_decryption_lib_path(); + fn test_field_trt_force_sequential_engine_build() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).trt_force_sequential_engine_build) as usize + - ptr as usize + }, + 96usize, + concat!( + "Offset of field: ", + stringify!(OrtTensorRTProviderOptions), + "::", + stringify!(trt_force_sequential_engine_build) + ) + ); + } + test_field_trt_force_sequential_engine_build(); +} +#[doc = " \\brief MIGraphX Provider Options"] +#[doc = ""] +#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_MIGraphX"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtMIGraphXProviderOptions { + pub device_id: ::std::os::raw::c_int, + pub migraphx_fp16_enable: ::std::os::raw::c_int, + pub migraphx_int8_enable: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_OrtMIGraphXProviderOptions() { + assert_eq!( + ::std::mem::size_of::(), + 12usize, + concat!("Size of: ", stringify!(OrtMIGraphXProviderOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(OrtMIGraphXProviderOptions)) + ); + fn test_field_device_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_id) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtMIGraphXProviderOptions), + "::", + stringify!(device_id) + ) + ); + } + test_field_device_id(); + fn test_field_migraphx_fp16_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).migraphx_fp16_enable) as usize - ptr as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(OrtMIGraphXProviderOptions), + "::", + stringify!(migraphx_fp16_enable) + ) + ); + } + test_field_migraphx_fp16_enable(); + fn test_field_migraphx_int8_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).migraphx_int8_enable) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtMIGraphXProviderOptions), + "::", + stringify!(migraphx_int8_enable) + ) + ); + } + test_field_migraphx_int8_enable(); +} +#[doc = " \\brief OpenVINO Provider Options"] +#[doc = ""] +#[doc = " \\see OrtApi::SessionOptionsAppendExecutionProvider_OpenVINO"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtOpenVINOProviderOptions { + #[doc = " \\brief Device type string"] + #[doc = ""] + #[doc = " Valid settings are one of: \"CPU_FP32\", \"CPU_FP16\", \"GPU_FP32\", \"GPU_FP16\", \"MYRIAD_FP16\", \"VAD-M_FP16\" or \"VAD-F_FP32\""] + pub device_type: *const ::std::os::raw::c_char, + #[doc = "< 0 = disabled, nonzero = enabled"] + pub enable_vpu_fast_compile: ::std::os::raw::c_uchar, + 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 context: *mut ::std::os::raw::c_void, + #[doc = "< 0 = disabled, nonzero = enabled"] + pub enable_opencl_throttling: ::std::os::raw::c_uchar, + #[doc = "< 0 = disabled, nonzero = enabled"] + pub enable_dynamic_shapes: ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_OrtOpenVINOProviderOptions() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtOpenVINOProviderOptions)) + ); + fn test_field_device_type() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_type) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(device_type) + ) + ); + } + test_field_device_type(); + fn test_field_enable_vpu_fast_compile() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).enable_vpu_fast_compile) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(enable_vpu_fast_compile) + ) + ); + } + test_field_enable_vpu_fast_compile(); + fn test_field_device_id() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).device_id) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(device_id) + ) + ); + } + test_field_device_id(); + fn test_field_num_of_threads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).num_of_threads) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(num_of_threads) + ) + ); + } + test_field_num_of_threads(); + fn test_field_use_compiled_network() { + 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 + }, + 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) + ) + ); + } + test_field_blob_dump_path(); + fn test_field_context() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(context) + ) + ); + } + test_field_context(); + fn test_field_enable_opencl_throttling() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(enable_opencl_throttling) + ) + ); + } + test_field_enable_opencl_throttling(); + fn test_field_enable_dynamic_shapes() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize + }, + 57usize, + concat!( + "Offset of field: ", + stringify!(OrtOpenVINOProviderOptions), + "::", + stringify!(enable_dynamic_shapes) + ) + ); + } + test_field_enable_dynamic_shapes(); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtTrainingApi { + _unused: [u8; 0], +} +#[doc = " \\brief The helper interface to get the right version of OrtApi"] +#[doc = ""] +#[doc = " Get a pointer to this structure through ::OrtGetApiBase"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtApiBase { + #[doc = " \\brief Get a pointer to the requested version of the ::OrtApi"] + #[doc = ""] + #[doc = " \\param[in] version Must be ::ORT_API_VERSION"] + #[doc = " \\return The ::OrtApi for the version requested, nullptr will be returned if this version is unsupported, for example when using a runtime"] + #[doc = " older than the version created with this header file."] + pub GetApi: ::std::option::Option *const OrtApi>, + #[doc = "< Returns a null terminated string of the version of the Onnxruntime library (eg: \"1.8.1\")"] + pub GetVersionString: + ::std::option::Option *const ::std::os::raw::c_char>, +} +#[test] +fn bindgen_test_layout_OrtApiBase() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(OrtApiBase)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtApiBase)) + ); + fn test_field_GetApi() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetApi) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtApiBase), + "::", + stringify!(GetApi) + ) + ); + } + test_field_GetApi(); + fn test_field_GetVersionString() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetVersionString) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtApiBase), + "::", + stringify!(GetVersionString) + ) + ); + } + test_field_GetVersionString(); +} +extern "C" { + #[doc = " \\brief The Onnxruntime library's entry point to access the C API"] + #[doc = ""] + #[doc = " Call this to get the a pointer to an ::OrtApiBase"] + pub fn OrtGetApiBase() -> *const OrtApiBase; +} +#[doc = " \\brief Thread work loop function"] +#[doc = ""] +#[doc = " Onnxruntime will provide the working loop on custom thread creation"] +#[doc = " Argument is an onnxruntime built-in type which will be provided when thread pool calls OrtCustomCreateThreadFn"] +pub type OrtThreadWorkerFn = + ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCustomHandleType { + pub __place_holder: ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout_OrtCustomHandleType() { + assert_eq!( + ::std::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(OrtCustomHandleType)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(OrtCustomHandleType)) + ); + fn test_field___place_holder() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).__place_holder) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomHandleType), + "::", + stringify!(__place_holder) + ) + ); + } + test_field___place_holder(); +} +pub type OrtCustomThreadHandle = *const OrtCustomHandleType; +#[doc = " \\brief Ort custom thread creation function"] +#[doc = ""] +#[doc = " The function should return a thread handle to be used in onnxruntime thread pools"] +#[doc = " Onnxruntime will throw exception on return value of nullptr or 0, indicating that the function failed to create a thread"] +pub type OrtCustomCreateThreadFn = ::std::option::Option< + unsafe extern "C" fn( + ort_custom_thread_creation_options: *mut ::std::os::raw::c_void, + ort_thread_worker_fn: OrtThreadWorkerFn, + ort_worker_fn_param: *mut ::std::os::raw::c_void, + ) -> OrtCustomThreadHandle, +>; +#[doc = " \\brief Custom thread join function"] +#[doc = ""] +#[doc = " Onnxruntime thread pool destructor will call the function to join a custom thread."] +#[doc = " Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn"] +pub type OrtCustomJoinThreadFn = + ::std::option::Option; +#[doc = " \\brief The C API"] +#[doc = ""] +#[doc = " All C API functions are defined inside this structure as pointers to functions."] +#[doc = " Call OrtApiBase::GetApi to get a pointer to it"] +#[doc = ""] +#[doc = " \\nosubgrouping"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtApi { + #[doc = " \\brief Create an OrtStatus from a null terminated string"] + #[doc = ""] + #[doc = " \\param[in] code"] + #[doc = " \\param[in] msg A null-terminated string. Its contents will be copied."] + #[doc = " \\return A new OrtStatus object, must be destroyed with OrtApi::ReleaseStatus"] + pub CreateStatus: ::std::option::Option< + unsafe extern "C" fn( + code: OrtErrorCode, + msg: *const ::std::os::raw::c_char, + ) -> *mut OrtStatus, + >, + #[doc = " \\brief Get OrtErrorCode from OrtStatus"] + #[doc = ""] + #[doc = " \\param[in] status"] + #[doc = " \\return OrtErrorCode that \\p status was created with"] + pub GetErrorCode: + ::std::option::Option OrtErrorCode>, + #[doc = " \\brief Get error string from OrtStatus"] + #[doc = ""] + #[doc = " \\param[in] status"] + #[doc = " \\return The error message inside the `status`. Do not free the returned value."] + pub GetErrorMessage: ::std::option::Option< + unsafe extern "C" fn(status: *const OrtStatus) -> *const ::std::os::raw::c_char, + >, + pub CreateEnv: ::std::option::Option< + unsafe extern "C" fn( + log_severity_level: OrtLoggingLevel, + logid: *const ::std::os::raw::c_char, + out: *mut *mut OrtEnv, + ) -> OrtStatusPtr, + >, + pub CreateEnvWithCustomLogger: ::std::option::Option< + unsafe extern "C" fn( + logging_function: OrtLoggingFunction, + logger_param: *mut ::std::os::raw::c_void, + log_severity_level: OrtLoggingLevel, + logid: *const ::std::os::raw::c_char, + out: *mut *mut OrtEnv, + ) -> OrtStatusPtr, + >, + pub EnableTelemetryEvents: + ::std::option::Option OrtStatusPtr>, + pub DisableTelemetryEvents: + ::std::option::Option OrtStatusPtr>, + pub CreateSession: ::std::option::Option< + unsafe extern "C" fn( + env: *const OrtEnv, + model_path: *const ::std::os::raw::c_char, + options: *const OrtSessionOptions, + out: *mut *mut OrtSession, + ) -> OrtStatusPtr, + >, + pub CreateSessionFromArray: ::std::option::Option< + unsafe extern "C" fn( + env: *const OrtEnv, + model_data: *const ::std::os::raw::c_void, + model_data_length: usize, + options: *const OrtSessionOptions, + out: *mut *mut OrtSession, + ) -> OrtStatusPtr, + >, + pub Run: ::std::option::Option< + unsafe extern "C" fn( + session: *mut OrtSession, + run_options: *const OrtRunOptions, + input_names: *const *const ::std::os::raw::c_char, + inputs: *const *const OrtValue, + input_len: usize, + output_names: *const *const ::std::os::raw::c_char, + output_names_len: usize, + outputs: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub CreateSessionOptions: ::std::option::Option< + unsafe extern "C" fn(options: *mut *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub SetOptimizedModelFilePath: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + optimized_model_filepath: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub CloneSessionOptions: ::std::option::Option< + unsafe extern "C" fn( + in_options: *const OrtSessionOptions, + out_options: *mut *mut OrtSessionOptions, + ) -> OrtStatusPtr, + >, + pub SetSessionExecutionMode: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + execution_mode: ExecutionMode, + ) -> OrtStatusPtr, + >, + pub EnableProfiling: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + profile_file_prefix: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub DisableProfiling: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub EnableMemPattern: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub DisableMemPattern: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub EnableCpuMemArena: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub DisableCpuMemArena: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub SetSessionLogId: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + logid: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub SetSessionLogVerbosityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + session_log_verbosity_level: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub SetSessionLogSeverityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + session_log_severity_level: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub SetSessionGraphOptimizationLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + graph_optimization_level: GraphOptimizationLevel, + ) -> OrtStatusPtr, + >, + pub SetIntraOpNumThreads: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + intra_op_num_threads: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub SetInterOpNumThreads: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + inter_op_num_threads: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub CreateCustomOpDomain: ::std::option::Option< + unsafe extern "C" fn( + domain: *const ::std::os::raw::c_char, + out: *mut *mut OrtCustomOpDomain, + ) -> OrtStatusPtr, + >, + pub CustomOpDomain_Add: ::std::option::Option< + unsafe extern "C" fn( + custom_op_domain: *mut OrtCustomOpDomain, + op: *const OrtCustomOp, + ) -> OrtStatusPtr, + >, + pub AddCustomOpDomain: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + custom_op_domain: *mut OrtCustomOpDomain, + ) -> OrtStatusPtr, + >, + pub RegisterCustomOpsLibrary: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + library_path: *const ::std::os::raw::c_char, + library_handle: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub SessionGetInputCount: ::std::option::Option< + unsafe extern "C" fn(session: *const OrtSession, out: *mut usize) -> OrtStatusPtr, + >, + pub SessionGetOutputCount: ::std::option::Option< + unsafe extern "C" fn(session: *const OrtSession, out: *mut usize) -> OrtStatusPtr, + >, + pub SessionGetOverridableInitializerCount: ::std::option::Option< + unsafe extern "C" fn(session: *const OrtSession, out: *mut usize) -> OrtStatusPtr, + >, + pub SessionGetInputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub SessionGetOutputTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub SessionGetOverridableInitializerTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub SessionGetInputName: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub SessionGetOutputName: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub SessionGetOverridableInitializerName: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + index: usize, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub CreateRunOptions: + ::std::option::Option OrtStatusPtr>, + pub RunOptionsSetRunLogVerbosityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtRunOptions, + log_verbosity_level: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub RunOptionsSetRunLogSeverityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtRunOptions, + log_severity_level: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub RunOptionsSetRunTag: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtRunOptions, + run_tag: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RunOptionsGetRunLogVerbosityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtRunOptions, + log_verbosity_level: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub RunOptionsGetRunLogSeverityLevel: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtRunOptions, + log_severity_level: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub RunOptionsGetRunTag: ::std::option::Option< + unsafe extern "C" fn( + options: *const OrtRunOptions, + run_tag: *mut *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub RunOptionsSetTerminate: + ::std::option::Option OrtStatusPtr>, + pub RunOptionsUnsetTerminate: + ::std::option::Option OrtStatusPtr>, + pub CreateTensorAsOrtValue: ::std::option::Option< + unsafe extern "C" fn( + allocator: *mut OrtAllocator, + shape: *const i64, + shape_len: usize, + type_: ONNXTensorElementDataType, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub CreateTensorWithDataAsOrtValue: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtMemoryInfo, + p_data: *mut ::std::os::raw::c_void, + p_data_len: usize, + shape: *const i64, + shape_len: usize, + type_: ONNXTensorElementDataType, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub IsTensor: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetTensorMutableData: ::std::option::Option< + unsafe extern "C" fn( + value: *mut OrtValue, + out: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub FillStringTensor: ::std::option::Option< + unsafe extern "C" fn( + value: *mut OrtValue, + s: *const *const ::std::os::raw::c_char, + s_len: usize, + ) -> OrtStatusPtr, + >, + pub GetStringTensorDataLength: ::std::option::Option< + unsafe extern "C" fn(value: *const OrtValue, len: *mut usize) -> OrtStatusPtr, + >, + pub GetStringTensorContent: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + s: *mut ::std::os::raw::c_void, + s_len: usize, + offsets: *mut usize, + offsets_len: usize, + ) -> OrtStatusPtr, + >, + pub CastTypeInfoToTensorInfo: ::std::option::Option< + unsafe extern "C" fn( + type_info: *const OrtTypeInfo, + out: *mut *const OrtTensorTypeAndShapeInfo, + ) -> OrtStatusPtr, + >, + pub GetOnnxTypeFromTypeInfo: ::std::option::Option< + unsafe extern "C" fn(type_info: *const OrtTypeInfo, out: *mut ONNXType) -> OrtStatusPtr, + >, + pub CreateTensorTypeAndShapeInfo: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtTensorTypeAndShapeInfo) -> OrtStatusPtr, + >, + pub SetTensorElementType: ::std::option::Option< + unsafe extern "C" fn( + info: *mut OrtTensorTypeAndShapeInfo, + type_: ONNXTensorElementDataType, + ) -> OrtStatusPtr, + >, + pub SetDimensions: ::std::option::Option< + unsafe extern "C" fn( + info: *mut OrtTensorTypeAndShapeInfo, + dim_values: *const i64, + dim_count: usize, + ) -> OrtStatusPtr, + >, + pub GetTensorElementType: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtTensorTypeAndShapeInfo, + out: *mut ONNXTensorElementDataType, + ) -> OrtStatusPtr, + >, + pub GetDimensionsCount: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtTensorTypeAndShapeInfo, + out: *mut usize, + ) -> OrtStatusPtr, + >, + pub GetDimensions: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtTensorTypeAndShapeInfo, + dim_values: *mut i64, + dim_values_length: usize, + ) -> OrtStatusPtr, + >, + pub GetSymbolicDimensions: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtTensorTypeAndShapeInfo, + dim_params: *mut *const ::std::os::raw::c_char, + dim_params_length: usize, + ) -> OrtStatusPtr, + >, + pub GetTensorShapeElementCount: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtTensorTypeAndShapeInfo, + out: *mut usize, + ) -> OrtStatusPtr, + >, + pub GetTensorTypeAndShape: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + out: *mut *mut OrtTensorTypeAndShapeInfo, + ) -> OrtStatusPtr, + >, + pub GetTypeInfo: ::std::option::Option< + unsafe extern "C" fn(value: *const OrtValue, out: *mut *mut OrtTypeInfo) -> OrtStatusPtr, + >, + pub GetValueType: ::std::option::Option< + unsafe extern "C" fn(value: *const OrtValue, out: *mut ONNXType) -> OrtStatusPtr, + >, + pub CreateMemoryInfo: ::std::option::Option< + unsafe extern "C" fn( + name: *const ::std::os::raw::c_char, + type_: OrtAllocatorType, + id: ::std::os::raw::c_int, + mem_type: OrtMemType, + out: *mut *mut OrtMemoryInfo, + ) -> OrtStatusPtr, + >, + pub CreateCpuMemoryInfo: ::std::option::Option< + unsafe extern "C" fn( + type_: OrtAllocatorType, + mem_type: OrtMemType, + out: *mut *mut OrtMemoryInfo, + ) -> OrtStatusPtr, + >, + pub CompareMemoryInfo: ::std::option::Option< + unsafe extern "C" fn( + info1: *const OrtMemoryInfo, + info2: *const OrtMemoryInfo, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub MemoryInfoGetName: ::std::option::Option< + unsafe extern "C" fn( + ptr: *const OrtMemoryInfo, + out: *mut *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub MemoryInfoGetId: ::std::option::Option< + unsafe extern "C" fn( + ptr: *const OrtMemoryInfo, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub MemoryInfoGetMemType: ::std::option::Option< + unsafe extern "C" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemType) -> OrtStatusPtr, + >, + pub MemoryInfoGetType: ::std::option::Option< + unsafe extern "C" fn(ptr: *const OrtMemoryInfo, out: *mut OrtAllocatorType) -> OrtStatusPtr, + >, + pub AllocatorAlloc: ::std::option::Option< + unsafe extern "C" fn( + ort_allocator: *mut OrtAllocator, + size: usize, + out: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub AllocatorFree: ::std::option::Option< + unsafe extern "C" fn( + ort_allocator: *mut OrtAllocator, + p: *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub AllocatorGetInfo: ::std::option::Option< + unsafe extern "C" fn( + ort_allocator: *const OrtAllocator, + out: *mut *const OrtMemoryInfo, + ) -> OrtStatusPtr, + >, + pub GetAllocatorWithDefaultOptions: + ::std::option::Option OrtStatusPtr>, + pub AddFreeDimensionOverride: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + dim_denotation: *const ::std::os::raw::c_char, + dim_value: i64, + ) -> OrtStatusPtr, + >, + pub GetValue: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + index: ::std::os::raw::c_int, + allocator: *mut OrtAllocator, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub GetValueCount: ::std::option::Option< + unsafe extern "C" fn(value: *const OrtValue, out: *mut usize) -> OrtStatusPtr, + >, + pub CreateValue: ::std::option::Option< + unsafe extern "C" fn( + in_: *const *const OrtValue, + num_values: usize, + value_type: ONNXType, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub CreateOpaqueValue: ::std::option::Option< + unsafe extern "C" fn( + domain_name: *const ::std::os::raw::c_char, + type_name: *const ::std::os::raw::c_char, + data_container: *const ::std::os::raw::c_void, + data_container_size: usize, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub GetOpaqueValue: ::std::option::Option< + unsafe extern "C" fn( + domain_name: *const ::std::os::raw::c_char, + type_name: *const ::std::os::raw::c_char, + in_: *const OrtValue, + data_container: *mut ::std::os::raw::c_void, + data_container_size: usize, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_float: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + out: *mut f32, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_int64: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + out: *mut i64, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttribute_string: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelContext_GetInputCount: ::std::option::Option< + unsafe extern "C" fn(context: *const OrtKernelContext, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelContext_GetOutputCount: ::std::option::Option< + unsafe extern "C" fn(context: *const OrtKernelContext, out: *mut usize) -> OrtStatusPtr, + >, + pub KernelContext_GetInput: ::std::option::Option< + unsafe extern "C" fn( + context: *const OrtKernelContext, + index: usize, + out: *mut *const OrtValue, + ) -> OrtStatusPtr, + >, + pub KernelContext_GetOutput: ::std::option::Option< + unsafe extern "C" fn( + context: *mut OrtKernelContext, + index: usize, + dim_values: *const i64, + dim_count: usize, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub ReleaseEnv: ::std::option::Option, + pub ReleaseStatus: ::std::option::Option, + pub ReleaseMemoryInfo: ::std::option::Option, + pub ReleaseSession: ::std::option::Option, + pub ReleaseValue: ::std::option::Option, + pub ReleaseRunOptions: ::std::option::Option, + pub ReleaseTypeInfo: ::std::option::Option, + pub ReleaseTensorTypeAndShapeInfo: + ::std::option::Option, + pub ReleaseSessionOptions: + ::std::option::Option, + pub ReleaseCustomOpDomain: + ::std::option::Option, + pub GetDenotationFromTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + type_info: *const OrtTypeInfo, + denotation: *mut *const ::std::os::raw::c_char, + len: *mut usize, + ) -> OrtStatusPtr, + >, + pub CastTypeInfoToMapTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + type_info: *const OrtTypeInfo, + out: *mut *const OrtMapTypeInfo, + ) -> OrtStatusPtr, + >, + pub CastTypeInfoToSequenceTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + type_info: *const OrtTypeInfo, + out: *mut *const OrtSequenceTypeInfo, + ) -> OrtStatusPtr, + >, + pub GetMapKeyType: ::std::option::Option< + unsafe extern "C" fn( + map_type_info: *const OrtMapTypeInfo, + out: *mut ONNXTensorElementDataType, + ) -> OrtStatusPtr, + >, + pub GetMapValueType: ::std::option::Option< + unsafe extern "C" fn( + map_type_info: *const OrtMapTypeInfo, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub GetSequenceElementType: ::std::option::Option< + unsafe extern "C" fn( + sequence_type_info: *const OrtSequenceTypeInfo, + type_info: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub ReleaseMapTypeInfo: ::std::option::Option, + pub ReleaseSequenceTypeInfo: + ::std::option::Option, + pub SessionEndProfiling: ::std::option::Option< + unsafe extern "C" fn( + session: *mut OrtSession, + allocator: *mut OrtAllocator, + out: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub SessionGetModelMetadata: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + out: *mut *mut OrtModelMetadata, + ) -> OrtStatusPtr, + >, + pub ModelMetadataGetProducerName: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub ModelMetadataGetGraphName: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub ModelMetadataGetDomain: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub ModelMetadataGetDescription: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub ModelMetadataLookupCustomMetadataMap: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + key: *const ::std::os::raw::c_char, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub ModelMetadataGetVersion: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + value: *mut i64, + ) -> OrtStatusPtr, + >, + pub ReleaseModelMetadata: + ::std::option::Option, + pub CreateEnvWithGlobalThreadPools: ::std::option::Option< + unsafe extern "C" fn( + log_severity_level: OrtLoggingLevel, + logid: *const ::std::os::raw::c_char, + tp_options: *const OrtThreadingOptions, + out: *mut *mut OrtEnv, + ) -> OrtStatusPtr, + >, + pub DisablePerSessionThreads: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub CreateThreadingOptions: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtThreadingOptions) -> OrtStatusPtr, + >, + pub ReleaseThreadingOptions: + ::std::option::Option, + pub ModelMetadataGetCustomMetadataMapKeys: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + keys: *mut *mut *mut ::std::os::raw::c_char, + num_keys: *mut i64, + ) -> OrtStatusPtr, + >, + pub AddFreeDimensionOverrideByName: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + dim_name: *const ::std::os::raw::c_char, + dim_value: i64, + ) -> OrtStatusPtr, + >, + pub GetAvailableProviders: ::std::option::Option< + unsafe extern "C" fn( + out_ptr: *mut *mut *mut ::std::os::raw::c_char, + provider_length: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub ReleaseAvailableProviders: ::std::option::Option< + unsafe extern "C" fn( + ptr: *mut *mut ::std::os::raw::c_char, + providers_length: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub GetStringTensorElementLength: ::std::option::Option< + unsafe extern "C" fn(value: *const OrtValue, index: usize, out: *mut usize) -> OrtStatusPtr, + >, + pub GetStringTensorElement: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + s_len: usize, + index: usize, + s: *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub FillStringTensorElement: ::std::option::Option< + unsafe extern "C" fn( + value: *mut OrtValue, + s: *const ::std::os::raw::c_char, + index: usize, + ) -> OrtStatusPtr, + >, + pub AddSessionConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub CreateAllocator: ::std::option::Option< + unsafe extern "C" fn( + session: *const OrtSession, + mem_info: *const OrtMemoryInfo, + out: *mut *mut OrtAllocator, + ) -> OrtStatusPtr, + >, + pub ReleaseAllocator: ::std::option::Option, + pub RunWithBinding: ::std::option::Option< + unsafe extern "C" fn( + session: *mut OrtSession, + run_options: *const OrtRunOptions, + binding_ptr: *const OrtIoBinding, + ) -> OrtStatusPtr, + >, + pub CreateIoBinding: ::std::option::Option< + unsafe extern "C" fn(session: *mut OrtSession, out: *mut *mut OrtIoBinding) -> OrtStatusPtr, + >, + pub ReleaseIoBinding: ::std::option::Option, + pub BindInput: ::std::option::Option< + unsafe extern "C" fn( + binding_ptr: *mut OrtIoBinding, + name: *const ::std::os::raw::c_char, + val_ptr: *const OrtValue, + ) -> OrtStatusPtr, + >, + pub BindOutput: ::std::option::Option< + unsafe extern "C" fn( + binding_ptr: *mut OrtIoBinding, + name: *const ::std::os::raw::c_char, + val_ptr: *const OrtValue, + ) -> OrtStatusPtr, + >, + pub BindOutputToDevice: ::std::option::Option< + unsafe extern "C" fn( + binding_ptr: *mut OrtIoBinding, + name: *const ::std::os::raw::c_char, + mem_info_ptr: *const OrtMemoryInfo, + ) -> OrtStatusPtr, + >, + pub GetBoundOutputNames: ::std::option::Option< + unsafe extern "C" fn( + binding_ptr: *const OrtIoBinding, + allocator: *mut OrtAllocator, + buffer: *mut *mut ::std::os::raw::c_char, + lengths: *mut *mut usize, + count: *mut usize, + ) -> OrtStatusPtr, + >, + pub GetBoundOutputValues: ::std::option::Option< + unsafe extern "C" fn( + binding_ptr: *const OrtIoBinding, + allocator: *mut OrtAllocator, + output: *mut *mut *mut OrtValue, + output_count: *mut usize, + ) -> OrtStatusPtr, + >, + #[doc = " \\brief Clears any previously set Inputs for an ::OrtIoBinding"] + pub ClearBoundInputs: + ::std::option::Option, + #[doc = " \\brief Clears any previously set Outputs for an ::OrtIoBinding"] + pub ClearBoundOutputs: + ::std::option::Option, + pub TensorAt: ::std::option::Option< + unsafe extern "C" fn( + value: *mut OrtValue, + location_values: *const i64, + location_values_count: usize, + out: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub CreateAndRegisterAllocator: ::std::option::Option< + unsafe extern "C" fn( + env: *mut OrtEnv, + mem_info: *const OrtMemoryInfo, + arena_cfg: *const OrtArenaCfg, + ) -> OrtStatusPtr, + >, + pub SetLanguageProjection: ::std::option::Option< + unsafe extern "C" fn( + ort_env: *const OrtEnv, + projection: OrtLanguageProjection, + ) -> OrtStatusPtr, + >, + pub SessionGetProfilingStartTimeNs: ::std::option::Option< + unsafe extern "C" fn(session: *const OrtSession, out: *mut u64) -> OrtStatusPtr, + >, + pub SetGlobalIntraOpNumThreads: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + intra_op_num_threads: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub SetGlobalInterOpNumThreads: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + inter_op_num_threads: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub SetGlobalSpinControl: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + allow_spinning: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub AddInitializer: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + name: *const ::std::os::raw::c_char, + val: *const OrtValue, + ) -> OrtStatusPtr, + >, + pub CreateEnvWithCustomLoggerAndGlobalThreadPools: ::std::option::Option< + unsafe extern "C" fn( + logging_function: OrtLoggingFunction, + logger_param: *mut ::std::os::raw::c_void, + log_severity_level: OrtLoggingLevel, + logid: *const ::std::os::raw::c_char, + tp_options: *const OrtThreadingOptions, + out: *mut *mut OrtEnv, + ) -> OrtStatusPtr, + >, + pub SessionOptionsAppendExecutionProvider_CUDA: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + cuda_options: *const OrtCUDAProviderOptions, + ) -> OrtStatusPtr, + >, + pub SessionOptionsAppendExecutionProvider_ROCM: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + rocm_options: *const OrtROCMProviderOptions, + ) -> OrtStatusPtr, + >, + pub SessionOptionsAppendExecutionProvider_OpenVINO: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + provider_options: *const OrtOpenVINOProviderOptions, + ) -> OrtStatusPtr, + >, + pub SetGlobalDenormalAsZero: ::std::option::Option< + unsafe extern "C" fn(tp_options: *mut OrtThreadingOptions) -> OrtStatusPtr, + >, + pub CreateArenaCfg: ::std::option::Option< + unsafe extern "C" fn( + max_mem: usize, + arena_extend_strategy: ::std::os::raw::c_int, + initial_chunk_size_bytes: ::std::os::raw::c_int, + max_dead_bytes_per_chunk: ::std::os::raw::c_int, + out: *mut *mut OrtArenaCfg, + ) -> OrtStatusPtr, + >, + pub ReleaseArenaCfg: ::std::option::Option, + pub ModelMetadataGetGraphDescription: ::std::option::Option< + unsafe extern "C" fn( + model_metadata: *const OrtModelMetadata, + allocator: *mut OrtAllocator, + value: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub SessionOptionsAppendExecutionProvider_TensorRT: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + tensorrt_options: *const OrtTensorRTProviderOptions, + ) -> OrtStatusPtr, + >, + pub SetCurrentGpuDeviceId: ::std::option::Option< + unsafe extern "C" fn(device_id: ::std::os::raw::c_int) -> OrtStatusPtr, + >, + pub GetCurrentGpuDeviceId: ::std::option::Option< + unsafe extern "C" fn(device_id: *mut ::std::os::raw::c_int) -> OrtStatusPtr, + >, + pub KernelInfoGetAttributeArray_float: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + out: *mut f32, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfoGetAttributeArray_int64: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + name: *const ::std::os::raw::c_char, + out: *mut i64, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub CreateArenaCfgV2: ::std::option::Option< + unsafe extern "C" fn( + arena_config_keys: *const *const ::std::os::raw::c_char, + arena_config_values: *const usize, + num_keys: usize, + out: *mut *mut OrtArenaCfg, + ) -> OrtStatusPtr, + >, + pub AddRunConfigEntry: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtRunOptions, + config_key: *const ::std::os::raw::c_char, + config_value: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub CreatePrepackedWeightsContainer: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtPrepackedWeightsContainer) -> OrtStatusPtr, + >, + pub ReleasePrepackedWeightsContainer: + ::std::option::Option, + pub CreateSessionWithPrepackedWeightsContainer: ::std::option::Option< + unsafe extern "C" fn( + env: *const OrtEnv, + model_path: *const ::std::os::raw::c_char, + options: *const OrtSessionOptions, + prepacked_weights_container: *mut OrtPrepackedWeightsContainer, + out: *mut *mut OrtSession, + ) -> OrtStatusPtr, + >, + pub CreateSessionFromArrayWithPrepackedWeightsContainer: ::std::option::Option< + unsafe extern "C" fn( + env: *const OrtEnv, + model_data: *const ::std::os::raw::c_void, + model_data_length: usize, + options: *const OrtSessionOptions, + prepacked_weights_container: *mut OrtPrepackedWeightsContainer, + out: *mut *mut OrtSession, + ) -> OrtStatusPtr, + >, + pub SessionOptionsAppendExecutionProvider_TensorRT_V2: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + tensorrt_options: *const OrtTensorRTProviderOptionsV2, + ) -> OrtStatusPtr, + >, + pub CreateTensorRTProviderOptions: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtTensorRTProviderOptionsV2) -> OrtStatusPtr, + >, + pub UpdateTensorRTProviderOptions: ::std::option::Option< + unsafe extern "C" fn( + tensorrt_options: *mut OrtTensorRTProviderOptionsV2, + provider_options_keys: *const *const ::std::os::raw::c_char, + provider_options_values: *const *const ::std::os::raw::c_char, + num_keys: usize, + ) -> OrtStatusPtr, + >, + pub GetTensorRTProviderOptionsAsString: ::std::option::Option< + unsafe extern "C" fn( + tensorrt_options: *const OrtTensorRTProviderOptionsV2, + allocator: *mut OrtAllocator, + ptr: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + #[doc = " \\brief Release an ::OrtTensorRTProviderOptionsV2"] + #[doc = ""] + #[doc = " \\note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does"] + pub ReleaseTensorRTProviderOptions: + ::std::option::Option, + pub EnableOrtCustomOps: ::std::option::Option< + unsafe extern "C" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr, + >, + pub RegisterAllocator: ::std::option::Option< + unsafe extern "C" fn(env: *mut OrtEnv, allocator: *mut OrtAllocator) -> OrtStatusPtr, + >, + pub UnregisterAllocator: ::std::option::Option< + unsafe extern "C" fn(env: *mut OrtEnv, mem_info: *const OrtMemoryInfo) -> OrtStatusPtr, + >, + pub IsSparseTensor: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub CreateSparseTensorAsOrtValue: ::std::option::Option< + unsafe extern "C" fn( + allocator: *mut OrtAllocator, + dense_shape: *const i64, + dense_shape_len: usize, + type_: ONNXTensorElementDataType, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub FillSparseTensorCoo: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + data_mem_info: *const OrtMemoryInfo, + values_shape: *const i64, + values_shape_len: usize, + values: *const ::std::os::raw::c_void, + indices_data: *const i64, + indices_num: usize, + ) -> OrtStatusPtr, + >, + pub FillSparseTensorCsr: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + data_mem_info: *const OrtMemoryInfo, + values_shape: *const i64, + values_shape_len: usize, + values: *const ::std::os::raw::c_void, + inner_indices_data: *const i64, + inner_indices_num: usize, + outer_indices_data: *const i64, + outer_indices_num: usize, + ) -> OrtStatusPtr, + >, + pub FillSparseTensorBlockSparse: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + data_mem_info: *const OrtMemoryInfo, + values_shape: *const i64, + values_shape_len: usize, + values: *const ::std::os::raw::c_void, + indices_shape_data: *const i64, + indices_shape_len: usize, + indices_data: *const i32, + ) -> OrtStatusPtr, + >, + pub CreateSparseTensorWithValuesAsOrtValue: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtMemoryInfo, + p_data: *mut ::std::os::raw::c_void, + dense_shape: *const i64, + dense_shape_len: usize, + values_shape: *const i64, + values_shape_len: usize, + type_: ONNXTensorElementDataType, + out: *mut *mut OrtValue, + ) -> OrtStatusPtr, + >, + pub UseCooIndices: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + indices_data: *mut i64, + indices_num: usize, + ) -> OrtStatusPtr, + >, + pub UseCsrIndices: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + inner_data: *mut i64, + inner_num: usize, + outer_data: *mut i64, + outer_num: usize, + ) -> OrtStatusPtr, + >, + pub UseBlockSparseIndices: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *mut OrtValue, + indices_shape: *const i64, + indices_shape_len: usize, + indices_data: *mut i32, + ) -> OrtStatusPtr, + >, + pub GetSparseTensorFormat: ::std::option::Option< + unsafe extern "C" fn(ort_value: *const OrtValue, out: *mut OrtSparseFormat) -> OrtStatusPtr, + >, + pub GetSparseTensorValuesTypeAndShape: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *const OrtValue, + out: *mut *mut OrtTensorTypeAndShapeInfo, + ) -> OrtStatusPtr, + >, + pub GetSparseTensorValues: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *const OrtValue, + out: *mut *const ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub GetSparseTensorIndicesTypeShape: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *const OrtValue, + indices_format: OrtSparseIndicesFormat, + out: *mut *mut OrtTensorTypeAndShapeInfo, + ) -> OrtStatusPtr, + >, + pub GetSparseTensorIndices: ::std::option::Option< + unsafe extern "C" fn( + ort_value: *const OrtValue, + indices_format: OrtSparseIndicesFormat, + num_indices: *mut usize, + indices: *mut *const ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub HasValue: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + out: *mut ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub KernelContext_GetGPUComputeStream: ::std::option::Option< + unsafe extern "C" fn( + context: *const OrtKernelContext, + out: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub GetTensorMemoryInfo: ::std::option::Option< + unsafe extern "C" fn( + value: *const OrtValue, + mem_info: *mut *const OrtMemoryInfo, + ) -> OrtStatusPtr, + >, + pub GetExecutionProviderApi: ::std::option::Option< + unsafe extern "C" fn( + provider_name: *const ::std::os::raw::c_char, + version: u32, + provider_api: *mut *const ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub SessionOptionsSetCustomCreateThreadFn: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + ort_custom_create_thread_fn: OrtCustomCreateThreadFn, + ) -> OrtStatusPtr, + >, + pub SessionOptionsSetCustomThreadCreationOptions: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + ort_custom_thread_creation_options: *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub SessionOptionsSetCustomJoinThreadFn: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + ort_custom_join_thread_fn: OrtCustomJoinThreadFn, + ) -> OrtStatusPtr, + >, + pub SetGlobalCustomCreateThreadFn: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + ort_custom_create_thread_fn: OrtCustomCreateThreadFn, + ) -> OrtStatusPtr, + >, + pub SetGlobalCustomThreadCreationOptions: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + ort_custom_thread_creation_options: *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub SetGlobalCustomJoinThreadFn: ::std::option::Option< + unsafe extern "C" fn( + tp_options: *mut OrtThreadingOptions, + ort_custom_join_thread_fn: OrtCustomJoinThreadFn, + ) -> OrtStatusPtr, + >, + pub SynchronizeBoundInputs: + ::std::option::Option OrtStatusPtr>, + pub SynchronizeBoundOutputs: + ::std::option::Option OrtStatusPtr>, + pub SessionOptionsAppendExecutionProvider_CUDA_V2: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + cuda_options: *const OrtCUDAProviderOptionsV2, + ) -> OrtStatusPtr, + >, + pub CreateCUDAProviderOptions: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtCUDAProviderOptionsV2) -> OrtStatusPtr, + >, + pub UpdateCUDAProviderOptions: ::std::option::Option< + unsafe extern "C" fn( + cuda_options: *mut OrtCUDAProviderOptionsV2, + provider_options_keys: *const *const ::std::os::raw::c_char, + provider_options_values: *const *const ::std::os::raw::c_char, + num_keys: usize, + ) -> OrtStatusPtr, + >, + pub GetCUDAProviderOptionsAsString: ::std::option::Option< + unsafe extern "C" fn( + cuda_options: *const OrtCUDAProviderOptionsV2, + allocator: *mut OrtAllocator, + ptr: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + #[doc = " \\brief Release an ::OrtCUDAProviderOptionsV2"] + #[doc = ""] + #[doc = " \\note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does"] + #[doc = ""] + #[doc = " \\since Version 1.11."] + pub ReleaseCUDAProviderOptions: + ::std::option::Option, + pub SessionOptionsAppendExecutionProvider_MIGraphX: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + migraphx_options: *const OrtMIGraphXProviderOptions, + ) -> OrtStatusPtr, + >, + pub AddExternalInitializers: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + initializer_names: *const *const ::std::os::raw::c_char, + initializers: *const *const OrtValue, + initializers_num: usize, + ) -> OrtStatusPtr, + >, + pub CreateOpAttr: ::std::option::Option< + unsafe extern "C" fn( + name: *const ::std::os::raw::c_char, + data: *const ::std::os::raw::c_void, + len: ::std::os::raw::c_int, + type_: OrtOpAttrType, + op_attr: *mut *mut OrtOpAttr, + ) -> OrtStatusPtr, + >, + pub ReleaseOpAttr: ::std::option::Option, + pub CreateOp: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + op_name: *const ::std::os::raw::c_char, + domain: *const ::std::os::raw::c_char, + version: ::std::os::raw::c_int, + type_constraint_names: *mut *const ::std::os::raw::c_char, + type_constraint_values: *const ONNXTensorElementDataType, + type_constraint_count: ::std::os::raw::c_int, + attr_values: *const *const OrtOpAttr, + attr_count: ::std::os::raw::c_int, + input_count: ::std::os::raw::c_int, + output_count: ::std::os::raw::c_int, + ort_op: *mut *mut OrtOp, + ) -> OrtStatusPtr, + >, + pub InvokeOp: ::std::option::Option< + unsafe extern "C" fn( + context: *const OrtKernelContext, + ort_op: *const OrtOp, + input_values: *const *const OrtValue, + input_count: ::std::os::raw::c_int, + output_values: *const *mut OrtValue, + output_count: ::std::os::raw::c_int, + ) -> OrtStatusPtr, + >, + pub ReleaseOp: ::std::option::Option, + pub SessionOptionsAppendExecutionProvider: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + provider_name: *const ::std::os::raw::c_char, + provider_options_keys: *const *const ::std::os::raw::c_char, + provider_options_values: *const *const ::std::os::raw::c_char, + num_keys: usize, + ) -> OrtStatusPtr, + >, + pub CopyKernelInfo: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + info_copy: *mut *mut OrtKernelInfo, + ) -> OrtStatusPtr, + >, + pub ReleaseKernelInfo: ::std::option::Option, + pub GetTrainingApi: + ::std::option::Option *const OrtTrainingApi>, + pub SessionOptionsAppendExecutionProvider_CANN: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + cann_options: *const OrtCANNProviderOptions, + ) -> OrtStatusPtr, + >, + pub CreateCANNProviderOptions: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtCANNProviderOptions) -> OrtStatusPtr, + >, + pub UpdateCANNProviderOptions: ::std::option::Option< + unsafe extern "C" fn( + cann_options: *mut OrtCANNProviderOptions, + provider_options_keys: *const *const ::std::os::raw::c_char, + provider_options_values: *const *const ::std::os::raw::c_char, + num_keys: usize, + ) -> OrtStatusPtr, + >, + pub GetCANNProviderOptionsAsString: ::std::option::Option< + unsafe extern "C" fn( + cann_options: *const OrtCANNProviderOptions, + allocator: *mut OrtAllocator, + ptr: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + #[doc = " \\brief Release an OrtCANNProviderOptions"] + #[doc = ""] + #[doc = " \\param[in] the pointer of OrtCANNProviderOptions which will been deleted"] + #[doc = ""] + #[doc = " \\since Version 1.13."] + pub ReleaseCANNProviderOptions: + ::std::option::Option, +} +#[test] +fn bindgen_test_layout_OrtApi() { + assert_eq!( + ::std::mem::size_of::(), + 1800usize, + concat!("Size of: ", stringify!(OrtApi)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtApi)) + ); + fn test_field_CreateStatus() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateStatus) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateStatus) + ) + ); + } + test_field_CreateStatus(); + fn test_field_GetErrorCode() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetErrorCode) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetErrorCode) + ) + ); + } + test_field_GetErrorCode(); + fn test_field_GetErrorMessage() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetErrorMessage) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetErrorMessage) + ) + ); + } + test_field_GetErrorMessage(); + fn test_field_CreateEnv() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateEnv) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateEnv) + ) + ); + } + test_field_CreateEnv(); + fn test_field_CreateEnvWithCustomLogger() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateEnvWithCustomLogger) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateEnvWithCustomLogger) + ) + ); + } + test_field_CreateEnvWithCustomLogger(); + fn test_field_EnableTelemetryEvents() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).EnableTelemetryEvents) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(EnableTelemetryEvents) + ) + ); + } + test_field_EnableTelemetryEvents(); + fn test_field_DisableTelemetryEvents() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).DisableTelemetryEvents) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(DisableTelemetryEvents) + ) + ); + } + test_field_DisableTelemetryEvents(); + fn test_field_CreateSession() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSession) as usize - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSession) + ) + ); + } + test_field_CreateSession(); + fn test_field_CreateSessionFromArray() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSessionFromArray) as usize - ptr as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSessionFromArray) + ) + ); + } + test_field_CreateSessionFromArray(); + fn test_field_Run() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).Run) as usize - ptr as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(Run) + ) + ); + } + test_field_Run(); + fn test_field_CreateSessionOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSessionOptions) as usize - ptr as usize + }, + 80usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSessionOptions) + ) + ); + } + test_field_CreateSessionOptions(); + fn test_field_SetOptimizedModelFilePath() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetOptimizedModelFilePath) as usize - ptr as usize + }, + 88usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetOptimizedModelFilePath) + ) + ); + } + test_field_SetOptimizedModelFilePath(); + fn test_field_CloneSessionOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CloneSessionOptions) as usize - ptr as usize + }, + 96usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CloneSessionOptions) + ) + ); + } + test_field_CloneSessionOptions(); + fn test_field_SetSessionExecutionMode() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetSessionExecutionMode) as usize - ptr as usize + }, + 104usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetSessionExecutionMode) + ) + ); + } + test_field_SetSessionExecutionMode(); + fn test_field_EnableProfiling() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).EnableProfiling) as usize - ptr as usize + }, + 112usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(EnableProfiling) + ) + ); + } + test_field_EnableProfiling(); + fn test_field_DisableProfiling() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).DisableProfiling) as usize - ptr as usize + }, + 120usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(DisableProfiling) + ) + ); + } + test_field_DisableProfiling(); + fn test_field_EnableMemPattern() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).EnableMemPattern) as usize - ptr as usize + }, + 128usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(EnableMemPattern) + ) + ); + } + test_field_EnableMemPattern(); + fn test_field_DisableMemPattern() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).DisableMemPattern) as usize - ptr as usize + }, + 136usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(DisableMemPattern) + ) + ); + } + test_field_DisableMemPattern(); + fn test_field_EnableCpuMemArena() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).EnableCpuMemArena) as usize - ptr as usize + }, + 144usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(EnableCpuMemArena) + ) + ); + } + test_field_EnableCpuMemArena(); + fn test_field_DisableCpuMemArena() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).DisableCpuMemArena) as usize - ptr as usize + }, + 152usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(DisableCpuMemArena) + ) + ); + } + test_field_DisableCpuMemArena(); + fn test_field_SetSessionLogId() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetSessionLogId) as usize - ptr as usize + }, + 160usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetSessionLogId) + ) + ); + } + test_field_SetSessionLogId(); + fn test_field_SetSessionLogVerbosityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetSessionLogVerbosityLevel) as usize - ptr as usize + }, + 168usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetSessionLogVerbosityLevel) + ) + ); + } + test_field_SetSessionLogVerbosityLevel(); + fn test_field_SetSessionLogSeverityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetSessionLogSeverityLevel) as usize - ptr as usize + }, + 176usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetSessionLogSeverityLevel) + ) + ); + } + test_field_SetSessionLogSeverityLevel(); + fn test_field_SetSessionGraphOptimizationLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetSessionGraphOptimizationLevel) as usize + - ptr as usize + }, + 184usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetSessionGraphOptimizationLevel) + ) + ); + } + test_field_SetSessionGraphOptimizationLevel(); + fn test_field_SetIntraOpNumThreads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetIntraOpNumThreads) as usize - ptr as usize + }, + 192usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetIntraOpNumThreads) + ) + ); + } + test_field_SetIntraOpNumThreads(); + fn test_field_SetInterOpNumThreads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetInterOpNumThreads) as usize - ptr as usize + }, + 200usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetInterOpNumThreads) + ) + ); + } + test_field_SetInterOpNumThreads(); + fn test_field_CreateCustomOpDomain() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateCustomOpDomain) as usize - ptr as usize + }, + 208usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateCustomOpDomain) + ) + ); + } + test_field_CreateCustomOpDomain(); + fn test_field_CustomOpDomain_Add() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CustomOpDomain_Add) as usize - ptr as usize + }, + 216usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CustomOpDomain_Add) + ) + ); + } + test_field_CustomOpDomain_Add(); + fn test_field_AddCustomOpDomain() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddCustomOpDomain) as usize - ptr as usize + }, + 224usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddCustomOpDomain) + ) + ); + } + test_field_AddCustomOpDomain(); + fn test_field_RegisterCustomOpsLibrary() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterCustomOpsLibrary) as usize - ptr as usize + }, + 232usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterCustomOpsLibrary) + ) + ); + } + test_field_RegisterCustomOpsLibrary(); + fn test_field_SessionGetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetInputCount) as usize - ptr as usize + }, + 240usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetInputCount) + ) + ); + } + test_field_SessionGetInputCount(); + fn test_field_SessionGetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOutputCount) as usize - ptr as usize + }, + 248usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOutputCount) + ) + ); + } + test_field_SessionGetOutputCount(); + fn test_field_SessionGetOverridableInitializerCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOverridableInitializerCount) as usize + - ptr as usize + }, + 256usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOverridableInitializerCount) + ) + ); + } + test_field_SessionGetOverridableInitializerCount(); + fn test_field_SessionGetInputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetInputTypeInfo) as usize - ptr as usize + }, + 264usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetInputTypeInfo) + ) + ); + } + test_field_SessionGetInputTypeInfo(); + fn test_field_SessionGetOutputTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOutputTypeInfo) as usize - ptr as usize + }, + 272usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOutputTypeInfo) + ) + ); + } + test_field_SessionGetOutputTypeInfo(); + fn test_field_SessionGetOverridableInitializerTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOverridableInitializerTypeInfo) as usize + - ptr as usize + }, + 280usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOverridableInitializerTypeInfo) + ) + ); + } + test_field_SessionGetOverridableInitializerTypeInfo(); + fn test_field_SessionGetInputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetInputName) as usize - ptr as usize + }, + 288usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetInputName) + ) + ); + } + test_field_SessionGetInputName(); + fn test_field_SessionGetOutputName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOutputName) as usize - ptr as usize + }, + 296usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOutputName) + ) + ); + } + test_field_SessionGetOutputName(); + fn test_field_SessionGetOverridableInitializerName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetOverridableInitializerName) as usize + - ptr as usize + }, + 304usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetOverridableInitializerName) + ) + ); + } + test_field_SessionGetOverridableInitializerName(); + fn test_field_CreateRunOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateRunOptions) as usize - ptr as usize + }, + 312usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateRunOptions) + ) + ); + } + test_field_CreateRunOptions(); + fn test_field_RunOptionsSetRunLogVerbosityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsSetRunLogVerbosityLevel) as usize + - ptr as usize + }, + 320usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsSetRunLogVerbosityLevel) + ) + ); + } + test_field_RunOptionsSetRunLogVerbosityLevel(); + fn test_field_RunOptionsSetRunLogSeverityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsSetRunLogSeverityLevel) as usize + - ptr as usize + }, + 328usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsSetRunLogSeverityLevel) + ) + ); + } + test_field_RunOptionsSetRunLogSeverityLevel(); + fn test_field_RunOptionsSetRunTag() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsSetRunTag) as usize - ptr as usize + }, + 336usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsSetRunTag) + ) + ); + } + test_field_RunOptionsSetRunTag(); + fn test_field_RunOptionsGetRunLogVerbosityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsGetRunLogVerbosityLevel) as usize + - ptr as usize + }, + 344usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsGetRunLogVerbosityLevel) + ) + ); + } + test_field_RunOptionsGetRunLogVerbosityLevel(); + fn test_field_RunOptionsGetRunLogSeverityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsGetRunLogSeverityLevel) as usize + - ptr as usize + }, + 352usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsGetRunLogSeverityLevel) + ) + ); + } + test_field_RunOptionsGetRunLogSeverityLevel(); + fn test_field_RunOptionsGetRunTag() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsGetRunTag) as usize - ptr as usize + }, + 360usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsGetRunTag) + ) + ); + } + test_field_RunOptionsGetRunTag(); + fn test_field_RunOptionsSetTerminate() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsSetTerminate) as usize - ptr as usize + }, + 368usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsSetTerminate) + ) + ); + } + test_field_RunOptionsSetTerminate(); + fn test_field_RunOptionsUnsetTerminate() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunOptionsUnsetTerminate) as usize - ptr as usize + }, + 376usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunOptionsUnsetTerminate) + ) + ); + } + test_field_RunOptionsUnsetTerminate(); + fn test_field_CreateTensorAsOrtValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateTensorAsOrtValue) as usize - ptr as usize + }, + 384usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateTensorAsOrtValue) + ) + ); + } + test_field_CreateTensorAsOrtValue(); + fn test_field_CreateTensorWithDataAsOrtValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateTensorWithDataAsOrtValue) as usize - ptr as usize + }, + 392usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateTensorWithDataAsOrtValue) + ) + ); + } + test_field_CreateTensorWithDataAsOrtValue(); + fn test_field_IsTensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).IsTensor) as usize - ptr as usize + }, + 400usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(IsTensor) + ) + ); + } + test_field_IsTensor(); + fn test_field_GetTensorMutableData() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorMutableData) as usize - ptr as usize + }, + 408usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorMutableData) + ) + ); + } + test_field_GetTensorMutableData(); + fn test_field_FillStringTensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).FillStringTensor) as usize - ptr as usize + }, + 416usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(FillStringTensor) + ) + ); + } + test_field_FillStringTensor(); + fn test_field_GetStringTensorDataLength() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetStringTensorDataLength) as usize - ptr as usize + }, + 424usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetStringTensorDataLength) + ) + ); + } + test_field_GetStringTensorDataLength(); + fn test_field_GetStringTensorContent() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetStringTensorContent) as usize - ptr as usize + }, + 432usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetStringTensorContent) + ) + ); + } + test_field_GetStringTensorContent(); + fn test_field_CastTypeInfoToTensorInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CastTypeInfoToTensorInfo) as usize - ptr as usize + }, + 440usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CastTypeInfoToTensorInfo) + ) + ); + } + test_field_CastTypeInfoToTensorInfo(); + fn test_field_GetOnnxTypeFromTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetOnnxTypeFromTypeInfo) as usize - ptr as usize + }, + 448usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetOnnxTypeFromTypeInfo) + ) + ); + } + test_field_GetOnnxTypeFromTypeInfo(); + fn test_field_CreateTensorTypeAndShapeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateTensorTypeAndShapeInfo) as usize - ptr as usize + }, + 456usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateTensorTypeAndShapeInfo) + ) + ); + } + test_field_CreateTensorTypeAndShapeInfo(); + fn test_field_SetTensorElementType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetTensorElementType) as usize - ptr as usize + }, + 464usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetTensorElementType) + ) + ); + } + test_field_SetTensorElementType(); + fn test_field_SetDimensions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetDimensions) as usize - ptr as usize + }, + 472usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetDimensions) + ) + ); + } + test_field_SetDimensions(); + fn test_field_GetTensorElementType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorElementType) as usize - ptr as usize + }, + 480usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorElementType) + ) + ); + } + test_field_GetTensorElementType(); + fn test_field_GetDimensionsCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetDimensionsCount) as usize - ptr as usize + }, + 488usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetDimensionsCount) + ) + ); + } + test_field_GetDimensionsCount(); + fn test_field_GetDimensions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetDimensions) as usize - ptr as usize + }, + 496usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetDimensions) + ) + ); + } + test_field_GetDimensions(); + fn test_field_GetSymbolicDimensions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSymbolicDimensions) as usize - ptr as usize + }, + 504usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSymbolicDimensions) + ) + ); + } + test_field_GetSymbolicDimensions(); + fn test_field_GetTensorShapeElementCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorShapeElementCount) as usize - ptr as usize + }, + 512usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorShapeElementCount) + ) + ); + } + test_field_GetTensorShapeElementCount(); + fn test_field_GetTensorTypeAndShape() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorTypeAndShape) as usize - ptr as usize + }, + 520usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorTypeAndShape) + ) + ); + } + test_field_GetTensorTypeAndShape(); + fn test_field_GetTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTypeInfo) as usize - ptr as usize + }, + 528usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTypeInfo) + ) + ); + } + test_field_GetTypeInfo(); + fn test_field_GetValueType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetValueType) as usize - ptr as usize + }, + 536usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetValueType) + ) + ); + } + test_field_GetValueType(); + fn test_field_CreateMemoryInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateMemoryInfo) as usize - ptr as usize + }, + 544usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateMemoryInfo) + ) + ); + } + test_field_CreateMemoryInfo(); + fn test_field_CreateCpuMemoryInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateCpuMemoryInfo) as usize - ptr as usize + }, + 552usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateCpuMemoryInfo) + ) + ); + } + test_field_CreateCpuMemoryInfo(); + fn test_field_CompareMemoryInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CompareMemoryInfo) as usize - ptr as usize + }, + 560usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CompareMemoryInfo) + ) + ); + } + test_field_CompareMemoryInfo(); + fn test_field_MemoryInfoGetName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetName) as usize - ptr as usize + }, + 568usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetName) + ) + ); + } + test_field_MemoryInfoGetName(); + fn test_field_MemoryInfoGetId() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetId) as usize - ptr as usize + }, + 576usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetId) + ) + ); + } + test_field_MemoryInfoGetId(); + fn test_field_MemoryInfoGetMemType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetMemType) as usize - ptr as usize + }, + 584usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetMemType) + ) + ); + } + test_field_MemoryInfoGetMemType(); + fn test_field_MemoryInfoGetType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).MemoryInfoGetType) as usize - ptr as usize + }, + 592usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(MemoryInfoGetType) + ) + ); + } + test_field_MemoryInfoGetType(); + fn test_field_AllocatorAlloc() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AllocatorAlloc) as usize - ptr as usize + }, + 600usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AllocatorAlloc) + ) + ); + } + test_field_AllocatorAlloc(); + fn test_field_AllocatorFree() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AllocatorFree) as usize - ptr as usize + }, + 608usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AllocatorFree) + ) + ); + } + test_field_AllocatorFree(); + fn test_field_AllocatorGetInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AllocatorGetInfo) as usize - ptr as usize + }, + 616usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AllocatorGetInfo) + ) + ); + } + test_field_AllocatorGetInfo(); + fn test_field_GetAllocatorWithDefaultOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetAllocatorWithDefaultOptions) as usize - ptr as usize + }, + 624usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetAllocatorWithDefaultOptions) + ) + ); + } + test_field_GetAllocatorWithDefaultOptions(); + fn test_field_AddFreeDimensionOverride() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddFreeDimensionOverride) as usize - ptr as usize + }, + 632usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddFreeDimensionOverride) + ) + ); + } + test_field_AddFreeDimensionOverride(); + fn test_field_GetValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetValue) as usize - ptr as usize + }, + 640usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetValue) + ) + ); + } + test_field_GetValue(); + fn test_field_GetValueCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetValueCount) as usize - ptr as usize + }, + 648usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetValueCount) + ) + ); + } + test_field_GetValueCount(); + fn test_field_CreateValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateValue) as usize - ptr as usize + }, + 656usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateValue) + ) + ); + } + test_field_CreateValue(); + fn test_field_CreateOpaqueValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateOpaqueValue) as usize - ptr as usize + }, + 664usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateOpaqueValue) + ) + ); + } + test_field_CreateOpaqueValue(); + fn test_field_GetOpaqueValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetOpaqueValue) as usize - ptr as usize + }, + 672usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetOpaqueValue) + ) + ); + } + test_field_GetOpaqueValue(); + fn test_field_KernelInfoGetAttribute_float() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_float) as usize - ptr as usize + }, + 680usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_float) + ) + ); + } + test_field_KernelInfoGetAttribute_float(); + fn test_field_KernelInfoGetAttribute_int64() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_int64) as usize - ptr as usize + }, + 688usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_int64) + ) + ); + } + test_field_KernelInfoGetAttribute_int64(); + fn test_field_KernelInfoGetAttribute_string() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttribute_string) as usize - ptr as usize + }, + 696usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttribute_string) + ) + ); + } + test_field_KernelInfoGetAttribute_string(); + fn test_field_KernelContext_GetInputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetInputCount) as usize - ptr as usize + }, + 704usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetInputCount) + ) + ); + } + test_field_KernelContext_GetInputCount(); + fn test_field_KernelContext_GetOutputCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetOutputCount) as usize - ptr as usize + }, + 712usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetOutputCount) + ) + ); + } + test_field_KernelContext_GetOutputCount(); + fn test_field_KernelContext_GetInput() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetInput) as usize - ptr as usize + }, + 720usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetInput) + ) + ); + } + test_field_KernelContext_GetInput(); + fn test_field_KernelContext_GetOutput() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetOutput) as usize - ptr as usize + }, + 728usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetOutput) + ) + ); + } + test_field_KernelContext_GetOutput(); + fn test_field_ReleaseEnv() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseEnv) as usize - ptr as usize + }, + 736usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseEnv) + ) + ); + } + test_field_ReleaseEnv(); + fn test_field_ReleaseStatus() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseStatus) as usize - ptr as usize + }, + 744usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseStatus) + ) + ); + } + test_field_ReleaseStatus(); + fn test_field_ReleaseMemoryInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseMemoryInfo) as usize - ptr as usize + }, + 752usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseMemoryInfo) + ) + ); + } + test_field_ReleaseMemoryInfo(); + fn test_field_ReleaseSession() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseSession) as usize - ptr as usize + }, + 760usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseSession) + ) + ); + } + test_field_ReleaseSession(); + fn test_field_ReleaseValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseValue) as usize - ptr as usize + }, + 768usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseValue) + ) + ); + } + test_field_ReleaseValue(); + fn test_field_ReleaseRunOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseRunOptions) as usize - ptr as usize + }, + 776usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseRunOptions) + ) + ); + } + test_field_ReleaseRunOptions(); + fn test_field_ReleaseTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseTypeInfo) as usize - ptr as usize + }, + 784usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseTypeInfo) + ) + ); + } + test_field_ReleaseTypeInfo(); + fn test_field_ReleaseTensorTypeAndShapeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseTensorTypeAndShapeInfo) as usize - ptr as usize + }, + 792usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseTensorTypeAndShapeInfo) + ) + ); + } + test_field_ReleaseTensorTypeAndShapeInfo(); + fn test_field_ReleaseSessionOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseSessionOptions) as usize - ptr as usize + }, + 800usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseSessionOptions) + ) + ); + } + test_field_ReleaseSessionOptions(); + fn test_field_ReleaseCustomOpDomain() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseCustomOpDomain) as usize - ptr as usize + }, + 808usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseCustomOpDomain) + ) + ); + } + test_field_ReleaseCustomOpDomain(); + fn test_field_GetDenotationFromTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetDenotationFromTypeInfo) as usize - ptr as usize + }, + 816usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetDenotationFromTypeInfo) + ) + ); + } + test_field_GetDenotationFromTypeInfo(); + fn test_field_CastTypeInfoToMapTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CastTypeInfoToMapTypeInfo) as usize - ptr as usize + }, + 824usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CastTypeInfoToMapTypeInfo) + ) + ); + } + test_field_CastTypeInfoToMapTypeInfo(); + fn test_field_CastTypeInfoToSequenceTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CastTypeInfoToSequenceTypeInfo) as usize - ptr as usize + }, + 832usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CastTypeInfoToSequenceTypeInfo) + ) + ); + } + test_field_CastTypeInfoToSequenceTypeInfo(); + fn test_field_GetMapKeyType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetMapKeyType) as usize - ptr as usize + }, + 840usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetMapKeyType) + ) + ); + } + test_field_GetMapKeyType(); + fn test_field_GetMapValueType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetMapValueType) as usize - ptr as usize + }, + 848usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetMapValueType) + ) + ); + } + test_field_GetMapValueType(); + fn test_field_GetSequenceElementType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSequenceElementType) as usize - ptr as usize + }, + 856usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSequenceElementType) + ) + ); + } + test_field_GetSequenceElementType(); + fn test_field_ReleaseMapTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseMapTypeInfo) as usize - ptr as usize + }, + 864usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseMapTypeInfo) + ) + ); + } + test_field_ReleaseMapTypeInfo(); + fn test_field_ReleaseSequenceTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseSequenceTypeInfo) as usize - ptr as usize + }, + 872usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseSequenceTypeInfo) + ) + ); + } + test_field_ReleaseSequenceTypeInfo(); + fn test_field_SessionEndProfiling() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionEndProfiling) as usize - ptr as usize + }, + 880usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionEndProfiling) + ) + ); + } + test_field_SessionEndProfiling(); + fn test_field_SessionGetModelMetadata() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetModelMetadata) as usize - ptr as usize + }, + 888usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetModelMetadata) + ) + ); + } + test_field_SessionGetModelMetadata(); + fn test_field_ModelMetadataGetProducerName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetProducerName) as usize - ptr as usize + }, + 896usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetProducerName) + ) + ); + } + test_field_ModelMetadataGetProducerName(); + fn test_field_ModelMetadataGetGraphName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetGraphName) as usize - ptr as usize + }, + 904usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetGraphName) + ) + ); + } + test_field_ModelMetadataGetGraphName(); + fn test_field_ModelMetadataGetDomain() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetDomain) as usize - ptr as usize + }, + 912usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetDomain) + ) + ); + } + test_field_ModelMetadataGetDomain(); + fn test_field_ModelMetadataGetDescription() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetDescription) as usize - ptr as usize + }, + 920usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetDescription) + ) + ); + } + test_field_ModelMetadataGetDescription(); + fn test_field_ModelMetadataLookupCustomMetadataMap() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataLookupCustomMetadataMap) as usize + - ptr as usize + }, + 928usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataLookupCustomMetadataMap) + ) + ); + } + test_field_ModelMetadataLookupCustomMetadataMap(); + fn test_field_ModelMetadataGetVersion() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetVersion) as usize - ptr as usize + }, + 936usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetVersion) + ) + ); + } + test_field_ModelMetadataGetVersion(); + fn test_field_ReleaseModelMetadata() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseModelMetadata) as usize - ptr as usize + }, + 944usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseModelMetadata) + ) + ); + } + test_field_ReleaseModelMetadata(); + fn test_field_CreateEnvWithGlobalThreadPools() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateEnvWithGlobalThreadPools) as usize - ptr as usize + }, + 952usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateEnvWithGlobalThreadPools) + ) + ); + } + test_field_CreateEnvWithGlobalThreadPools(); + fn test_field_DisablePerSessionThreads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).DisablePerSessionThreads) as usize - ptr as usize + }, + 960usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(DisablePerSessionThreads) + ) + ); + } + test_field_DisablePerSessionThreads(); + fn test_field_CreateThreadingOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateThreadingOptions) as usize - ptr as usize + }, + 968usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateThreadingOptions) + ) + ); + } + test_field_CreateThreadingOptions(); + fn test_field_ReleaseThreadingOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseThreadingOptions) as usize - ptr as usize + }, + 976usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseThreadingOptions) + ) + ); + } + test_field_ReleaseThreadingOptions(); + fn test_field_ModelMetadataGetCustomMetadataMapKeys() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetCustomMetadataMapKeys) as usize + - ptr as usize + }, + 984usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetCustomMetadataMapKeys) + ) + ); + } + test_field_ModelMetadataGetCustomMetadataMapKeys(); + fn test_field_AddFreeDimensionOverrideByName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddFreeDimensionOverrideByName) as usize - ptr as usize + }, + 992usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddFreeDimensionOverrideByName) + ) + ); + } + test_field_AddFreeDimensionOverrideByName(); + fn test_field_GetAvailableProviders() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetAvailableProviders) as usize - ptr as usize + }, + 1000usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetAvailableProviders) + ) + ); + } + test_field_GetAvailableProviders(); + fn test_field_ReleaseAvailableProviders() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseAvailableProviders) as usize - ptr as usize + }, + 1008usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseAvailableProviders) + ) + ); + } + test_field_ReleaseAvailableProviders(); + fn test_field_GetStringTensorElementLength() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetStringTensorElementLength) as usize - ptr as usize + }, + 1016usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetStringTensorElementLength) + ) + ); + } + test_field_GetStringTensorElementLength(); + fn test_field_GetStringTensorElement() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetStringTensorElement) as usize - ptr as usize + }, + 1024usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetStringTensorElement) + ) + ); + } + test_field_GetStringTensorElement(); + fn test_field_FillStringTensorElement() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).FillStringTensorElement) as usize - ptr as usize + }, + 1032usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(FillStringTensorElement) + ) + ); + } + test_field_FillStringTensorElement(); + fn test_field_AddSessionConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddSessionConfigEntry) as usize - ptr as usize + }, + 1040usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddSessionConfigEntry) + ) + ); + } + test_field_AddSessionConfigEntry(); + fn test_field_CreateAllocator() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateAllocator) as usize - ptr as usize + }, + 1048usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateAllocator) + ) + ); + } + test_field_CreateAllocator(); + fn test_field_ReleaseAllocator() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseAllocator) as usize - ptr as usize + }, + 1056usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseAllocator) + ) + ); + } + test_field_ReleaseAllocator(); + fn test_field_RunWithBinding() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunWithBinding) as usize - ptr as usize + }, + 1064usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunWithBinding) + ) + ); + } + test_field_RunWithBinding(); + fn test_field_CreateIoBinding() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateIoBinding) as usize - ptr as usize + }, + 1072usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateIoBinding) + ) + ); + } + test_field_CreateIoBinding(); + fn test_field_ReleaseIoBinding() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseIoBinding) as usize - ptr as usize + }, + 1080usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseIoBinding) + ) + ); + } + test_field_ReleaseIoBinding(); + fn test_field_BindInput() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).BindInput) as usize - ptr as usize + }, + 1088usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(BindInput) + ) + ); + } + test_field_BindInput(); + fn test_field_BindOutput() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).BindOutput) as usize - ptr as usize + }, + 1096usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(BindOutput) + ) + ); + } + test_field_BindOutput(); + fn test_field_BindOutputToDevice() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).BindOutputToDevice) as usize - ptr as usize + }, + 1104usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(BindOutputToDevice) + ) + ); + } + test_field_BindOutputToDevice(); + fn test_field_GetBoundOutputNames() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetBoundOutputNames) as usize - ptr as usize + }, + 1112usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetBoundOutputNames) + ) + ); + } + test_field_GetBoundOutputNames(); + fn test_field_GetBoundOutputValues() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetBoundOutputValues) as usize - ptr as usize + }, + 1120usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetBoundOutputValues) + ) + ); + } + test_field_GetBoundOutputValues(); + fn test_field_ClearBoundInputs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ClearBoundInputs) as usize - ptr as usize + }, + 1128usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ClearBoundInputs) + ) + ); + } + test_field_ClearBoundInputs(); + fn test_field_ClearBoundOutputs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ClearBoundOutputs) as usize - ptr as usize + }, + 1136usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ClearBoundOutputs) + ) + ); + } + test_field_ClearBoundOutputs(); + fn test_field_TensorAt() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).TensorAt) as usize - ptr as usize + }, + 1144usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(TensorAt) + ) + ); + } + test_field_TensorAt(); + fn test_field_CreateAndRegisterAllocator() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateAndRegisterAllocator) as usize - ptr as usize + }, + 1152usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateAndRegisterAllocator) + ) + ); + } + test_field_CreateAndRegisterAllocator(); + fn test_field_SetLanguageProjection() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetLanguageProjection) as usize - ptr as usize + }, + 1160usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetLanguageProjection) + ) + ); + } + test_field_SetLanguageProjection(); + fn test_field_SessionGetProfilingStartTimeNs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionGetProfilingStartTimeNs) as usize - ptr as usize + }, + 1168usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionGetProfilingStartTimeNs) + ) + ); + } + test_field_SessionGetProfilingStartTimeNs(); + fn test_field_SetGlobalIntraOpNumThreads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalIntraOpNumThreads) as usize - ptr as usize + }, + 1176usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalIntraOpNumThreads) + ) + ); + } + test_field_SetGlobalIntraOpNumThreads(); + fn test_field_SetGlobalInterOpNumThreads() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalInterOpNumThreads) as usize - ptr as usize + }, + 1184usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalInterOpNumThreads) + ) + ); + } + test_field_SetGlobalInterOpNumThreads(); + fn test_field_SetGlobalSpinControl() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalSpinControl) as usize - ptr as usize + }, + 1192usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalSpinControl) + ) + ); + } + test_field_SetGlobalSpinControl(); + fn test_field_AddInitializer() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddInitializer) as usize - ptr as usize + }, + 1200usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddInitializer) + ) + ); + } + test_field_AddInitializer(); + fn test_field_CreateEnvWithCustomLoggerAndGlobalThreadPools() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateEnvWithCustomLoggerAndGlobalThreadPools) as usize + - ptr as usize + }, + 1208usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateEnvWithCustomLoggerAndGlobalThreadPools) + ) + ); + } + test_field_CreateEnvWithCustomLoggerAndGlobalThreadPools(); + fn test_field_SessionOptionsAppendExecutionProvider_CUDA() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_CUDA) as usize + - ptr as usize + }, + 1216usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_CUDA) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_CUDA(); + fn test_field_SessionOptionsAppendExecutionProvider_ROCM() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_ROCM) as usize + - ptr as usize + }, + 1224usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_ROCM) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_ROCM(); + fn test_field_SessionOptionsAppendExecutionProvider_OpenVINO() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_OpenVINO) as usize + - ptr as usize + }, + 1232usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_OpenVINO) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_OpenVINO(); + fn test_field_SetGlobalDenormalAsZero() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalDenormalAsZero) as usize - ptr as usize + }, + 1240usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalDenormalAsZero) + ) + ); + } + test_field_SetGlobalDenormalAsZero(); + fn test_field_CreateArenaCfg() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateArenaCfg) as usize - ptr as usize + }, + 1248usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateArenaCfg) + ) + ); + } + test_field_CreateArenaCfg(); + fn test_field_ReleaseArenaCfg() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseArenaCfg) as usize - ptr as usize + }, + 1256usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseArenaCfg) + ) + ); + } + test_field_ReleaseArenaCfg(); + fn test_field_ModelMetadataGetGraphDescription() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ModelMetadataGetGraphDescription) as usize + - ptr as usize + }, + 1264usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ModelMetadataGetGraphDescription) + ) + ); + } + test_field_ModelMetadataGetGraphDescription(); + fn test_field_SessionOptionsAppendExecutionProvider_TensorRT() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_TensorRT) as usize + - ptr as usize + }, + 1272usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_TensorRT) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_TensorRT(); + fn test_field_SetCurrentGpuDeviceId() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetCurrentGpuDeviceId) as usize - ptr as usize + }, + 1280usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetCurrentGpuDeviceId) + ) + ); + } + test_field_SetCurrentGpuDeviceId(); + fn test_field_GetCurrentGpuDeviceId() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetCurrentGpuDeviceId) as usize - ptr as usize + }, + 1288usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetCurrentGpuDeviceId) + ) + ); + } + test_field_GetCurrentGpuDeviceId(); + fn test_field_KernelInfoGetAttributeArray_float() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttributeArray_float) as usize + - ptr as usize + }, + 1296usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttributeArray_float) + ) + ); + } + test_field_KernelInfoGetAttributeArray_float(); + fn test_field_KernelInfoGetAttributeArray_int64() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetAttributeArray_int64) as usize + - ptr as usize + }, + 1304usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetAttributeArray_int64) + ) + ); + } + test_field_KernelInfoGetAttributeArray_int64(); + fn test_field_CreateArenaCfgV2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateArenaCfgV2) as usize - ptr as usize + }, + 1312usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateArenaCfgV2) + ) + ); + } + test_field_CreateArenaCfgV2(); + fn test_field_AddRunConfigEntry() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddRunConfigEntry) as usize - ptr as usize + }, + 1320usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddRunConfigEntry) + ) + ); + } + test_field_AddRunConfigEntry(); + fn test_field_CreatePrepackedWeightsContainer() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreatePrepackedWeightsContainer) as usize - ptr as usize + }, + 1328usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreatePrepackedWeightsContainer) + ) + ); + } + test_field_CreatePrepackedWeightsContainer(); + fn test_field_ReleasePrepackedWeightsContainer() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleasePrepackedWeightsContainer) as usize + - ptr as usize + }, + 1336usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleasePrepackedWeightsContainer) + ) + ); + } + test_field_ReleasePrepackedWeightsContainer(); + fn test_field_CreateSessionWithPrepackedWeightsContainer() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSessionWithPrepackedWeightsContainer) as usize + - ptr as usize + }, + 1344usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSessionWithPrepackedWeightsContainer) + ) + ); + } + test_field_CreateSessionWithPrepackedWeightsContainer(); + fn test_field_CreateSessionFromArrayWithPrepackedWeightsContainer() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSessionFromArrayWithPrepackedWeightsContainer) + as usize + - ptr as usize + }, + 1352usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSessionFromArrayWithPrepackedWeightsContainer) + ) + ); + } + test_field_CreateSessionFromArrayWithPrepackedWeightsContainer(); + fn test_field_SessionOptionsAppendExecutionProvider_TensorRT_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_TensorRT_V2) + as usize + - ptr as usize + }, + 1360usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_TensorRT_V2) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_TensorRT_V2(); + fn test_field_CreateTensorRTProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateTensorRTProviderOptions) as usize - ptr as usize + }, + 1368usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateTensorRTProviderOptions) + ) + ); + } + test_field_CreateTensorRTProviderOptions(); + fn test_field_UpdateTensorRTProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateTensorRTProviderOptions) as usize - ptr as usize + }, + 1376usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateTensorRTProviderOptions) + ) + ); + } + test_field_UpdateTensorRTProviderOptions(); + fn test_field_GetTensorRTProviderOptionsAsString() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorRTProviderOptionsAsString) as usize + - ptr as usize + }, + 1384usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorRTProviderOptionsAsString) + ) + ); + } + test_field_GetTensorRTProviderOptionsAsString(); + fn test_field_ReleaseTensorRTProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseTensorRTProviderOptions) as usize - ptr as usize + }, + 1392usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseTensorRTProviderOptions) + ) + ); + } + test_field_ReleaseTensorRTProviderOptions(); + fn test_field_EnableOrtCustomOps() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).EnableOrtCustomOps) as usize - ptr as usize + }, + 1400usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(EnableOrtCustomOps) + ) + ); + } + test_field_EnableOrtCustomOps(); + fn test_field_RegisterAllocator() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RegisterAllocator) as usize - ptr as usize + }, + 1408usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RegisterAllocator) + ) + ); + } + test_field_RegisterAllocator(); + fn test_field_UnregisterAllocator() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UnregisterAllocator) as usize - ptr as usize + }, + 1416usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UnregisterAllocator) + ) + ); + } + test_field_UnregisterAllocator(); + fn test_field_IsSparseTensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).IsSparseTensor) as usize - ptr as usize + }, + 1424usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(IsSparseTensor) + ) + ); + } + test_field_IsSparseTensor(); + fn test_field_CreateSparseTensorAsOrtValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSparseTensorAsOrtValue) as usize - ptr as usize + }, + 1432usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSparseTensorAsOrtValue) + ) + ); + } + test_field_CreateSparseTensorAsOrtValue(); + fn test_field_FillSparseTensorCoo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).FillSparseTensorCoo) as usize - ptr as usize + }, + 1440usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(FillSparseTensorCoo) + ) + ); + } + test_field_FillSparseTensorCoo(); + fn test_field_FillSparseTensorCsr() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).FillSparseTensorCsr) as usize - ptr as usize + }, + 1448usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(FillSparseTensorCsr) + ) + ); + } + test_field_FillSparseTensorCsr(); + fn test_field_FillSparseTensorBlockSparse() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).FillSparseTensorBlockSparse) as usize - ptr as usize + }, + 1456usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(FillSparseTensorBlockSparse) + ) + ); + } + test_field_FillSparseTensorBlockSparse(); + fn test_field_CreateSparseTensorWithValuesAsOrtValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateSparseTensorWithValuesAsOrtValue) as usize + - ptr as usize + }, + 1464usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateSparseTensorWithValuesAsOrtValue) + ) + ); + } + test_field_CreateSparseTensorWithValuesAsOrtValue(); + fn test_field_UseCooIndices() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UseCooIndices) as usize - ptr as usize + }, + 1472usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UseCooIndices) + ) + ); + } + test_field_UseCooIndices(); + fn test_field_UseCsrIndices() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UseCsrIndices) as usize - ptr as usize + }, + 1480usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UseCsrIndices) + ) + ); + } + test_field_UseCsrIndices(); + fn test_field_UseBlockSparseIndices() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UseBlockSparseIndices) as usize - ptr as usize + }, + 1488usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UseBlockSparseIndices) + ) + ); + } + test_field_UseBlockSparseIndices(); + fn test_field_GetSparseTensorFormat() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSparseTensorFormat) as usize - ptr as usize + }, + 1496usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSparseTensorFormat) + ) + ); + } + test_field_GetSparseTensorFormat(); + fn test_field_GetSparseTensorValuesTypeAndShape() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSparseTensorValuesTypeAndShape) as usize + - ptr as usize + }, + 1504usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSparseTensorValuesTypeAndShape) + ) + ); + } + test_field_GetSparseTensorValuesTypeAndShape(); + fn test_field_GetSparseTensorValues() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSparseTensorValues) as usize - ptr as usize + }, + 1512usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSparseTensorValues) + ) + ); + } + test_field_GetSparseTensorValues(); + fn test_field_GetSparseTensorIndicesTypeShape() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSparseTensorIndicesTypeShape) as usize - ptr as usize + }, + 1520usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSparseTensorIndicesTypeShape) + ) + ); + } + test_field_GetSparseTensorIndicesTypeShape(); + fn test_field_GetSparseTensorIndices() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetSparseTensorIndices) as usize - ptr as usize + }, + 1528usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetSparseTensorIndices) + ) + ); + } + test_field_GetSparseTensorIndices(); + fn test_field_HasValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).HasValue) as usize - ptr as usize + }, + 1536usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(HasValue) + ) + ); + } + test_field_HasValue(); + fn test_field_KernelContext_GetGPUComputeStream() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetGPUComputeStream) as usize + - ptr as usize + }, + 1544usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetGPUComputeStream) + ) + ); + } + test_field_KernelContext_GetGPUComputeStream(); + fn test_field_GetTensorMemoryInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorMemoryInfo) as usize - ptr as usize + }, + 1552usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorMemoryInfo) + ) + ); + } + test_field_GetTensorMemoryInfo(); + fn test_field_GetExecutionProviderApi() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetExecutionProviderApi) as usize - ptr as usize + }, + 1560usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetExecutionProviderApi) + ) + ); + } + test_field_GetExecutionProviderApi(); + fn test_field_SessionOptionsSetCustomCreateThreadFn() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsSetCustomCreateThreadFn) as usize + - ptr as usize + }, + 1568usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsSetCustomCreateThreadFn) + ) + ); + } + test_field_SessionOptionsSetCustomCreateThreadFn(); + fn test_field_SessionOptionsSetCustomThreadCreationOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsSetCustomThreadCreationOptions) as usize + - ptr as usize + }, + 1576usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsSetCustomThreadCreationOptions) + ) + ); + } + test_field_SessionOptionsSetCustomThreadCreationOptions(); + fn test_field_SessionOptionsSetCustomJoinThreadFn() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsSetCustomJoinThreadFn) as usize + - ptr as usize + }, + 1584usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsSetCustomJoinThreadFn) + ) + ); + } + test_field_SessionOptionsSetCustomJoinThreadFn(); + fn test_field_SetGlobalCustomCreateThreadFn() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalCustomCreateThreadFn) as usize - ptr as usize + }, + 1592usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalCustomCreateThreadFn) + ) + ); + } + test_field_SetGlobalCustomCreateThreadFn(); + fn test_field_SetGlobalCustomThreadCreationOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalCustomThreadCreationOptions) as usize + - ptr as usize + }, + 1600usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalCustomThreadCreationOptions) + ) + ); + } + test_field_SetGlobalCustomThreadCreationOptions(); + fn test_field_SetGlobalCustomJoinThreadFn() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SetGlobalCustomJoinThreadFn) as usize - ptr as usize + }, + 1608usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SetGlobalCustomJoinThreadFn) + ) + ); + } + test_field_SetGlobalCustomJoinThreadFn(); + fn test_field_SynchronizeBoundInputs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SynchronizeBoundInputs) as usize - ptr as usize + }, + 1616usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SynchronizeBoundInputs) + ) + ); + } + test_field_SynchronizeBoundInputs(); + fn test_field_SynchronizeBoundOutputs() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SynchronizeBoundOutputs) as usize - ptr as usize + }, + 1624usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SynchronizeBoundOutputs) + ) + ); + } + test_field_SynchronizeBoundOutputs(); + fn test_field_SessionOptionsAppendExecutionProvider_CUDA_V2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_CUDA_V2) as usize + - ptr as usize + }, + 1632usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_CUDA_V2) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_CUDA_V2(); + fn test_field_CreateCUDAProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateCUDAProviderOptions) as usize - ptr as usize + }, + 1640usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateCUDAProviderOptions) + ) + ); + } + test_field_CreateCUDAProviderOptions(); + fn test_field_UpdateCUDAProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateCUDAProviderOptions) as usize - ptr as usize + }, + 1648usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateCUDAProviderOptions) + ) + ); + } + test_field_UpdateCUDAProviderOptions(); + fn test_field_GetCUDAProviderOptionsAsString() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetCUDAProviderOptionsAsString) as usize - ptr as usize + }, + 1656usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetCUDAProviderOptionsAsString) + ) + ); + } + test_field_GetCUDAProviderOptionsAsString(); + fn test_field_ReleaseCUDAProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseCUDAProviderOptions) as usize - ptr as usize + }, + 1664usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseCUDAProviderOptions) + ) + ); + } + test_field_ReleaseCUDAProviderOptions(); + fn test_field_SessionOptionsAppendExecutionProvider_MIGraphX() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_MIGraphX) as usize + - ptr as usize + }, + 1672usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_MIGraphX) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_MIGraphX(); + fn test_field_AddExternalInitializers() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).AddExternalInitializers) as usize - ptr as usize + }, + 1680usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(AddExternalInitializers) + ) + ); + } + test_field_AddExternalInitializers(); + fn test_field_CreateOpAttr() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateOpAttr) as usize - ptr as usize + }, + 1688usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateOpAttr) + ) + ); + } + test_field_CreateOpAttr(); + fn test_field_ReleaseOpAttr() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseOpAttr) as usize - ptr as usize + }, + 1696usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseOpAttr) + ) + ); + } + test_field_ReleaseOpAttr(); + fn test_field_CreateOp() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateOp) as usize - ptr as usize + }, + 1704usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateOp) + ) + ); + } + test_field_CreateOp(); + fn test_field_InvokeOp() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).InvokeOp) as usize - ptr as usize + }, + 1712usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(InvokeOp) + ) + ); + } + test_field_InvokeOp(); + fn test_field_ReleaseOp() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseOp) as usize - ptr as usize + }, + 1720usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseOp) + ) + ); + } + test_field_ReleaseOp(); + fn test_field_SessionOptionsAppendExecutionProvider() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider) as usize + - ptr as usize + }, + 1728usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider(); + fn test_field_CopyKernelInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CopyKernelInfo) as usize - ptr as usize + }, + 1736usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CopyKernelInfo) + ) + ); + } + test_field_CopyKernelInfo(); + fn test_field_ReleaseKernelInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseKernelInfo) as usize - ptr as usize + }, + 1744usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseKernelInfo) + ) + ); + } + test_field_ReleaseKernelInfo(); + fn test_field_GetTrainingApi() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTrainingApi) as usize - ptr as usize + }, + 1752usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTrainingApi) + ) + ); + } + test_field_GetTrainingApi(); + fn test_field_SessionOptionsAppendExecutionProvider_CANN() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_CANN) as usize + - ptr as usize + }, + 1760usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_CANN) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_CANN(); + fn test_field_CreateCANNProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateCANNProviderOptions) as usize - ptr as usize + }, + 1768usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateCANNProviderOptions) + ) + ); + } + test_field_CreateCANNProviderOptions(); + fn test_field_UpdateCANNProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateCANNProviderOptions) as usize - ptr as usize + }, + 1776usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateCANNProviderOptions) + ) + ); + } + test_field_UpdateCANNProviderOptions(); + fn test_field_GetCANNProviderOptionsAsString() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetCANNProviderOptionsAsString) as usize - ptr as usize + }, + 1784usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetCANNProviderOptionsAsString) + ) + ); + } + test_field_GetCANNProviderOptionsAsString(); + fn test_field_ReleaseCANNProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseCANNProviderOptions) as usize - ptr as usize + }, + 1792usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseCANNProviderOptions) + ) + ); + } + test_field_ReleaseCANNProviderOptions(); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtCustomOpInputOutputCharacteristic { + INPUT_OUTPUT_REQUIRED = 0, + INPUT_OUTPUT_OPTIONAL = 1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCustomOp { + pub version: u32, + pub CreateKernel: ::std::option::Option< + unsafe extern "C" fn( + op: *const OrtCustomOp, + api: *const OrtApi, + info: *const OrtKernelInfo, + ) -> *mut ::std::os::raw::c_void, + >, + pub GetName: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> *const ::std::os::raw::c_char, + >, + pub GetExecutionProviderType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> *const ::std::os::raw::c_char, + >, + pub GetInputType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> ONNXTensorElementDataType, + >, + pub GetInputTypeCount: + ::std::option::Option usize>, + pub GetOutputType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> ONNXTensorElementDataType, + >, + pub GetOutputTypeCount: + ::std::option::Option usize>, + pub KernelCompute: ::std::option::Option< + unsafe extern "C" fn( + op_kernel: *mut ::std::os::raw::c_void, + context: *mut OrtKernelContext, + ), + >, + pub KernelDestroy: + ::std::option::Option, + pub GetInputCharacteristic: ::std::option::Option< + unsafe extern "C" fn( + op: *const OrtCustomOp, + index: usize, + ) -> OrtCustomOpInputOutputCharacteristic, + >, + pub GetOutputCharacteristic: ::std::option::Option< + unsafe extern "C" fn( + op: *const OrtCustomOp, + index: usize, + ) -> OrtCustomOpInputOutputCharacteristic, + >, +} +#[test] +fn bindgen_test_layout_OrtCustomOp() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(OrtCustomOp)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(OrtCustomOp)) + ); + fn test_field_version() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(version) + ) + ); + } + test_field_version(); + fn test_field_CreateKernel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateKernel) as usize - ptr as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(CreateKernel) + ) + ); + } + test_field_CreateKernel(); + fn test_field_GetName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetName) as usize - ptr as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetName) + ) + ); + } + test_field_GetName(); + fn test_field_GetExecutionProviderType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetExecutionProviderType) as usize - ptr as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetExecutionProviderType) + ) + ); + } + test_field_GetExecutionProviderType(); + fn test_field_GetInputType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputType) as usize - ptr as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputType) + ) + ); + } + test_field_GetInputType(); + fn test_field_GetInputTypeCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputTypeCount) as usize - ptr as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputTypeCount) + ) + ); + } + test_field_GetInputTypeCount(); + fn test_field_GetOutputType() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetOutputType) as usize - ptr as usize + }, + 48usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetOutputType) + ) + ); + } + test_field_GetOutputType(); + fn test_field_GetOutputTypeCount() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetOutputTypeCount) as usize - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetOutputTypeCount) + ) + ); + } + test_field_GetOutputTypeCount(); + fn test_field_KernelCompute() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelCompute) as usize - ptr as usize + }, + 64usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(KernelCompute) + ) + ); + } + test_field_KernelCompute(); + fn test_field_KernelDestroy() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelDestroy) as usize - ptr as usize + }, + 72usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(KernelDestroy) + ) + ); + } + test_field_KernelDestroy(); + fn test_field_GetInputCharacteristic() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetInputCharacteristic) as usize - ptr as usize + }, + 80usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetInputCharacteristic) + ) + ); + } + test_field_GetInputCharacteristic(); + fn test_field_GetOutputCharacteristic() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetOutputCharacteristic) as usize - ptr as usize + }, + 88usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(GetOutputCharacteristic) + ) + ); + } + test_field_GetOutputCharacteristic(); +} +extern "C" { + pub fn OrtSessionOptionsAppendExecutionProvider_CUDA( + options: *mut OrtSessionOptions, + device_id: ::std::os::raw::c_int, + ) -> OrtStatusPtr; +} +extern "C" { + pub fn OrtSessionOptionsAppendExecutionProvider_MIGraphX( + options: *mut OrtSessionOptions, + device_id: ::std::os::raw::c_int, + ) -> OrtStatusPtr; +} From adc9201f78234b856b6a5e9181ee9ee6df390010 Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Mon, 3 Apr 2023 23:50:14 +0900 Subject: [PATCH 13/21] add x86_64-apple-ios binding --- onnxruntime-sys/src/generated/bindings.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/onnxruntime-sys/src/generated/bindings.rs b/onnxruntime-sys/src/generated/bindings.rs index 6fc4ba1c..86219a80 100644 --- a/onnxruntime-sys/src/generated/bindings.rs +++ b/onnxruntime-sys/src/generated/bindings.rs @@ -34,6 +34,12 @@ include!(concat!( "/src/generated/ios/aarch64/bindings.rs" )); +#[cfg(all(target_os = "ios", target_arch = "x86_64"))] +include!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/src/generated/ios/x86_64/bindings.rs" +)); + #[cfg(all(target_os = "windows", target_arch = "x86"))] include!(concat!( env!("CARGO_MANIFEST_DIR"), From 082ef93754364f3bf3177ddbd1727743c82310c9 Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Sun, 9 Apr 2023 19:30:50 +0900 Subject: [PATCH 14/21] use prebuild instead of compile strategy --- .github/actions/auto_gen_bind_pr/action.yaml | 4 - onnxruntime-sys/build.rs | 140 ++++--------------- 2 files changed, 25 insertions(+), 119 deletions(-) diff --git a/.github/actions/auto_gen_bind_pr/action.yaml b/.github/actions/auto_gen_bind_pr/action.yaml index 0a5e5890..4ac7bfbd 100644 --- a/.github/actions/auto_gen_bind_pr/action.yaml +++ b/.github/actions/auto_gen_bind_pr/action.yaml @@ -33,10 +33,6 @@ runs: - uses: actions-rs/toolchain@v1 with: toolchain: stable - - name: Set env for iOS build - if: inputs.triple == 'aarch64-apple-ios' || inputs.triple == 'aarch64-apple-ios-sim' || inputs.triple == 'x86_64-apple-ios' - shell: bash - run: echo "ORT_STRATEGY=compile" >> "$GITHUB_ENV" - name: install triple run: rustup target add ${{ inputs.triple }} shell: bash diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 33efb6a0..e6d5797e 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -24,6 +24,10 @@ const ORT_RELEASE_BASE_URL: &str = "https://github.com/microsoft/onnxruntime/rel const ORT_MAVEN_RELEASE_BASE_URL: &str = "https://repo1.maven.org/maven2/com/microsoft/onnxruntime/onnxruntime-android"; +/// Base Url from which to download ios pre-build releases/ +const ORT_IOS_RELEASE_BASE_URL: &str = + "https://github.com/VOICEVOX/onnxruntime-builder/releases/download"; + /// onnxruntime repository/ const ORT_REPOSITORY_URL: &str = "https://github.com/microsoft/onnxruntime.git"; @@ -400,7 +404,7 @@ impl Os { Os::Linux => "tgz", Os::MacOs => "tgz", Os::Android => "aar", - Os::IOs => "zip", + Os::IOs => "tgz", } } } @@ -501,6 +505,21 @@ impl OnnxPrebuiltArchive for Triplet { "x64", self.accelerator.as_onnx_str(), )), + // onnxruntime-ios-arm64-cpu-v1.8.1.tgz + (Os::IOs, Architecture::Arm64, Accelerator::None) + | (Os::IOs, Architecture::X86_64, Accelerator::None) => { + let arch = if env::var("CARGO_BUILD_TARGET").unwrap().ends_with("sim") { + format!("{}-sim", self.os.as_onnx_str()) + } else { + format!("{}", self.os.as_onnx_str()) + }; + Cow::from(format!( + "{}-{}-cpu-v{}", + self.os.as_onnx_str(), + arch, + ORT_VERSION, + )) + } _ => { panic!( "Unsupported prebuilt triplet: {:?}, {:?}, {:?}. Please use {}=system and {}=/path/to/onnxruntime", @@ -533,6 +552,10 @@ fn prebuilt_archive_url() -> (PathBuf, String) { ORT_VERSION, TRIPLET.os.archive_extension() ), + Os::IOs | Os::IOsSimulator => format!( + "{}/v{}/{}", + ORT_IOS_RELEASE_BASE_URL, ORT_VERSION, prebuilt_archive + ), _ => format!( "{}/v{}/{}", ORT_RELEASE_BASE_URL, ORT_VERSION, prebuilt_archive @@ -611,120 +634,7 @@ fn prepare_libort_dir() -> PathBuf { ); } }), - Ok("compile") => prepare_libort_dir_compiled(), + Ok("compile") => unimplemented!(), _ => panic!("Unknown value for {:?}", ORT_ENV_STRATEGY), } } - -fn prepare_libort_dir_compiled() -> PathBuf { - // Compile is only support iOS currently. - - if !matches!(TRIPLET.os, Os::IOs) { - panic!("Compile strategy is only support iOS currently"); - } - - let is_simulator = env::var("TARGET").unwrap().ends_with("sim") - || env::var("TARGET").unwrap().starts_with("x86_64"); - let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); - let onnxruntime_dir = out_dir.join("onnxruntime"); - let build_dir = onnxruntime_dir.join("build"); - let extract_dir = out_dir.join(format!("{}_{}_cpu", ORT_PREBUILT_EXTRACT_DIR, ORT_VERSION)); - // Clone microsoft/onnxruntime - let repo = match Repository::clone(ORT_REPOSITORY_URL, &onnxruntime_dir) { - Ok(repo) => repo, - Err(e) => panic!("Failed to clone onnxruntime: {}", e), - }; - // checkout commit annotated by tag - let reference = format!("refs/tags/v{}", ORT_VERSION); - let reference = match repo.find_reference(&reference) { - Ok(reference) => reference, - Err(e) => panic!("Failed to find tag v{}: {}", ORT_VERSION, e), - }; - repo.set_head(reference.name().unwrap()).unwrap(); - repo.checkout_head(Some(&mut CheckoutBuilder::new().force())) - .unwrap(); - - // build onnxruntime - let build_script = onnxruntime_dir.join("build.sh"); - let ios_sysroot = if is_simulator { - "iphonesimulator" - } else { - "iphoneos" - }; - let arch = if matches!(TRIPLET.arch, Architecture::Arm64) { - "arm64" - } else { - "x86_64" - }; - let status = Command::new(build_script) - .args([ - "--config", - "Release", - "--build_dir", - build_dir.to_str().unwrap(), - "--skip_tests", - "--parallel", - "--build_shared_lib", - "--use_xcode", - "--ios", - "--ios_sysroot", - ios_sysroot, - "--osx_arch", - arch, - "--apple_deploy_target", - IOS_MINIMAL_DEPLOY_TARGET, - ]) - .status() - .expect("Failed to execute onnxruntime build process"); - if !status.success() { - panic!("Failed to build onnxruntime: {:?}", status.code()); - } - - // get commit id for copy files - let commit = match reference.peel_to_commit() { - Ok(commit) => commit, - Err(e) => panic!("Failed to peel HEAD: {}", e), - }; - let commit_id = commit.id(); - - // copy files - let copy_script = onnxruntime_dir - .join("tools") - .join("ci_build") - .join("github") - .join("linux") - .join("copy_strip_binary.sh"); - let os = if is_simulator { "ios-sim" } else { "ios" }; - let artifact_name = format!("onnxruntime-{}-{}", os, arch); - - let status = Command::new(copy_script) - .args([ - "-r", - build_dir.to_str().unwrap(), - "-a", - &artifact_name, - "-l", - (format!("libonnxruntime.{}.dylib", ORT_VERSION).as_str()), - "-c", - (format!("Release/Release-{}", ios_sysroot).as_str()), - "-s", - onnxruntime_dir.to_str().unwrap(), - "-t", - &commit_id.to_string(), - ]) - .status() - .expect("Failed to execute copy process"); - if !status.success() { - panic!("Failed to copy onnxruntime: {:?}", status.code().unwrap()); - } - - // move artifact directory - fs::create_dir_all(&extract_dir).unwrap(); - fs::rename( - build_dir.join(&artifact_name), - extract_dir.join(&artifact_name), - ) - .unwrap(); - - extract_dir.join(artifact_name) -} From facd505007d6c7bc3231e6eb4f95db465fa8c6df Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Sun, 9 Apr 2023 22:03:11 +0900 Subject: [PATCH 15/21] remove unused simulator os --- onnxruntime-sys/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index e6d5797e..103cdc0a 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -552,7 +552,7 @@ fn prebuilt_archive_url() -> (PathBuf, String) { ORT_VERSION, TRIPLET.os.archive_extension() ), - Os::IOs | Os::IOsSimulator => format!( + Os::IOs => format!( "{}/v{}/{}", ORT_IOS_RELEASE_BASE_URL, ORT_VERSION, prebuilt_archive ), From 652a640b10c7f70333ab5fe9a9e838eaa44bb03c Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Sun, 9 Apr 2023 22:19:20 +0900 Subject: [PATCH 16/21] remove unused library --- onnxruntime-sys/Cargo.toml | 1 - onnxruntime-sys/build.rs | 2 -- 2 files changed, 3 deletions(-) diff --git a/onnxruntime-sys/Cargo.toml b/onnxruntime-sys/Cargo.toml index 0179a184..4892420d 100644 --- a/onnxruntime-sys/Cargo.toml +++ b/onnxruntime-sys/Cargo.toml @@ -20,7 +20,6 @@ keywords = ["neuralnetworks", "onnx", "bindings"] once_cell = "1.13.0" bindgen = { version = "0.60.1", optional = true } ureq = "2.1" -git2 = "0.16.1" # Used on Windows zip = "0.6.2" diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 103cdc0a..3da28c8c 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -1,12 +1,10 @@ #![allow(dead_code)] -use git2::{build::CheckoutBuilder, Repository}; use std::{ borrow::Cow, env, fs, io::{self, Read, Write}, path::{Path, PathBuf}, - process::Command, str::FromStr, }; From 9350cda3270f985afa1a6a822618cd18f8c8c3a6 Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Sun, 9 Apr 2023 22:39:32 +0900 Subject: [PATCH 17/21] remove version prefix --- onnxruntime-sys/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 3da28c8c..1862009b 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -551,7 +551,7 @@ fn prebuilt_archive_url() -> (PathBuf, String) { TRIPLET.os.archive_extension() ), Os::IOs => format!( - "{}/v{}/{}", + "{}/{}/{}", ORT_IOS_RELEASE_BASE_URL, ORT_VERSION, prebuilt_archive ), _ => format!( From ee0f161077aca36b29065899c4d0b552e011f046 Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Mon, 10 Apr 2023 17:49:15 +0900 Subject: [PATCH 18/21] fix for iOS build build on HyodaKazuaki/onnxruntime-builder to confirm working generate-bindings --- onnxruntime-sys/build.rs | 28 +- .../src/generated/ios/aarch64/bindings.rs | 525 ++++++++++++++++-- .../src/generated/ios/x86_64/bindings.rs | 525 ++++++++++++++++-- 3 files changed, 997 insertions(+), 81 deletions(-) diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 1862009b..8f798a29 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.1.2"; /// Base Url from which to download pre-built releases/ const ORT_RELEASE_BASE_URL: &str = "https://github.com/microsoft/onnxruntime/releases/download"; @@ -24,7 +24,7 @@ const ORT_MAVEN_RELEASE_BASE_URL: &str = /// Base Url from which to download ios pre-build releases/ const ORT_IOS_RELEASE_BASE_URL: &str = - "https://github.com/VOICEVOX/onnxruntime-builder/releases/download"; + "https://github.com/HyodaKazuaki/onnxruntime-builder/releases/download"; /// onnxruntime repository/ const ORT_REPOSITORY_URL: &str = "https://github.com/microsoft/onnxruntime.git"; @@ -64,9 +64,7 @@ static TRIPLET: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| T }); static ONNXRUNTIME_DIR_NAME: once_cell::sync::Lazy = - once_cell::sync::Lazy::new( - || format!("onnxruntime-{}-{}", TRIPLET.as_onnx_str(), ORT_VERSION,), - ); + once_cell::sync::Lazy::new(|| format!("onnxruntime-{}-{}", TRIPLET.as_onnx_str(), "1.14.1",)); #[cfg(feature = "disable-sys-build-script")] fn main() { @@ -503,21 +501,21 @@ impl OnnxPrebuiltArchive for Triplet { "x64", self.accelerator.as_onnx_str(), )), - // onnxruntime-ios-arm64-cpu-v1.8.1.tgz - (Os::IOs, Architecture::Arm64, Accelerator::None) - | (Os::IOs, Architecture::X86_64, Accelerator::None) => { - let arch = if env::var("CARGO_BUILD_TARGET").unwrap().ends_with("sim") { + // onnxruntime-ios-arm64-1.8.1.tgz + (Os::IOs, Architecture::Arm64, Accelerator::None) => { + let os = if env::var("TARGET").unwrap().ends_with("sim") { format!("{}-sim", self.os.as_onnx_str()) } else { format!("{}", self.os.as_onnx_str()) }; - Cow::from(format!( - "{}-{}-cpu-v{}", - self.os.as_onnx_str(), - arch, - ORT_VERSION, - )) + Cow::from(format!("{}-{}", os, "arm64")) } + // onnxruntime-ios-sim-x86_64-1.8.1.tgz + (Os::IOs, Architecture::X86_64, Accelerator::None) => Cow::from(format!( + "{}-sim-{}", + self.os.as_onnx_str(), + self.arch.as_onnx_str() + )), _ => { panic!( "Unsupported prebuilt triplet: {:?}, {:?}, {:?}. Please use {}=system and {}=/path/to/onnxruntime", diff --git a/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs b/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs index 2eb0feb4..afa6b008 100644 --- a/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs +++ b/onnxruntime-sys/src/generated/ios/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/ios/x86_64/bindings.rs b/onnxruntime-sys/src/generated/ios/x86_64/bindings.rs index 2eb0feb4..afa6b008 100644 --- a/onnxruntime-sys/src/generated/ios/x86_64/bindings.rs +++ b/onnxruntime-sys/src/generated/ios/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( From 1277c6fd0204e1bc717750c90214e18f56a2fdef Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Mon, 10 Apr 2023 17:52:54 +0900 Subject: [PATCH 19/21] fix for VOICEVOX organization --- onnxruntime-sys/build.rs | 8 +- .../src/generated/ios/aarch64/bindings.rs | 525 ++---------------- .../src/generated/ios/x86_64/bindings.rs | 525 ++---------------- 3 files changed, 71 insertions(+), 987 deletions(-) diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index 8f798a29..15fce042 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.14.1.2"; +const ORT_VERSION: &str = "1.13.1"; /// Base Url from which to download pre-built releases/ const ORT_RELEASE_BASE_URL: &str = "https://github.com/microsoft/onnxruntime/releases/download"; @@ -24,7 +24,7 @@ const ORT_MAVEN_RELEASE_BASE_URL: &str = /// Base Url from which to download ios pre-build releases/ const ORT_IOS_RELEASE_BASE_URL: &str = - "https://github.com/HyodaKazuaki/onnxruntime-builder/releases/download"; + "https://github.com/VOICEVOX/onnxruntime-builder/releases/download"; /// onnxruntime repository/ const ORT_REPOSITORY_URL: &str = "https://github.com/microsoft/onnxruntime.git"; @@ -64,7 +64,9 @@ static TRIPLET: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| T }); static ONNXRUNTIME_DIR_NAME: once_cell::sync::Lazy = - once_cell::sync::Lazy::new(|| format!("onnxruntime-{}-{}", TRIPLET.as_onnx_str(), "1.14.1",)); + once_cell::sync::Lazy::new( + || format!("onnxruntime-{}-{}", TRIPLET.as_onnx_str(), ORT_VERSION,), + ); #[cfg(feature = "disable-sys-build-script")] fn main() { diff --git a/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs b/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs index afa6b008..2eb0feb4 100644 --- a/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs +++ b/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 14; +pub const ORT_API_VERSION: u32 = 13; pub type __darwin_size_t = ::std::os::raw::c_ulong; #[repr(u32)] #[doc = " Copied from TensorProto::DataType"] @@ -389,14 +389,6 @@ 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 { @@ -442,16 +434,12 @@ 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::(), - 56usize, + 48usize, concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) ); assert_eq!( @@ -595,23 +583,6 @@ 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 = ""] @@ -650,16 +621,12 @@ 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::(), - 56usize, + 48usize, concat!("Size of: ", stringify!(OrtROCMProviderOptions)) ); assert_eq!( @@ -803,23 +770,6 @@ 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 = ""] @@ -1257,7 +1207,9 @@ pub struct OrtOpenVINOProviderOptions { pub device_id: *const ::std::os::raw::c_char, #[doc = "< 0 = Use default number of threads"] pub num_of_threads: usize, - pub cache_dir: *const ::std::os::raw::c_char, + #[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 context: *mut ::std::os::raw::c_void, #[doc = "< 0 = disabled, nonzero = enabled"] pub enable_opencl_throttling: ::std::os::raw::c_uchar, @@ -1268,7 +1220,7 @@ pub struct OrtOpenVINOProviderOptions { fn bindgen_test_layout_OrtOpenVINOProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1344,23 +1296,40 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } test_field_num_of_threads(); - fn test_field_cache_dir() { + fn test_field_use_compiled_network() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).cache_dir) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).use_compiled_network) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), "::", - stringify!(cache_dir) + 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) ) ); } - test_field_cache_dir(); + test_field_blob_dump_path(); fn test_field_context() { assert_eq!( unsafe { @@ -1368,7 +1337,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 40usize, + 48usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1385,7 +1354,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize }, - 48usize, + 56usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1402,7 +1371,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize }, - 49usize, + 57usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1546,9 +1515,6 @@ 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."] @@ -2856,98 +2822,12 @@ 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::(), - 1912usize, + 1800usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6816,251 +6696,12 @@ 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)] @@ -7109,27 +6750,12 @@ 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::(), - 136usize, + 96usize, concat!("Size of: ", stringify!(OrtCustomOp)) ); assert_eq!( @@ -7341,91 +6967,6 @@ 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/ios/x86_64/bindings.rs b/onnxruntime-sys/src/generated/ios/x86_64/bindings.rs index afa6b008..2eb0feb4 100644 --- a/onnxruntime-sys/src/generated/ios/x86_64/bindings.rs +++ b/onnxruntime-sys/src/generated/ios/x86_64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 14; +pub const ORT_API_VERSION: u32 = 13; pub type __darwin_size_t = ::std::os::raw::c_ulong; #[repr(u32)] #[doc = " Copied from TensorProto::DataType"] @@ -389,14 +389,6 @@ 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 { @@ -442,16 +434,12 @@ 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::(), - 56usize, + 48usize, concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) ); assert_eq!( @@ -595,23 +583,6 @@ 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 = ""] @@ -650,16 +621,12 @@ 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::(), - 56usize, + 48usize, concat!("Size of: ", stringify!(OrtROCMProviderOptions)) ); assert_eq!( @@ -803,23 +770,6 @@ 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 = ""] @@ -1257,7 +1207,9 @@ pub struct OrtOpenVINOProviderOptions { pub device_id: *const ::std::os::raw::c_char, #[doc = "< 0 = Use default number of threads"] pub num_of_threads: usize, - pub cache_dir: *const ::std::os::raw::c_char, + #[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 context: *mut ::std::os::raw::c_void, #[doc = "< 0 = disabled, nonzero = enabled"] pub enable_opencl_throttling: ::std::os::raw::c_uchar, @@ -1268,7 +1220,7 @@ pub struct OrtOpenVINOProviderOptions { fn bindgen_test_layout_OrtOpenVINOProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1344,23 +1296,40 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } test_field_num_of_threads(); - fn test_field_cache_dir() { + fn test_field_use_compiled_network() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).cache_dir) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).use_compiled_network) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), "::", - stringify!(cache_dir) + 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) ) ); } - test_field_cache_dir(); + test_field_blob_dump_path(); fn test_field_context() { assert_eq!( unsafe { @@ -1368,7 +1337,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 40usize, + 48usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1385,7 +1354,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_opencl_throttling) as usize - ptr as usize }, - 48usize, + 56usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1402,7 +1371,7 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { let ptr = uninit.as_ptr(); ::std::ptr::addr_of!((*ptr).enable_dynamic_shapes) as usize - ptr as usize }, - 49usize, + 57usize, concat!( "Offset of field: ", stringify!(OrtOpenVINOProviderOptions), @@ -1546,9 +1515,6 @@ 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."] @@ -2856,98 +2822,12 @@ 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::(), - 1912usize, + 1800usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6816,251 +6696,12 @@ 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)] @@ -7109,27 +6750,12 @@ 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::(), - 136usize, + 96usize, concat!("Size of: ", stringify!(OrtCustomOp)) ); assert_eq!( @@ -7341,91 +6967,6 @@ 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( From c96e34a256d5052a06c494068e64a1a481ba904c Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Thu, 13 Apr 2023 23:22:46 +0900 Subject: [PATCH 20/21] update bingings for iOS --- .../src/generated/ios/aarch64/bindings.rs | 525 ++++++++++++++++-- .../src/generated/ios/x86_64/bindings.rs | 525 ++++++++++++++++-- 2 files changed, 984 insertions(+), 66 deletions(-) diff --git a/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs b/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs index 2eb0feb4..afa6b008 100644 --- a/onnxruntime-sys/src/generated/ios/aarch64/bindings.rs +++ b/onnxruntime-sys/src/generated/ios/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/ios/x86_64/bindings.rs b/onnxruntime-sys/src/generated/ios/x86_64/bindings.rs index 2eb0feb4..afa6b008 100644 --- a/onnxruntime-sys/src/generated/ios/x86_64/bindings.rs +++ b/onnxruntime-sys/src/generated/ios/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( From 692c1dc1d5421cdb4ca2dd2fb9b38c5c639a3bf2 Mon Sep 17 00:00:00 2001 From: HyodaKazuaki Date: Fri, 14 Apr 2023 23:04:27 +0900 Subject: [PATCH 21/21] remove iOS deploy version and add note --- onnxruntime-sys/build.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index d01b742f..2dabe20a 100644 --- a/onnxruntime-sys/build.rs +++ b/onnxruntime-sys/build.rs @@ -29,9 +29,6 @@ const ORT_IOS_RELEASE_BASE_URL: &str = /// onnxruntime repository/ const ORT_REPOSITORY_URL: &str = "https://github.com/microsoft/onnxruntime.git"; -/// Minimum iOS version of the target platform/ -const IOS_MINIMAL_DEPLOY_TARGET: &str = "16.0"; - /// Environment variable selecting which strategy to use for finding the library /// Possibilities: /// * "download": Download a pre-built library from upstream. This is the default if `ORT_STRATEGY` is not set. @@ -504,6 +501,7 @@ impl OnnxPrebuiltArchive for Triplet { self.accelerator.as_onnx_str(), )), // onnxruntime-ios-arm64-1.8.1.tgz + // Note aarch64 simulator have a '-sim' in the target, but x86_64 does not; both have '-sim' for onnxruntime (Os::IOs, Architecture::Arm64, Accelerator::None) => { let os = if env::var("TARGET").unwrap().ends_with("sim") { format!("{}-sim", self.os.as_onnx_str())