diff --git a/onnxruntime-sys/build.rs b/onnxruntime-sys/build.rs index bb93f418..2d3ae0c1 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.11.1"; +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"; diff --git a/onnxruntime-sys/src/generated/linux/aarch64/bindings.rs b/onnxruntime-sys/src/generated/linux/aarch64/bindings.rs index b9fb4e22..d8152c55 100644 --- a/onnxruntime-sys/src/generated/linux/aarch64/bindings.rs +++ b/onnxruntime-sys/src/generated/linux/aarch64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 11; +pub const ORT_API_VERSION: u32 = 13; pub type __int32_t = ::std::os::raw::c_int; pub type __uint32_t = ::std::os::raw::c_uint; pub type __int64_t = ::std::os::raw::c_long; @@ -88,6 +88,17 @@ pub enum OrtErrorCode { 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 { @@ -188,6 +199,21 @@ pub struct OrtTensorRTProviderOptionsV2 { 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 = ""] @@ -1177,7 +1203,7 @@ fn bindgen_test_layout_OrtMIGraphXProviderOptions() { pub struct OrtOpenVINOProviderOptions { #[doc = " \\brief Device type string"] #[doc = ""] - #[doc = " Valid settings are one of: \"CPU_FP32\", \"GPU_FP32\", \"GPU_FP16\", \"MYRIAD_FP16\", \"VAD-M_FP16\" or \"VAD-F_FP32\""] + #[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, @@ -1188,12 +1214,16 @@ pub struct OrtOpenVINOProviderOptions { 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::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1320,6 +1350,45 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } 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 = ""] @@ -2662,12 +2731,106 @@ pub struct OrtApi { 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::(), - 1680usize, + 1800usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6279,6 +6442,263 @@ fn bindgen_test_layout_OrtApi() { ); } 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)] diff --git a/onnxruntime-sys/src/generated/linux/x86_64/bindings.rs b/onnxruntime-sys/src/generated/linux/x86_64/bindings.rs index b9fb4e22..d8152c55 100644 --- a/onnxruntime-sys/src/generated/linux/x86_64/bindings.rs +++ b/onnxruntime-sys/src/generated/linux/x86_64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 11; +pub const ORT_API_VERSION: u32 = 13; pub type __int32_t = ::std::os::raw::c_int; pub type __uint32_t = ::std::os::raw::c_uint; pub type __int64_t = ::std::os::raw::c_long; @@ -88,6 +88,17 @@ pub enum OrtErrorCode { 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 { @@ -188,6 +199,21 @@ pub struct OrtTensorRTProviderOptionsV2 { 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 = ""] @@ -1177,7 +1203,7 @@ fn bindgen_test_layout_OrtMIGraphXProviderOptions() { pub struct OrtOpenVINOProviderOptions { #[doc = " \\brief Device type string"] #[doc = ""] - #[doc = " Valid settings are one of: \"CPU_FP32\", \"GPU_FP32\", \"GPU_FP16\", \"MYRIAD_FP16\", \"VAD-M_FP16\" or \"VAD-F_FP32\""] + #[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, @@ -1188,12 +1214,16 @@ pub struct OrtOpenVINOProviderOptions { 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::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1320,6 +1350,45 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } 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 = ""] @@ -2662,12 +2731,106 @@ pub struct OrtApi { 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::(), - 1680usize, + 1800usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6279,6 +6442,263 @@ fn bindgen_test_layout_OrtApi() { ); } 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)] diff --git a/onnxruntime-sys/src/generated/macos/aarch64/bindings.rs b/onnxruntime-sys/src/generated/macos/aarch64/bindings.rs index de632454..2eb0feb4 100644 --- a/onnxruntime-sys/src/generated/macos/aarch64/bindings.rs +++ b/onnxruntime-sys/src/generated/macos/aarch64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 11; +pub const ORT_API_VERSION: u32 = 13; pub type __darwin_size_t = ::std::os::raw::c_ulong; #[repr(u32)] #[doc = " Copied from TensorProto::DataType"] @@ -85,6 +85,17 @@ pub enum OrtErrorCode { 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 { @@ -185,6 +196,21 @@ pub struct OrtTensorRTProviderOptionsV2 { 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 = ""] @@ -1174,7 +1200,7 @@ fn bindgen_test_layout_OrtMIGraphXProviderOptions() { pub struct OrtOpenVINOProviderOptions { #[doc = " \\brief Device type string"] #[doc = ""] - #[doc = " Valid settings are one of: \"CPU_FP32\", \"GPU_FP32\", \"GPU_FP16\", \"MYRIAD_FP16\", \"VAD-M_FP16\" or \"VAD-F_FP32\""] + #[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, @@ -1185,12 +1211,16 @@ pub struct OrtOpenVINOProviderOptions { 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::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1317,6 +1347,45 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } 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 = ""] @@ -2659,12 +2728,106 @@ pub struct OrtApi { 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::(), - 1680usize, + 1800usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6276,6 +6439,263 @@ fn bindgen_test_layout_OrtApi() { ); } 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)] diff --git a/onnxruntime-sys/src/generated/macos/x86_64/bindings.rs b/onnxruntime-sys/src/generated/macos/x86_64/bindings.rs index de632454..2eb0feb4 100644 --- a/onnxruntime-sys/src/generated/macos/x86_64/bindings.rs +++ b/onnxruntime-sys/src/generated/macos/x86_64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 11; +pub const ORT_API_VERSION: u32 = 13; pub type __darwin_size_t = ::std::os::raw::c_ulong; #[repr(u32)] #[doc = " Copied from TensorProto::DataType"] @@ -85,6 +85,17 @@ pub enum OrtErrorCode { 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 { @@ -185,6 +196,21 @@ pub struct OrtTensorRTProviderOptionsV2 { 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 = ""] @@ -1174,7 +1200,7 @@ fn bindgen_test_layout_OrtMIGraphXProviderOptions() { pub struct OrtOpenVINOProviderOptions { #[doc = " \\brief Device type string"] #[doc = ""] - #[doc = " Valid settings are one of: \"CPU_FP32\", \"GPU_FP32\", \"GPU_FP16\", \"MYRIAD_FP16\", \"VAD-M_FP16\" or \"VAD-F_FP32\""] + #[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, @@ -1185,12 +1211,16 @@ pub struct OrtOpenVINOProviderOptions { 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::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1317,6 +1347,45 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } 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 = ""] @@ -2659,12 +2728,106 @@ pub struct OrtApi { 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::(), - 1680usize, + 1800usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6276,6 +6439,263 @@ fn bindgen_test_layout_OrtApi() { ); } 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)] diff --git a/onnxruntime-sys/src/generated/windows/x86/bindings.rs b/onnxruntime-sys/src/generated/windows/x86/bindings.rs index 98e1f61c..2c371c3b 100644 --- a/onnxruntime-sys/src/generated/windows/x86/bindings.rs +++ b/onnxruntime-sys/src/generated/windows/x86/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 11; +pub const ORT_API_VERSION: u32 = 13; pub type wchar_t = ::std::os::raw::c_ushort; #[repr(i32)] #[doc = " Copied from TensorProto::DataType"] @@ -85,6 +85,17 @@ pub enum OrtErrorCode { ORT_INVALID_GRAPH = 10, ORT_EP_FAIL = 11, } +#[repr(i32)] +#[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 { @@ -185,6 +196,21 @@ pub struct OrtTensorRTProviderOptionsV2 { 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 = ""] @@ -1177,7 +1203,7 @@ fn bindgen_test_layout_OrtMIGraphXProviderOptions() { pub struct OrtOpenVINOProviderOptions { #[doc = " \\brief Device type string"] #[doc = ""] - #[doc = " Valid settings are one of: \"CPU_FP32\", \"GPU_FP32\", \"GPU_FP16\", \"MYRIAD_FP16\", \"VAD-M_FP16\" or \"VAD-F_FP32\""] + #[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, @@ -1188,12 +1214,16 @@ pub struct OrtOpenVINOProviderOptions { 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::(), - 28usize, + 32usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1320,6 +1350,45 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } 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 + }, + 28usize, + 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 + }, + 29usize, + 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 = ""] @@ -2701,12 +2770,107 @@ pub struct OrtApi { migraphx_options: *const OrtMIGraphXProviderOptions, ) -> OrtStatusPtr, >, + pub AddExternalInitializers: ::std::option::Option< + unsafe extern "stdcall" 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 "stdcall" 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 "stdcall" 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 "stdcall" 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 "stdcall" 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 "stdcall" 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 "stdcall" fn( + options: *mut OrtSessionOptions, + cann_options: *const OrtCANNProviderOptions, + ) -> OrtStatusPtr, + >, + pub CreateCANNProviderOptions: ::std::option::Option< + unsafe extern "stdcall" fn(out: *mut *mut OrtCANNProviderOptions) -> OrtStatusPtr, + >, + pub UpdateCANNProviderOptions: ::std::option::Option< + unsafe extern "stdcall" 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 "stdcall" 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::(), - 840usize, + 900usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6318,6 +6482,263 @@ fn bindgen_test_layout_OrtApi() { ); } 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 + }, + 840usize, + 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 + }, + 844usize, + 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 + }, + 848usize, + 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 + }, + 852usize, + 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 + }, + 856usize, + 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 + }, + 860usize, + 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 + }, + 864usize, + 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 + }, + 868usize, + 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 + }, + 872usize, + 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 + }, + 876usize, + 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 + }, + 880usize, + 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 + }, + 884usize, + 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 + }, + 888usize, + 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 + }, + 892usize, + 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 + }, + 896usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseCANNProviderOptions) + ) + ); + } + test_field_ReleaseCANNProviderOptions(); } #[repr(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/onnxruntime-sys/src/generated/windows/x86_64/bindings.rs b/onnxruntime-sys/src/generated/windows/x86_64/bindings.rs index 4708fd37..6ba4ec19 100644 --- a/onnxruntime-sys/src/generated/windows/x86_64/bindings.rs +++ b/onnxruntime-sys/src/generated/windows/x86_64/bindings.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 11; +pub const ORT_API_VERSION: u32 = 13; pub type wchar_t = ::std::os::raw::c_ushort; #[repr(i32)] #[doc = " Copied from TensorProto::DataType"] @@ -85,6 +85,17 @@ pub enum OrtErrorCode { ORT_INVALID_GRAPH = 10, ORT_EP_FAIL = 11, } +#[repr(i32)] +#[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 { @@ -185,6 +196,21 @@ pub struct OrtTensorRTProviderOptionsV2 { 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 = ""] @@ -1174,7 +1200,7 @@ fn bindgen_test_layout_OrtMIGraphXProviderOptions() { pub struct OrtOpenVINOProviderOptions { #[doc = " \\brief Device type string"] #[doc = ""] - #[doc = " Valid settings are one of: \"CPU_FP32\", \"GPU_FP32\", \"GPU_FP16\", \"MYRIAD_FP16\", \"VAD-M_FP16\" or \"VAD-F_FP32\""] + #[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, @@ -1185,12 +1211,16 @@ pub struct OrtOpenVINOProviderOptions { 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::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -1317,6 +1347,45 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } 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 = ""] @@ -2659,12 +2728,106 @@ pub struct OrtApi { 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::(), - 1680usize, + 1800usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -6276,6 +6439,263 @@ fn bindgen_test_layout_OrtApi() { ); } 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(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/onnxruntime-sys/src/generated/windows/x86_64/bindings_directml.rs b/onnxruntime-sys/src/generated/windows/x86_64/bindings_directml.rs index 2d5c155c..e41c3f05 100644 --- a/onnxruntime-sys/src/generated/windows/x86_64/bindings_directml.rs +++ b/onnxruntime-sys/src/generated/windows/x86_64/bindings_directml.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen 0.60.1 */ -pub const ORT_API_VERSION: u32 = 11; +pub const ORT_API_VERSION: u32 = 13; pub type wchar_t = ::std::os::raw::c_ushort; pub type ULONG = ::std::os::raw::c_ulong; pub type BOOL = ::std::os::raw::c_int; @@ -3139,6 +3139,17 @@ pub enum OrtErrorCode { ORT_INVALID_GRAPH = 10, ORT_EP_FAIL = 11, } +#[repr(i32)] +#[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 { @@ -3239,6 +3250,21 @@ pub struct OrtTensorRTProviderOptionsV2 { 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 = ""] @@ -4228,7 +4254,7 @@ fn bindgen_test_layout_OrtMIGraphXProviderOptions() { pub struct OrtOpenVINOProviderOptions { #[doc = " \\brief Device type string"] #[doc = ""] - #[doc = " Valid settings are one of: \"CPU_FP32\", \"GPU_FP32\", \"GPU_FP16\", \"MYRIAD_FP16\", \"VAD-M_FP16\" or \"VAD-F_FP32\""] + #[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, @@ -4239,12 +4265,16 @@ pub struct OrtOpenVINOProviderOptions { 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::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(OrtOpenVINOProviderOptions)) ); assert_eq!( @@ -4371,6 +4401,45 @@ fn bindgen_test_layout_OrtOpenVINOProviderOptions() { ); } 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 = ""] @@ -5713,12 +5782,106 @@ pub struct OrtApi { 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::(), - 1680usize, + 1800usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -9330,6 +9493,263 @@ fn bindgen_test_layout_OrtApi() { ); } 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(i32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]