diff --git a/onnxruntime-sys/src/generated/linux/aarch64/bindings.rs b/onnxruntime-sys/src/generated/linux/aarch64/bindings.rs index 1c6d82ec..772b2bd0 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 = 14; +pub const ORT_API_VERSION: u32 = 16; 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; @@ -27,6 +27,10 @@ pub enum ONNXTensorElementDataType { ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64 = 14, ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128 = 15, ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16 = 16, + ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FN = 17, + ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FNUZ = 18, + ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2 = 19, + ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2FNUZ = 20, } #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -146,22 +150,27 @@ pub struct OrtTensorTypeAndShapeInfo { } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct OrtSessionOptions { +pub struct OrtMapTypeInfo { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct OrtCustomOpDomain { +pub struct OrtSequenceTypeInfo { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct OrtMapTypeInfo { +pub struct OrtOptionalTypeInfo { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct OrtSequenceTypeInfo { +pub struct OrtSessionOptions { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCustomOpDomain { _unused: [u8; 0], } #[repr(C)] @@ -206,6 +215,11 @@ pub struct OrtCANNProviderOptions { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct OrtDnnlProviderOptions { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct OrtOp { _unused: [u8; 0], } @@ -214,6 +228,11 @@ pub struct OrtOp { pub struct OrtOpAttr { _unused: [u8; 0], } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtLogger { + _unused: [u8; 0], +} pub type OrtStatusPtr = *mut OrtStatus; #[doc = " \\brief Memory allocation interface"] #[doc = ""] @@ -332,8 +351,8 @@ pub type OrtLoggingFunction = ::std::option::Option< #[repr(u32)] #[doc = " \\brief Graph optimization level"] #[doc = ""] -#[doc = " Refer to https://www.onnxruntime.ai/docs/resources/graph-optimizations.html"] -#[doc = " for an in-depth understanding of Graph Optimizations"] +#[doc = " Refer to https://www.onnxruntime.ai/docs/performance/graph-optimizations.html#graph-optimization-levels"] +#[doc = " for an in-depth understanding of the Graph Optimization Levels."] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum GraphOptimizationLevel { ORT_DISABLE_ALL = 0, @@ -445,16 +464,23 @@ pub struct OrtCUDAProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief CUDA memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, - #[doc = " \\brief Enable TunableOp."] - #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] - #[doc = " This option can be superseded by environment variable ORT_CUDA_TUNABLE_OP_ENABLED."] - pub tunable_op_enabled: ::std::os::raw::c_int, + #[doc = " \\brief Enable TunableOp for using."] + #[doc = " Set it to 1/0 to enable/disable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be overriden by environment variable ORT_CUDA_TUNABLE_OP_ENABLE."] + pub tunable_op_enable: ::std::os::raw::c_int, + #[doc = " \\brief Enable TunableOp for tuning."] + #[doc = " Set it to 1/0 to enable/disable TunableOp tuning. Otherwise, it is disabled by default."] + #[doc = " This option can be overriden by environment variable ORT_CUDA_TUNABLE_OP_TUNING_ENABLE."] + pub tunable_op_tuning_enable: ::std::os::raw::c_int, + #[doc = " \\brief Max tuning duration time limit for each instance of TunableOp."] + #[doc = " Defaults to 0 to disable the limit."] + pub tunable_op_max_tuning_duration_ms: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtCUDAProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(OrtCUDAProviderOptions)) ); assert_eq!( @@ -598,23 +624,58 @@ fn bindgen_test_layout_OrtCUDAProviderOptions() { ); } test_field_default_memory_arena_cfg(); - fn test_field_tunable_op_enabled() { + fn test_field_tunable_op_enable() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).tunable_op_enable) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", stringify!(OrtCUDAProviderOptions), "::", - stringify!(tunable_op_enabled) + stringify!(tunable_op_enable) + ) + ); + } + test_field_tunable_op_enable(); + fn test_field_tunable_op_tuning_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_tuning_enable) as usize - ptr as usize + }, + 52usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(tunable_op_tuning_enable) + ) + ); + } + test_field_tunable_op_tuning_enable(); + fn test_field_tunable_op_max_tuning_duration_ms() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_max_tuning_duration_ms) as usize + - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(OrtCUDAProviderOptions), + "::", + stringify!(tunable_op_max_tuning_duration_ms) ) ); } - test_field_tunable_op_enabled(); + test_field_tunable_op_max_tuning_duration_ms(); } #[doc = " \\brief ROCM Provider Options"] #[doc = ""] @@ -653,16 +714,23 @@ pub struct OrtROCMProviderOptions { pub user_compute_stream: *mut ::std::os::raw::c_void, #[doc = " \\brief ROCM memory arena configuration parameters"] pub default_memory_arena_cfg: *mut OrtArenaCfg, - #[doc = " \\brief Enable TunableOp."] - #[doc = " Set it to 1 to enable TunableOp. Otherwise, it is disabled by default."] - #[doc = " This option can be superseded by environment variable ORT_ROCM_TUNABLE_OP_ENABLED."] - pub tunable_op_enabled: ::std::os::raw::c_int, + #[doc = " \\brief Enable TunableOp for using."] + #[doc = " Set it to 1/0 to enable/disable TunableOp. Otherwise, it is disabled by default."] + #[doc = " This option can be overriden by environment variable ORT_ROCM_TUNABLE_OP_ENABLE."] + pub tunable_op_enable: ::std::os::raw::c_int, + #[doc = " \\brief Enable TunableOp for tuning."] + #[doc = " Set it to 1/0 to enable/disable TunableOp tuning. Otherwise, it is disabled by default."] + #[doc = " This option can be overriden by environment variable ORT_ROCM_TUNABLE_OP_TUNING_ENABLE."] + pub tunable_op_tuning_enable: ::std::os::raw::c_int, + #[doc = " \\brief Max tuning duration time limit for each instance of TunableOp."] + #[doc = " Defaults to 0 to disable the limit."] + pub tunable_op_max_tuning_duration_ms: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_OrtROCMProviderOptions() { assert_eq!( ::std::mem::size_of::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(OrtROCMProviderOptions)) ); assert_eq!( @@ -806,23 +874,58 @@ fn bindgen_test_layout_OrtROCMProviderOptions() { ); } test_field_default_memory_arena_cfg(); - fn test_field_tunable_op_enabled() { + fn test_field_tunable_op_enable() { assert_eq!( unsafe { let uninit = ::std::mem::MaybeUninit::::uninit(); let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).tunable_op_enabled) as usize - ptr as usize + ::std::ptr::addr_of!((*ptr).tunable_op_enable) as usize - ptr as usize }, 48usize, concat!( "Offset of field: ", stringify!(OrtROCMProviderOptions), "::", - stringify!(tunable_op_enabled) + stringify!(tunable_op_enable) + ) + ); + } + test_field_tunable_op_enable(); + fn test_field_tunable_op_tuning_enable() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_tuning_enable) as usize - ptr as usize + }, + 52usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(tunable_op_tuning_enable) + ) + ); + } + test_field_tunable_op_tuning_enable(); + fn test_field_tunable_op_max_tuning_duration_ms() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).tunable_op_max_tuning_duration_ms) as usize + - ptr as usize + }, + 56usize, + concat!( + "Offset of field: ", + stringify!(OrtROCMProviderOptions), + "::", + stringify!(tunable_op_max_tuning_duration_ms) ) ); } - test_field_tunable_op_enabled(); + test_field_tunable_op_max_tuning_duration_ms(); } #[doc = " \\brief TensorRT Provider Options"] #[doc = ""] @@ -1253,7 +1356,7 @@ fn bindgen_test_layout_OrtMIGraphXProviderOptions() { pub struct OrtOpenVINOProviderOptions { #[doc = " \\brief Device type string"] #[doc = ""] - #[doc = " Valid settings are one of: \"CPU_FP32\", \"CPU_FP16\", \"GPU_FP32\", \"GPU_FP16\", \"MYRIAD_FP16\", \"VAD-M_FP16\" or \"VAD-F_FP32\""] + #[doc = " Valid settings are one of: \"CPU_FP32\", \"CPU_FP16\", \"GPU_FP32\", \"GPU_FP16\""] pub device_type: *const ::std::os::raw::c_char, #[doc = "< 0 = disabled, nonzero = enabled"] pub enable_vpu_fast_compile: ::std::os::raw::c_uchar, @@ -1432,8 +1535,13 @@ pub struct OrtApiBase { #[doc = " \\param[in] version Must be ::ORT_API_VERSION"] #[doc = " \\return The ::OrtApi for the version requested, nullptr will be returned if this version is unsupported, for example when using a runtime"] #[doc = " older than the version created with this header file."] + #[doc = ""] + #[doc = " One can call GetVersionString() to get the version of the Onnxruntime library for logging"] + #[doc = " and error reporting purposes."] pub GetApi: ::std::option::Option *const OrtApi>, - #[doc = "< Returns a null terminated string of the version of the Onnxruntime library (eg: \"1.8.1\")"] + #[doc = " \\brief Returns a null terminated string of the version of the Onnxruntime library (eg: \"1.8.1\")"] + #[doc = ""] + #[doc = " \\return UTF-8 encoded version string. Do not deallocate the returned buffer."] pub GetVersionString: ::std::option::Option *const ::std::os::raw::c_char>, } @@ -1552,6 +1660,20 @@ pub type OrtCustomJoinThreadFn = pub type RegisterCustomOpsFn = ::std::option::Option< unsafe extern "C" fn(options: *mut OrtSessionOptions, api: *const OrtApiBase) -> *mut OrtStatus, >; +#[doc = " \\brief Callback function for RunAsync"] +#[doc = ""] +#[doc = " \\param[in] user_data User specific data that passed back to the callback"] +#[doc = " \\param[out] outputs On succeed, outputs host inference results, on error, the value will be nullptr"] +#[doc = " \\param[out] num_outputs Number of outputs, on error, the value will be zero"] +#[doc = " \\param[out] status On error, status will provide details"] +pub type RunAsyncCallbackFn = ::std::option::Option< + unsafe extern "C" fn( + user_data: *mut ::std::os::raw::c_void, + outputs: *mut *mut OrtValue, + num_outputs: usize, + status: OrtStatusPtr, + ), +>; #[doc = " \\brief The C API"] #[doc = ""] #[doc = " All C API functions are defined inside this structure as pointers to functions."] @@ -2826,6 +2948,22 @@ pub struct OrtApi { ) -> OrtStatusPtr, >, pub ReleaseKernelInfo: ::std::option::Option, + #[doc = " \\name Ort Training"] + #[doc = " @{"] + #[doc = "** \\brief Gets the Training C Api struct"] + #[doc = "*"] + #[doc = "* Call this function to access the ::OrtTrainingApi structure that holds pointers to functions that enable"] + #[doc = "* training with onnxruntime."] + #[doc = "* \\note A NULL pointer will be returned and no error message will be printed if the training api"] + #[doc = "* is not supported with this build. A NULL pointer will be returned and an error message will be"] + #[doc = "* printed if the provided version is unsupported, for example when using a runtime older than the"] + #[doc = "* version created with this header file."] + #[doc = "*"] + #[doc = "* \\param[in] version Must be ::ORT_API_VERSION"] + #[doc = "* \\return The ::OrtTrainingApi struct for the version requested."] + #[doc = "*"] + #[doc = "* \\since Version 1.13"] + #[doc = "*/"] pub GetTrainingApi: ::std::option::Option *const OrtTrainingApi>, pub SessionOptionsAppendExecutionProvider_CANN: ::std::option::Option< @@ -2945,12 +3083,201 @@ pub struct OrtApi { size: *mut usize, ) -> OrtStatusPtr, >, + pub SessionOptionsAppendExecutionProvider_Dnnl: ::std::option::Option< + unsafe extern "C" fn( + options: *mut OrtSessionOptions, + dnnl_options: *const OrtDnnlProviderOptions, + ) -> OrtStatusPtr, + >, + pub CreateDnnlProviderOptions: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtDnnlProviderOptions) -> OrtStatusPtr, + >, + pub UpdateDnnlProviderOptions: ::std::option::Option< + unsafe extern "C" fn( + dnnl_options: *mut OrtDnnlProviderOptions, + 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 GetDnnlProviderOptionsAsString: ::std::option::Option< + unsafe extern "C" fn( + dnnl_options: *const OrtDnnlProviderOptions, + allocator: *mut OrtAllocator, + ptr: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + #[doc = " \\brief Release an ::OrtDnnlProviderOptions"] + #[doc = ""] + #[doc = " \\since Version 1.15."] + pub ReleaseDnnlProviderOptions: + ::std::option::Option, + pub KernelInfo_GetNodeName: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + out: *mut ::std::os::raw::c_char, + size: *mut usize, + ) -> OrtStatusPtr, + >, + pub KernelInfo_GetLogger: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + logger: *mut *const OrtLogger, + ) -> OrtStatusPtr, + >, + pub KernelContext_GetLogger: ::std::option::Option< + unsafe extern "C" fn( + context: *const OrtKernelContext, + logger: *mut *const OrtLogger, + ) -> OrtStatusPtr, + >, + pub Logger_LogMessage: ::std::option::Option< + unsafe extern "C" fn( + logger: *const OrtLogger, + log_severity_level: OrtLoggingLevel, + message: *const ::std::os::raw::c_char, + file_path: *const ::std::os::raw::c_char, + line_number: ::std::os::raw::c_int, + func_name: *const ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub Logger_GetLoggingSeverityLevel: ::std::option::Option< + unsafe extern "C" fn(logger: *const OrtLogger, out: *mut OrtLoggingLevel) -> OrtStatusPtr, + >, + pub KernelInfoGetConstantInput_tensor: ::std::option::Option< + unsafe extern "C" fn( + info: *const OrtKernelInfo, + index: usize, + is_constant: *mut ::std::os::raw::c_int, + out: *mut *const OrtValue, + ) -> OrtStatusPtr, + >, + pub CastTypeInfoToOptionalTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + type_info: *const OrtTypeInfo, + out: *mut *const OrtOptionalTypeInfo, + ) -> OrtStatusPtr, + >, + pub GetOptionalContainedTypeInfo: ::std::option::Option< + unsafe extern "C" fn( + optional_type_info: *const OrtOptionalTypeInfo, + out: *mut *mut OrtTypeInfo, + ) -> OrtStatusPtr, + >, + pub GetResizedStringTensorElementBuffer: ::std::option::Option< + unsafe extern "C" fn( + value: *mut OrtValue, + index: usize, + length_in_bytes: usize, + buffer: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + pub KernelContext_GetAllocator: ::std::option::Option< + unsafe extern "C" fn( + context: *const OrtKernelContext, + mem_info: *const OrtMemoryInfo, + out: *mut *mut OrtAllocator, + ) -> OrtStatusPtr, + >, + #[doc = " \\brief Returns a null terminated string of the build info including git info and cxx flags"] + #[doc = ""] + #[doc = " \\return UTF-8 encoded version string. Do not deallocate the returned buffer."] + #[doc = ""] + #[doc = " \\since Version 1.15."] + pub GetBuildInfoString: + ::std::option::Option *const ::std::os::raw::c_char>, + pub CreateROCMProviderOptions: ::std::option::Option< + unsafe extern "C" fn(out: *mut *mut OrtROCMProviderOptions) -> OrtStatusPtr, + >, + pub UpdateROCMProviderOptions: ::std::option::Option< + unsafe extern "C" fn( + rocm_options: *mut OrtROCMProviderOptions, + 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 GetROCMProviderOptionsAsString: ::std::option::Option< + unsafe extern "C" fn( + rocm_options: *const OrtROCMProviderOptions, + allocator: *mut OrtAllocator, + ptr: *mut *mut ::std::os::raw::c_char, + ) -> OrtStatusPtr, + >, + #[doc = " \\brief Release an ::OrtROCMProviderOptions"] + #[doc = ""] + #[doc = " \\note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does"] + #[doc = ""] + #[doc = " \\since Version 1.16."] + pub ReleaseROCMProviderOptions: + ::std::option::Option, + pub CreateAndRegisterAllocatorV2: ::std::option::Option< + unsafe extern "C" fn( + env: *mut OrtEnv, + provider_type: *const ::std::os::raw::c_char, + mem_info: *const OrtMemoryInfo, + arena_cfg: *const OrtArenaCfg, + 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 RunAsync: ::std::option::Option< + unsafe extern "C" fn( + session: *mut OrtSession, + run_options: *const OrtRunOptions, + input_names: *const *const ::std::os::raw::c_char, + input: *const *const OrtValue, + input_len: usize, + output_names: *const *const ::std::os::raw::c_char, + output_names_len: usize, + output: *mut *mut OrtValue, + run_async_callback: RunAsyncCallbackFn, + user_data: *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub UpdateTensorRTProviderOptionsWithValue: ::std::option::Option< + unsafe extern "C" fn( + tensorrt_options: *mut OrtTensorRTProviderOptionsV2, + key: *const ::std::os::raw::c_char, + value: *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub GetTensorRTProviderOptionsByName: ::std::option::Option< + unsafe extern "C" fn( + tensorrt_options: *const OrtTensorRTProviderOptionsV2, + key: *const ::std::os::raw::c_char, + ptr: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub UpdateCUDAProviderOptionsWithValue: ::std::option::Option< + unsafe extern "C" fn( + cuda_options: *mut OrtCUDAProviderOptionsV2, + key: *const ::std::os::raw::c_char, + value: *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub GetCUDAProviderOptionsByName: ::std::option::Option< + unsafe extern "C" fn( + cuda_options: *const OrtCUDAProviderOptionsV2, + key: *const ::std::os::raw::c_char, + ptr: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub KernelContext_GetResource: ::std::option::Option< + unsafe extern "C" fn( + context: *const OrtKernelContext, + resouce_version: ::std::os::raw::c_int, + resource_id: ::std::os::raw::c_int, + resource: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, } #[test] fn bindgen_test_layout_OrtApi() { assert_eq!( ::std::mem::size_of::(), - 1912usize, + 2128usize, concat!("Size of: ", stringify!(OrtApi)) ); assert_eq!( @@ -7057,58 +7384,523 @@ fn bindgen_test_layout_OrtApi() { ); } test_field_GetSessionConfigEntry(); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum OrtCustomOpInputOutputCharacteristic { - INPUT_OUTPUT_REQUIRED = 0, - INPUT_OUTPUT_OPTIONAL = 1, - INPUT_OUTPUT_VARIADIC = 2, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OrtCustomOp { - pub version: u32, - pub CreateKernel: ::std::option::Option< - unsafe extern "C" fn( - op: *const OrtCustomOp, - api: *const OrtApi, - info: *const OrtKernelInfo, - ) -> *mut ::std::os::raw::c_void, - >, - pub GetName: ::std::option::Option< - unsafe extern "C" fn(op: *const OrtCustomOp) -> *const ::std::os::raw::c_char, - >, - pub GetExecutionProviderType: ::std::option::Option< - unsafe extern "C" fn(op: *const OrtCustomOp) -> *const ::std::os::raw::c_char, - >, - pub GetInputType: ::std::option::Option< - unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> ONNXTensorElementDataType, - >, - pub GetInputTypeCount: - ::std::option::Option usize>, - pub GetOutputType: ::std::option::Option< - unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> ONNXTensorElementDataType, - >, - pub GetOutputTypeCount: - ::std::option::Option usize>, - pub KernelCompute: ::std::option::Option< - unsafe extern "C" fn( - op_kernel: *mut ::std::os::raw::c_void, - context: *mut OrtKernelContext, - ), - >, - pub KernelDestroy: - ::std::option::Option, - pub GetInputCharacteristic: ::std::option::Option< - unsafe extern "C" fn( - op: *const OrtCustomOp, - index: usize, - ) -> OrtCustomOpInputOutputCharacteristic, - >, - pub GetOutputCharacteristic: ::std::option::Option< - unsafe extern "C" fn( - op: *const OrtCustomOp, + fn test_field_SessionOptionsAppendExecutionProvider_Dnnl() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).SessionOptionsAppendExecutionProvider_Dnnl) as usize + - ptr as usize + }, + 1912usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(SessionOptionsAppendExecutionProvider_Dnnl) + ) + ); + } + test_field_SessionOptionsAppendExecutionProvider_Dnnl(); + fn test_field_CreateDnnlProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateDnnlProviderOptions) as usize - ptr as usize + }, + 1920usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateDnnlProviderOptions) + ) + ); + } + test_field_CreateDnnlProviderOptions(); + fn test_field_UpdateDnnlProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateDnnlProviderOptions) as usize - ptr as usize + }, + 1928usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateDnnlProviderOptions) + ) + ); + } + test_field_UpdateDnnlProviderOptions(); + fn test_field_GetDnnlProviderOptionsAsString() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetDnnlProviderOptionsAsString) as usize - ptr as usize + }, + 1936usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetDnnlProviderOptionsAsString) + ) + ); + } + test_field_GetDnnlProviderOptionsAsString(); + fn test_field_ReleaseDnnlProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseDnnlProviderOptions) as usize - ptr as usize + }, + 1944usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseDnnlProviderOptions) + ) + ); + } + test_field_ReleaseDnnlProviderOptions(); + fn test_field_KernelInfo_GetNodeName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetNodeName) as usize - ptr as usize + }, + 1952usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetNodeName) + ) + ); + } + test_field_KernelInfo_GetNodeName(); + fn test_field_KernelInfo_GetLogger() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfo_GetLogger) as usize - ptr as usize + }, + 1960usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfo_GetLogger) + ) + ); + } + test_field_KernelInfo_GetLogger(); + fn test_field_KernelContext_GetLogger() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetLogger) as usize - ptr as usize + }, + 1968usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetLogger) + ) + ); + } + test_field_KernelContext_GetLogger(); + fn test_field_Logger_LogMessage() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).Logger_LogMessage) as usize - ptr as usize + }, + 1976usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(Logger_LogMessage) + ) + ); + } + test_field_Logger_LogMessage(); + fn test_field_Logger_GetLoggingSeverityLevel() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).Logger_GetLoggingSeverityLevel) as usize - ptr as usize + }, + 1984usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(Logger_GetLoggingSeverityLevel) + ) + ); + } + test_field_Logger_GetLoggingSeverityLevel(); + fn test_field_KernelInfoGetConstantInput_tensor() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelInfoGetConstantInput_tensor) as usize + - ptr as usize + }, + 1992usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelInfoGetConstantInput_tensor) + ) + ); + } + test_field_KernelInfoGetConstantInput_tensor(); + fn test_field_CastTypeInfoToOptionalTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CastTypeInfoToOptionalTypeInfo) as usize - ptr as usize + }, + 2000usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CastTypeInfoToOptionalTypeInfo) + ) + ); + } + test_field_CastTypeInfoToOptionalTypeInfo(); + fn test_field_GetOptionalContainedTypeInfo() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetOptionalContainedTypeInfo) as usize - ptr as usize + }, + 2008usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetOptionalContainedTypeInfo) + ) + ); + } + test_field_GetOptionalContainedTypeInfo(); + fn test_field_GetResizedStringTensorElementBuffer() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetResizedStringTensorElementBuffer) as usize + - ptr as usize + }, + 2016usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetResizedStringTensorElementBuffer) + ) + ); + } + test_field_GetResizedStringTensorElementBuffer(); + fn test_field_KernelContext_GetAllocator() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetAllocator) as usize - ptr as usize + }, + 2024usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetAllocator) + ) + ); + } + test_field_KernelContext_GetAllocator(); + fn test_field_GetBuildInfoString() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetBuildInfoString) as usize - ptr as usize + }, + 2032usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetBuildInfoString) + ) + ); + } + test_field_GetBuildInfoString(); + fn test_field_CreateROCMProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateROCMProviderOptions) as usize - ptr as usize + }, + 2040usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateROCMProviderOptions) + ) + ); + } + test_field_CreateROCMProviderOptions(); + fn test_field_UpdateROCMProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateROCMProviderOptions) as usize - ptr as usize + }, + 2048usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateROCMProviderOptions) + ) + ); + } + test_field_UpdateROCMProviderOptions(); + fn test_field_GetROCMProviderOptionsAsString() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetROCMProviderOptionsAsString) as usize - ptr as usize + }, + 2056usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetROCMProviderOptionsAsString) + ) + ); + } + test_field_GetROCMProviderOptionsAsString(); + fn test_field_ReleaseROCMProviderOptions() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).ReleaseROCMProviderOptions) as usize - ptr as usize + }, + 2064usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(ReleaseROCMProviderOptions) + ) + ); + } + test_field_ReleaseROCMProviderOptions(); + fn test_field_CreateAndRegisterAllocatorV2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateAndRegisterAllocatorV2) as usize - ptr as usize + }, + 2072usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(CreateAndRegisterAllocatorV2) + ) + ); + } + test_field_CreateAndRegisterAllocatorV2(); + fn test_field_RunAsync() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).RunAsync) as usize - ptr as usize + }, + 2080usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(RunAsync) + ) + ); + } + test_field_RunAsync(); + fn test_field_UpdateTensorRTProviderOptionsWithValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateTensorRTProviderOptionsWithValue) as usize + - ptr as usize + }, + 2088usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateTensorRTProviderOptionsWithValue) + ) + ); + } + test_field_UpdateTensorRTProviderOptionsWithValue(); + fn test_field_GetTensorRTProviderOptionsByName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetTensorRTProviderOptionsByName) as usize + - ptr as usize + }, + 2096usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetTensorRTProviderOptionsByName) + ) + ); + } + test_field_GetTensorRTProviderOptionsByName(); + fn test_field_UpdateCUDAProviderOptionsWithValue() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).UpdateCUDAProviderOptionsWithValue) as usize + - ptr as usize + }, + 2104usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(UpdateCUDAProviderOptionsWithValue) + ) + ); + } + test_field_UpdateCUDAProviderOptionsWithValue(); + fn test_field_GetCUDAProviderOptionsByName() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).GetCUDAProviderOptionsByName) as usize - ptr as usize + }, + 2112usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(GetCUDAProviderOptionsByName) + ) + ); + } + test_field_GetCUDAProviderOptionsByName(); + fn test_field_KernelContext_GetResource() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelContext_GetResource) as usize - ptr as usize + }, + 2120usize, + concat!( + "Offset of field: ", + stringify!(OrtApi), + "::", + stringify!(KernelContext_GetResource) + ) + ); + } + test_field_KernelContext_GetResource(); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum OrtCustomOpInputOutputCharacteristic { + INPUT_OUTPUT_REQUIRED = 0, + INPUT_OUTPUT_OPTIONAL = 1, + INPUT_OUTPUT_VARIADIC = 2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct OrtCustomOp { + pub version: u32, + pub CreateKernel: ::std::option::Option< + unsafe extern "C" fn( + op: *const OrtCustomOp, + api: *const OrtApi, + info: *const OrtKernelInfo, + ) -> *mut ::std::os::raw::c_void, + >, + pub GetName: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> *const ::std::os::raw::c_char, + >, + pub GetExecutionProviderType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp) -> *const ::std::os::raw::c_char, + >, + pub GetInputType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> ONNXTensorElementDataType, + >, + pub GetInputTypeCount: + ::std::option::Option usize>, + pub GetOutputType: ::std::option::Option< + unsafe extern "C" fn(op: *const OrtCustomOp, index: usize) -> ONNXTensorElementDataType, + >, + pub GetOutputTypeCount: + ::std::option::Option usize>, + pub KernelCompute: ::std::option::Option< + unsafe extern "C" fn( + op_kernel: *mut ::std::os::raw::c_void, + context: *mut OrtKernelContext, + ), + >, + pub KernelDestroy: + ::std::option::Option, + pub GetInputCharacteristic: ::std::option::Option< + unsafe extern "C" fn( + op: *const OrtCustomOp, + index: usize, + ) -> OrtCustomOpInputOutputCharacteristic, + >, + pub GetOutputCharacteristic: ::std::option::Option< + unsafe extern "C" fn( + op: *const OrtCustomOp, index: usize, ) -> OrtCustomOpInputOutputCharacteristic, >, @@ -7127,12 +7919,26 @@ pub struct OrtCustomOp { pub GetVariadicOutputHomogeneity: ::std::option::Option< unsafe extern "C" fn(op: *const OrtCustomOp) -> ::std::os::raw::c_int, >, + pub CreateKernelV2: ::std::option::Option< + unsafe extern "C" fn( + op: *const OrtCustomOp, + api: *const OrtApi, + info: *const OrtKernelInfo, + kernel: *mut *mut ::std::os::raw::c_void, + ) -> OrtStatusPtr, + >, + pub KernelComputeV2: ::std::option::Option< + unsafe extern "C" fn( + op_kernel: *mut ::std::os::raw::c_void, + context: *mut OrtKernelContext, + ) -> OrtStatusPtr, + >, } #[test] fn bindgen_test_layout_OrtCustomOp() { assert_eq!( ::std::mem::size_of::(), - 136usize, + 152usize, concat!("Size of: ", stringify!(OrtCustomOp)) ); assert_eq!( @@ -7429,6 +8235,40 @@ fn bindgen_test_layout_OrtCustomOp() { ); } test_field_GetVariadicOutputHomogeneity(); + fn test_field_CreateKernelV2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).CreateKernelV2) as usize - ptr as usize + }, + 136usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(CreateKernelV2) + ) + ); + } + test_field_CreateKernelV2(); + fn test_field_KernelComputeV2() { + assert_eq!( + unsafe { + let uninit = ::std::mem::MaybeUninit::::uninit(); + let ptr = uninit.as_ptr(); + ::std::ptr::addr_of!((*ptr).KernelComputeV2) as usize - ptr as usize + }, + 144usize, + concat!( + "Offset of field: ", + stringify!(OrtCustomOp), + "::", + stringify!(KernelComputeV2) + ) + ); + } + test_field_KernelComputeV2(); } extern "C" { pub fn OrtSessionOptionsAppendExecutionProvider_CUDA( @@ -7436,9 +8276,21 @@ extern "C" { device_id: ::std::os::raw::c_int, ) -> OrtStatusPtr; } +extern "C" { + pub fn OrtSessionOptionsAppendExecutionProvider_ROCM( + options: *mut OrtSessionOptions, + device_id: ::std::os::raw::c_int, + ) -> OrtStatusPtr; +} extern "C" { pub fn OrtSessionOptionsAppendExecutionProvider_MIGraphX( options: *mut OrtSessionOptions, device_id: ::std::os::raw::c_int, ) -> OrtStatusPtr; } +extern "C" { + pub fn OrtSessionOptionsAppendExecutionProvider_Dnnl( + options: *mut OrtSessionOptions, + use_arena: ::std::os::raw::c_int, + ) -> OrtStatusPtr; +}