diff --git a/CHANGELOG.md b/CHANGELOG.md index 08bac4d..0d18892 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.21.0] - 2023-09-25 + +### Added + +- Support ONNX Runtime v1.16.0. + ## [0.20.0] - 2023-06-19 ### Added @@ -164,7 +170,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support ONNX Runtime v1.5. -[Unreleased]: https://github.com/furiosa-ai/onnxrt/compare/0.20.0...HEAD +[Unreleased]: https://github.com/furiosa-ai/onnxrt/compare/0.21.0...HEAD +[0.21.0]: https://github.com/furiosa-ai/onnxrt/compare/0.20.0...0.21.0 [0.20.0]: https://github.com/furiosa-ai/onnxrt/compare/0.19.0...0.20.0 [0.19.0]: https://github.com/furiosa-ai/onnxrt/compare/0.18.1...0.19.0 [0.18.1]: https://github.com/furiosa-ai/onnxrt/compare/0.18.0...0.18.1 diff --git a/Cargo.toml b/Cargo.toml index 55682e6..68db67d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "onnxrt" -version = "0.20.0" +version = "0.21.0" authors = ["FuriosaAI, Inc."] description = "OnnxRt provides mid-level Rust bindings to the C API for Microsoft's ONNX Runtime." license = "MIT OR Apache-2.0" @@ -8,7 +8,7 @@ readme = "README.md" repository = "https://github.com/furiosa-ai/onnxrt" keywords = ["onnx", "neuralnetworks", "ffi", "bindings"] categories = ["science", "external-ffi-bindings"] -documentation = "https://furiosa-ai.github.io/onnxrt/0.20.0/onnxrt" +documentation = "https://furiosa-ai.github.io/onnxrt/0.21.0/onnxrt" edition = "2021" [dependencies] diff --git a/README.md b/README.md index d8ad772..645a1b4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # OnnxRt [![build status](https://github.com/furiosa-ai/onnxrt/actions/workflows/build.yml/badge.svg)](https://github.com/furiosa-ai/onnxrt/actions/workflows/build.yml?query=branch%3Amain) -[![docs](https://img.shields.io/badge/docs-0.20.0-blue.svg)](https://furiosa-ai.github.io/onnxrt/0.20.0/onnxrt/) +[![docs](https://img.shields.io/badge/docs-0.21.0-blue.svg)](https://furiosa-ai.github.io/onnxrt/0.21.0/onnxrt/) OnnxRt provides mid-level Rust bindings to [the C API] for Microsoft's [ONNX -Runtime] v1.15.1. +Runtime] v1.16.0. [the C API]: https://onnxruntime.ai/docs/api/c/ [ONNX Runtime]: https://www.onnxruntime.ai/ @@ -21,7 +21,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -onnxrt = { git = "https://github.com/furiosa-ai/onnxrt", tag = "0.20.0" } +onnxrt = { git = "https://github.com/furiosa-ai/onnxrt", tag = "0.21.0" } ``` ## Example diff --git a/src/lib.rs b/src/lib.rs index 19c7d2e..7ed30e0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ -//! [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h) +//! [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h) -#![doc(html_root_url = "https://furiosa-ai.github.io/onnxrt/0.20.0/onnxrt")] +#![doc(html_root_url = "https://furiosa-ai.github.io/onnxrt/0.21.0/onnxrt")] #![warn(rust_2018_idioms)] #[cfg(target_family = "unix")] @@ -165,7 +165,7 @@ pub struct Env { } impl Env { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L718-L726) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L746-L754) pub fn new(logging_level: OrtLoggingLevel, log_id: &str) -> self::Result { let mut env = ptr::null_mut::(); let log_id = CString::new(log_id)?; @@ -173,7 +173,7 @@ impl Env { Ok(Self { raw: NonNull::new(env).unwrap() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2056-L2070) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2084-L2098) pub fn new_with_global_thread_pools( logging_level: OrtLoggingLevel, log_id: &str, @@ -190,7 +190,7 @@ impl Env { Ok(Self { raw: NonNull::new(env).unwrap() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L728-L740) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L756-L768) pub fn new_with_custom_logger( logging_function: OrtLoggingFunction, logger_param: Option<&'static mut T>, @@ -211,7 +211,7 @@ impl Env { Ok(Self { raw: NonNull::new(env).unwrap() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2499-L2515) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2527-L2543) pub fn new_with_custom_logger_and_global_thread_pools( logging_function: OrtLoggingFunction, logger_param: Option<&'static mut T>, @@ -234,7 +234,7 @@ impl Env { Ok(Self { raw: NonNull::new(env).unwrap() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3694-L3701) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3732-L3739) pub fn set_custom_log_level(&mut self, logging_level: OrtLoggingLevel) { panic_on_error!(ORT_API.UpdateEnvWithCustomLogLevel.unwrap()( self.raw.as_ptr(), @@ -242,36 +242,206 @@ impl Env { )); } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L742-L749) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L770-L777) pub fn enable_telemetry_events(&self) { panic_on_error!(ORT_API.EnableTelemetryEvents.unwrap()(self.raw.as_ptr())); } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L750-L757) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L778-L785) pub fn disable_telemetry_events(&self) { panic_on_error!(ORT_API.DisableTelemetryEvents.unwrap()(self.raw.as_ptr())); } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2401-L2412) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2429-L2440) pub fn set_language_projection(&self, projection: OrtLanguageProjection) { panic_on_error!(ORT_API.SetLanguageProjection.unwrap()(self.raw.as_ptr(), projection)); } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2384-L2399) - pub fn create_and_register_allocator( + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L4311-L4325) + pub fn create_and_register_allocator, V: AsRef>( &mut self, + provider_type: &str, memory_info: &MemoryInfo, arena_cfg: Option<&ArenaCfg>, + provider_options_keys: &[K], + provider_options_values: &[V], + ) -> self::Result<()> { + assert_eq!(provider_options_keys.len(), provider_options_values.len()); + unsafe { + self.create_and_register_allocator_unchecked( + provider_type, + memory_info, + arena_cfg, + provider_options_keys, + provider_options_values, + ) + } + } + + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L4311-L4325) + /// + /// # Safety + /// + /// The length of `provider_options_keys` must be equal to that of `provider_options_values`. + pub unsafe fn create_and_register_allocator_unchecked, V: AsRef>( + &mut self, + provider_type: &str, + memory_info: &MemoryInfo, + arena_cfg: Option<&ArenaCfg>, + provider_options_keys: &[K], + provider_options_values: &[V], + ) -> self::Result<()> { + let provider_type_c_string = CString::new(provider_type)?; + let provider_options_keys_c_string = (provider_options_keys.iter()) + .map(AsRef::as_ref) + .map(CString::new) + .collect::, _>>()?; + let provider_options_values_c_string = (provider_options_values.iter()) + .map(AsRef::as_ref) + .map(CString::new) + .collect::, _>>()?; + self.create_and_register_allocator_with_c_str_unchecked( + &provider_type_c_string, + memory_info, + arena_cfg, + &provider_options_keys_c_string, + &provider_options_values_c_string, + ) + } + + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L4311-L4325) + pub fn create_and_register_allocator_with_c_str, V: AsRef>( + &mut self, + provider_type: &CStr, + memory_info: &MemoryInfo, + arena_cfg: Option<&ArenaCfg>, + provider_options_keys: &[K], + provider_options_values: &[V], + ) -> self::Result<()> { + assert_eq!(provider_options_keys.len(), provider_options_values.len()); + unsafe { + self.create_and_register_allocator_with_c_str_unchecked( + provider_type, + memory_info, + arena_cfg, + provider_options_keys, + provider_options_values, + ) + } + } + + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L4311-L4325) + /// + /// # Safety + /// + /// The length of `provider_options_keys` must be equal to that of `provider_options_values`. + pub unsafe fn create_and_register_allocator_with_c_str_unchecked< + K: AsRef, + V: AsRef, + >( + &mut self, + provider_type: &CStr, + memory_info: &MemoryInfo, + arena_cfg: Option<&ArenaCfg>, + provider_options_keys: &[K], + provider_options_values: &[V], ) -> self::Result<()> { - bail_on_error!(ORT_API.CreateAndRegisterAllocator.unwrap()( + let provider_type_c_char = provider_type.as_ptr(); + let provider_options_keys_c_char = + provider_options_keys.iter().map(|x| x.as_ref().as_ptr()).collect::>(); + let provider_options_values_c_char = + provider_options_values.iter().map(|x| x.as_ref().as_ptr()).collect::>(); + self.create_and_register_allocator_with_c_chars_with_nul( + provider_type_c_char, + memory_info, + arena_cfg, + &provider_options_keys_c_char, + &provider_options_values_c_char, + ) + } + + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L4311-L4325) + pub fn create_and_register_allocator_with_bytes_with_nul( + &mut self, + provider_type: &[u8], + memory_info: &MemoryInfo, + arena_cfg: Option<&ArenaCfg>, + provider_options_keys: &[&[u8]], + provider_options_values: &[&[u8]], + ) -> self::Result<()> { + assert_eq!(provider_options_keys.len(), provider_options_values.len()); + assert!(provider_type.ends_with(&[b'\0'])); + assert!(provider_options_keys.iter().all(|x| x.ends_with(&[b'\0']))); + assert!(provider_options_values.iter().all(|x| x.ends_with(&[b'\0']))); + unsafe { + self.create_and_register_allocator_with_bytes_with_nul_unchecked( + provider_type, + memory_info, + arena_cfg, + provider_options_keys, + provider_options_values, + ) + } + } + + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L4311-L4325) + /// + /// # Safety + /// + /// The length of `provider_options_keys` must be equal to that of `provider_options_values`. + /// `provider_type` and every slice in `provider_options_keys` and `provider_options_values` + /// must be a null-terminated string. + pub unsafe fn create_and_register_allocator_with_bytes_with_nul_unchecked( + &mut self, + provider_type: &[u8], + memory_info: &MemoryInfo, + arena_cfg: Option<&ArenaCfg>, + provider_options_keys: &[&[u8]], + provider_options_values: &[&[u8]], + ) -> self::Result<()> { + let provider_type_c_char = provider_type.as_ptr() as *const c_char; + let provider_options_keys_c_char = + provider_options_keys.iter().map(|x| x.as_ptr() as *const c_char).collect::>(); + let provider_options_values_c_char = + provider_options_values.iter().map(|x| x.as_ptr() as *const c_char).collect::>(); + self.create_and_register_allocator_with_c_chars_with_nul( + provider_type_c_char, + memory_info, + arena_cfg, + &provider_options_keys_c_char, + &provider_options_values_c_char, + ) + } + + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L4311-L4325) + /// + /// # Safety + /// + /// The length of `provider_options_keys` must be equal to that of `provider_options_values`. + /// `provider_type` and every pointer in `provider_options_keys` and `provider_options_values` + /// must be a null-terminated string. + pub unsafe fn create_and_register_allocator_with_c_chars_with_nul( + &mut self, + provider_type: *const c_char, + memory_info: &MemoryInfo, + arena_cfg: Option<&ArenaCfg>, + provider_options_keys: &[*const c_char], + provider_options_values: &[*const c_char], + ) -> self::Result<()> { + debug_assert_eq!(provider_options_keys.len(), provider_options_values.len()); + bail_on_error!(ORT_API.CreateAndRegisterAllocatorV2.unwrap()( self.raw.as_ptr(), + provider_type, memory_info.raw.as_ptr(), arena_cfg.map(|cfg| cfg.raw.as_ptr()).unwrap_or(ptr::null_mut::()), + provider_options_keys.as_ptr(), + provider_options_values.as_ptr(), + provider_options_keys.len(), )); Ok(()) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2927-L2942) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2959-L2974) pub fn register_allocator(&mut self, allocator: &mut Allocator) -> self::Result<()> { bail_on_error!(ORT_API.RegisterAllocator.unwrap()( self.raw.as_ptr(), @@ -280,7 +450,7 @@ impl Env { Ok(()) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2944-L2955) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2976-L2987) pub fn unregister_allocator(&mut self, memory_info: &MemoryInfo) -> self::Result<()> { bail_on_error!(ORT_API.UnregisterAllocator.unwrap()( self.raw.as_ptr(), @@ -291,7 +461,7 @@ impl Env { } impl Drop for Env { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1815) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1843) fn drop(&mut self) { unsafe { ORT_API.ReleaseEnv.unwrap()(self.raw.as_ptr()); @@ -309,14 +479,14 @@ pub struct RunOptions { } impl RunOptions { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1166-L1172) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1194-L1200) pub fn new() -> Self { let mut options = ptr::null_mut::(); panic_on_error!(ORT_API.CreateRunOptions.unwrap()(&mut options)); Self { raw: NonNull::new(options).unwrap() } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1174-L1183) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1202-L1211) pub fn set_log_verbosity_level(&mut self, level: i32) -> &mut Self { panic_on_error!(ORT_API.RunOptionsSetRunLogVerbosityLevel.unwrap()( self.raw.as_ptr(), @@ -325,7 +495,7 @@ impl RunOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1205-L1215) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1233-L1243) pub fn log_verbosity_level(&self) -> i32 { let mut level = 0; panic_on_error!(ORT_API.RunOptionsGetRunLogVerbosityLevel.unwrap()( @@ -335,7 +505,7 @@ impl RunOptions { level } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1185-L1192) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1213-L1220) pub fn set_log_severity_level(&mut self, level: i32) -> &mut Self { panic_on_error!(ORT_API.RunOptionsSetRunLogSeverityLevel.unwrap()( self.raw.as_ptr(), @@ -344,7 +514,7 @@ impl RunOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1217-L1224) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1245-L1252) pub fn log_severity_level(&self) -> i32 { let mut level = 0; panic_on_error!(ORT_API.RunOptionsGetRunLogSeverityLevel.unwrap()( @@ -354,33 +524,33 @@ impl RunOptions { level } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1194-L1203) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1222-L1231) pub fn set_tag(&mut self, tag: &str) -> self::Result<&mut Self> { let tag = CString::new(tag)?; panic_on_error!(ORT_API.RunOptionsSetRunTag.unwrap()(self.raw.as_ptr(), tag.as_ptr())); Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1226-L1237) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1254-L1265) pub fn tag(&self) -> self::Result<&str> { let mut tag = ptr::null::(); panic_on_error!(ORT_API.RunOptionsGetRunTag.unwrap()(self.raw.as_ptr(), &mut tag)); Ok(unsafe { CStr::from_ptr(tag) }.to_str()?) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1239-L1247) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1267-L1275) pub fn set_terminate(&mut self) -> &mut Self { panic_on_error!(ORT_API.RunOptionsSetTerminate.unwrap()(self.raw.as_ptr())); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1249-L1257) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1277-L1285) pub fn unset_terminate(&mut self) -> &mut Self { panic_on_error!(ORT_API.RunOptionsUnsetTerminate.unwrap()(self.raw.as_ptr())); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2749-L2762) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2781-L2794) pub fn set, V: AsRef>( &mut self, config_key: K, @@ -396,7 +566,7 @@ impl RunOptions { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2749-L2762) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2781-L2794) pub fn set_with_c_str, V: AsRef>( &mut self, config_key: K, @@ -410,7 +580,7 @@ impl RunOptions { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2749-L2762) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2781-L2794) pub fn set_with_bytes_with_nul( &mut self, config_key: &[u8], @@ -421,7 +591,7 @@ impl RunOptions { unsafe { self.set_with_bytes_with_nul_unchecked(config_key, config_value) } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2749-L2762) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2781-L2794) /// /// # Safety /// @@ -437,7 +607,7 @@ impl RunOptions { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2749-L2762) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2781-L2794) /// /// # Safety /// @@ -463,7 +633,7 @@ impl Default for RunOptions { } impl Drop for RunOptions { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1835) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1863) fn drop(&mut self) { unsafe { ORT_API.ReleaseRunOptions.unwrap()(self.raw.as_ptr()); @@ -477,14 +647,14 @@ pub struct SessionOptions { } impl SessionOptions { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L821-L836) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L849-L864) pub fn new() -> Self { let mut session_options = ptr::null_mut::(); panic_on_error!(ORT_API.CreateSessionOptions.unwrap()(&mut session_options)); Self { raw: NonNull::new(session_options).unwrap() } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L971-L984) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L999-L1012) pub fn set_intra_op_num_threads(&mut self, intra_op_num_threads: i32) -> &mut Self { panic_on_error!(ORT_API.SetIntraOpNumThreads.unwrap()( self.raw.as_ptr(), @@ -493,7 +663,7 @@ impl SessionOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L986-L998) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1014-L1026) pub fn set_inter_op_num_threads(&mut self, inter_op_num_threads: i32) -> &mut Self { panic_on_error!(ORT_API.SetInterOpNumThreads.unwrap()( self.raw.as_ptr(), @@ -502,7 +672,7 @@ impl SessionOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L960-L969) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L988-L997) pub fn set_graph_optimization_level( &mut self, graph_optimization_level: GraphOptimizationLevel, @@ -514,19 +684,19 @@ impl SessionOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L913-L921) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L941-L949) pub fn enable_cpu_mem_arena(&mut self) -> &mut Self { panic_on_error!(ORT_API.EnableCpuMemArena.unwrap()(self.raw.as_ptr())); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L923-L929) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L951-L957) pub fn disable_cpu_mem_arena(&mut self) -> &mut Self { panic_on_error!(ORT_API.DisableCpuMemArena.unwrap()(self.raw.as_ptr())); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L838-L846) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L866-L874) pub fn set_optimized_model_file_path>( &mut self, optimized_model_file_path: P, @@ -545,7 +715,7 @@ impl SessionOptions { Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L871-L878) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L899-L906) pub fn enable_profiling>( &mut self, profile_file_prefix: P, @@ -564,25 +734,25 @@ impl SessionOptions { Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L880-L886) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L908-L914) pub fn disable_profiling(&mut self) -> &mut Self { panic_on_error!(ORT_API.DisableProfiling.unwrap()(self.raw.as_ptr())); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L888-L901) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L916-L929) pub fn enable_mem_pattern(&mut self) -> &mut Self { panic_on_error!(ORT_API.EnableMemPattern.unwrap()(self.raw.as_ptr())); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L903-L911) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L931-L939) pub fn disable_mem_pattern(&mut self) -> &mut Self { panic_on_error!(ORT_API.DisableMemPattern.unwrap()(self.raw.as_ptr())); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L858-L869) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L886-L897) pub fn set_execution_mode(&mut self, execution_mode: ExecutionMode) -> &mut Self { panic_on_error!(ORT_API.SetSessionExecutionMode.unwrap()( self.raw.as_ptr(), @@ -591,38 +761,38 @@ impl SessionOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L931-L938) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L959-L966) pub fn set_log_id(&mut self, log_id: &str) -> self::Result<&mut Self> { let log_id = CString::new(log_id)?; panic_on_error!(ORT_API.SetSessionLogId.unwrap()(self.raw.as_ptr(), log_id.as_ptr(),)); Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L940-L949) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L968-L977) pub fn set_log_verbosity_level(&mut self, level: i32) -> &mut Self { panic_on_error!(ORT_API.SetSessionLogVerbosityLevel.unwrap()(self.raw.as_ptr(), level,)); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L951-L958) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L979-L986) pub fn set_log_severity_level(&mut self, level: i32) -> &mut Self { panic_on_error!(ORT_API.SetSessionLogSeverityLevel.unwrap()(self.raw.as_ptr(), level,)); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2076-L2085) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2104-L2113) pub fn disable_per_session_threads(&mut self) -> &mut Self { panic_on_error!(ORT_API.DisablePerSessionThreads.unwrap()(self.raw.as_ptr())); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2915-L2921) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2947-L2953) pub fn enable_ort_custom_ops(&mut self) -> &mut Self { panic_on_error!(ORT_API.EnableOrtCustomOps.unwrap()(self.raw.as_ptr())); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2200-L2213) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2228-L2241) pub fn set_session_config_entry( &mut self, config_key: &str, @@ -638,7 +808,7 @@ impl SessionOptions { Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3924-L3953) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3962-L3991) pub fn session_config_entry(&self, config_key: &str) -> self::Result { let config_key = CString::new(config_key)?; let mut size = 0; @@ -661,7 +831,7 @@ impl SessionOptions { Ok(CString::from_vec_with_nul(config_value)?.into_string()?) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3906-L3922) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3944-L3960) pub fn has_session_config_entry(&self, config_key: &str) -> self::Result { let config_key = CString::new(config_key)?; let mut has_session_config_entry = 0; @@ -673,7 +843,7 @@ impl SessionOptions { Ok(has_session_config_entry != 0) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1598-L1610) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1626-L1638) pub fn set_free_dimension_by_denotation( &mut self, dim_denotation: &str, @@ -688,7 +858,7 @@ impl SessionOptions { Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2122-L2131) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2150-L2159) pub fn set_free_dimension_by_name( &mut self, dim_name: &str, @@ -703,7 +873,7 @@ impl SessionOptions { Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2478-L2493) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2506-L2521) pub fn set_initializer<'s, 'v: 's>( &'s mut self, name: &str, @@ -718,7 +888,7 @@ impl SessionOptions { Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3430-L3453) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3462-L3485) pub fn set_external_initializers<'s, 'v: 's, I: AsRef>( &'s mut self, initializer_names: &[I], @@ -728,7 +898,7 @@ impl SessionOptions { unsafe { self.set_external_initializers_unchecked(initializer_names, initializers) } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3430-L3453) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3462-L3485) /// /// # Safety /// @@ -748,7 +918,7 @@ impl SessionOptions { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3430-L3453) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3462-L3485) pub fn set_external_initializers_with_c_str<'s, 'v: 's, I: AsRef>( &'s mut self, initializer_names: &[I], @@ -760,7 +930,7 @@ impl SessionOptions { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3430-L3453) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3462-L3485) /// /// # Safety /// @@ -778,7 +948,7 @@ impl SessionOptions { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3430-L3453) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3462-L3485) pub fn set_external_initializers_with_bytes_with_nul<'s, 'v: 's>( &'s mut self, initializer_names: &[&[u8]], @@ -794,7 +964,7 @@ impl SessionOptions { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3430-L3453) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3462-L3485) /// /// # Safety /// @@ -813,7 +983,7 @@ impl SessionOptions { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3430-L3453) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3462-L3485) /// /// # Safety /// @@ -834,7 +1004,7 @@ impl SessionOptions { Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3251-L3258) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3283-L3290) pub fn set_custom_create_thread_fn( &mut self, custom_create_thread_fn: OrtCustomCreateThreadFn, @@ -846,7 +1016,7 @@ impl SessionOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3260-L3267) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3292-L3299) #[allow(clippy::not_unsafe_ptr_arg_deref)] pub fn set_custom_thread_creation_options( &mut self, @@ -859,7 +1029,7 @@ impl SessionOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3269-L3276) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3301-L3308) pub fn set_custom_join_thread_fn( &mut self, custom_join_thread_fn: OrtCustomJoinThreadFn, @@ -871,7 +1041,7 @@ impl SessionOptions { self } - /// [`cpu_provider_factory.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/providers/cpu/cpu_provider_factory.h#L10-L15) + /// [`cpu_provider_factory.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/providers/cpu/cpu_provider_factory.h#L10-L15) pub fn append_execution_provider_cpu(&mut self, use_arena: bool) -> self::Result<&mut Self> { bail_on_error!(onnxrt_sys::OrtSessionOptionsAppendExecutionProvider_CPU( self.raw.as_ptr(), @@ -880,7 +1050,7 @@ impl SessionOptions { Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3332-L3352) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3364-L3384) pub fn append_execution_provider_cuda( &mut self, cuda_options: &CudaProviderOptions, @@ -892,7 +1062,7 @@ impl SessionOptions { Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3539-L3583) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3571-L3621) pub fn append_execution_provider, V: AsRef>( &mut self, provider_name: &str, @@ -909,7 +1079,7 @@ impl SessionOptions { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3539-L3583) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3571-L3621) /// /// # Safety /// @@ -936,7 +1106,7 @@ impl SessionOptions { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3539-L3583) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3571-L3621) pub fn append_execution_provider_with_c_str, V: AsRef>( &mut self, provider_name: &CStr, @@ -953,7 +1123,7 @@ impl SessionOptions { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3539-L3583) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3571-L3621) /// /// # Safety /// @@ -976,7 +1146,7 @@ impl SessionOptions { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3539-L3583) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3571-L3621) pub fn append_execution_provider_with_bytes_with_nul( &mut self, provider_name: &[u8], @@ -984,7 +1154,7 @@ impl SessionOptions { provider_options_values: &[&[u8]], ) -> self::Result<&mut Self> { assert_eq!(provider_options_keys.len(), provider_options_values.len()); - assert!(provider_name.ends_with(&[b'\n'])); + assert!(provider_name.ends_with(&[b'\0'])); assert!(provider_options_keys.iter().all(|x| x.ends_with(&[b'\0']))); assert!(provider_options_values.iter().all(|x| x.ends_with(&[b'\0']))); unsafe { @@ -996,7 +1166,7 @@ impl SessionOptions { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3539-L3583) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3571-L3621) /// /// # Safety /// @@ -1021,7 +1191,7 @@ impl SessionOptions { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3539-L3583) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3571-L3621) /// /// # Safety /// @@ -1047,7 +1217,7 @@ impl SessionOptions { } impl Clone for SessionOptions { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L848-L856) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L876-L884) fn clone(&self) -> Self { let mut session_options = ptr::null_mut::(); panic_on_error!(ORT_API.CloneSessionOptions.unwrap()( @@ -1065,7 +1235,7 @@ impl Default for SessionOptions { } impl Drop for SessionOptions { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1847) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1875) fn drop(&mut self) { unsafe { ORT_API.ReleaseSessionOptions.unwrap()(self.raw.as_ptr()); @@ -1079,7 +1249,7 @@ pub struct ModelMetadata { } impl ModelMetadata { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1984-L1993) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2012-L2021) pub fn producer_name(&self, allocator: &mut Allocator) -> self::Result { let allocator = allocator.raw.as_ptr(); let mut name_ptr = ptr::null_mut::(); @@ -1095,7 +1265,7 @@ impl ModelMetadata { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1995-L2004) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2023-L2032) pub fn graph_name(&self, allocator: &mut Allocator) -> self::Result { let allocator = allocator.raw.as_ptr(); let mut name_ptr = ptr::null_mut::(); @@ -1111,7 +1281,7 @@ impl ModelMetadata { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2598-L2610) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2626-L2638) pub fn graph_description(&self, allocator: &mut Allocator) -> self::Result { let allocator = allocator.raw.as_ptr(); let mut description_ptr = ptr::null_mut::(); @@ -1127,7 +1297,7 @@ impl ModelMetadata { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2006-L2015) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2034-L2043) pub fn domain(&self, allocator: &mut Allocator) -> self::Result { let allocator = allocator.raw.as_ptr(); let mut domain_ptr = ptr::null_mut::(); @@ -1143,7 +1313,7 @@ impl ModelMetadata { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2017-L2026) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2045-L2054) pub fn description(&self, allocator: &mut Allocator) -> self::Result { let allocator = allocator.raw.as_ptr(); let mut description_ptr = ptr::null_mut::(); @@ -1159,7 +1329,7 @@ impl ModelMetadata { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2104-L2116) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2132-L2144) pub fn custom_metadata_map_keys(&self, allocator: &mut Allocator) -> self::Result> { let allocator = allocator.raw.as_ptr(); let mut keys_ptr = ptr::null_mut::<*mut c_char>(); @@ -1186,7 +1356,7 @@ impl ModelMetadata { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2028-L2039) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2056-L2067) pub fn lookup_custom_metadata_map( &self, allocator: &mut Allocator, @@ -1212,7 +1382,7 @@ impl ModelMetadata { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2041-L2048) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2069-L2076) pub fn version(&self) -> i64 { let mut version = 0; panic_on_error!(ORT_API.ModelMetadataGetVersion.unwrap()(self.raw.as_ptr(), &mut version)); @@ -1221,7 +1391,7 @@ impl ModelMetadata { } impl Drop for ModelMetadata { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2050) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2078) fn drop(&mut self) { unsafe { ORT_API.ReleaseModelMetadata.unwrap()(self.raw.as_ptr()); @@ -1239,7 +1409,7 @@ pub struct Session { } impl Session { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L763-L778) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L791-L806) pub fn new_with_model_path>( env: Arc>, model_path: P, @@ -1260,7 +1430,7 @@ impl Session { Ok(Session { raw: NonNull::new(session).unwrap(), env, prepacked_weights_container: None }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2792-L2811) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2824-L2843) pub fn new_with_model_path_and_prepacked_weights_container>( env: Arc>, model_path: P, @@ -1287,7 +1457,7 @@ impl Session { }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L780-L791) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L808-L819) pub fn new_with_model_data( env: Arc>, model_data: &[u8], @@ -1304,7 +1474,7 @@ impl Session { Ok(Session { raw: NonNull::new(session).unwrap(), env, prepacked_weights_container: None }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2813-L2834) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2845-L2866) pub fn new_with_model_data_and_prepacked_weights_container( env: Arc>, model_data: &[u8], @@ -1327,7 +1497,7 @@ impl Session { }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L793-L815) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L821-L843) pub fn run, O: AsRef>( &mut self, run_options: Option<&RunOptions>, @@ -1343,7 +1513,7 @@ impl Session { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L793-L815) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L821-L843) /// /// # Safety /// @@ -1374,7 +1544,7 @@ impl Session { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L793-L815) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L821-L843) pub fn run_with_c_str, O: AsRef>( &mut self, run_options: Option<&RunOptions>, @@ -1396,7 +1566,7 @@ impl Session { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L793-L815) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L821-L843) /// /// # Safety /// @@ -1423,7 +1593,7 @@ impl Session { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L793-L815) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L821-L843) pub fn run_with_bytes_with_nul( &mut self, run_options: Option<&RunOptions>, @@ -1447,7 +1617,7 @@ impl Session { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L793-L815) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L821-L843) /// /// # Safety /// @@ -1475,7 +1645,7 @@ impl Session { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L793-L815) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L821-L843) /// /// # Safety /// @@ -1505,7 +1675,7 @@ impl Session { Ok(()) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2238-L2248) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2266-L2276) pub fn run_with_binding( &mut self, run_options: &RunOptions, @@ -1519,21 +1689,21 @@ impl Session { Ok(()) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1061-L1072) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1089-L1100) pub fn input_count(&self) -> self::Result { let mut count = 0; bail_on_error!(ORT_API.SessionGetInputCount.unwrap()(self.raw.as_ptr(), &mut count)); Ok(count) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1074-L1085) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1102-L1113) pub fn output_count(&self) -> self::Result { let mut count = 0; bail_on_error!(ORT_API.SessionGetOutputCount.unwrap()(self.raw.as_ptr(), &mut count)); Ok(count) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1087-L1096) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1115-L1124) pub fn overridable_initializer_count(&self) -> self::Result { let mut count = 0; bail_on_error!(ORT_API.SessionGetOverridableInitializerCount.unwrap()( @@ -1547,7 +1717,7 @@ impl Session { self.input_name_using_allocator(index, &mut ALLOCATOR_WITH_DEFAULT_OPTIONS.lock().unwrap()) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1128-L1137) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1156-L1165) pub fn input_name_using_allocator( &self, index: usize, @@ -1572,7 +1742,7 @@ impl Session { self.output_name_using_allocator(index, &mut ALLOCATOR_WITH_DEFAULT_OPTIONS.lock().unwrap()) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1139-L1148) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1167-L1176) pub fn output_name_using_allocator( &self, index: usize, @@ -1600,7 +1770,7 @@ impl Session { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1150-L1160) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1178-L1188) pub fn overridable_initializer_name_using_allocator( &self, index: usize, @@ -1672,7 +1842,7 @@ impl Session { .map(move |i| self.overridable_initializer_name_using_allocator(i, allocator))) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1959-L1969) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1987-L1997) pub fn end_profiling(&mut self, allocator: &mut Allocator) -> self::Result { let allocator = allocator.raw.as_ptr(); let mut profile_ptr = ptr::null_mut::(); @@ -1688,7 +1858,7 @@ impl Session { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2418-L2427) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2446-L2455) pub fn profiling_start_time_ns(&self) -> u64 { let mut time = 0; panic_on_error!(ORT_API.SessionGetProfilingStartTimeNs.unwrap()( @@ -1698,7 +1868,7 @@ impl Session { time } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1971-L1978) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1999-L2006) pub fn model_metadata(&self) -> self::Result { let mut model_metadata = ptr::null_mut::(); bail_on_error!(ORT_API.SessionGetModelMetadata.unwrap()( @@ -1708,7 +1878,7 @@ impl Session { Ok(ModelMetadata { raw: NonNull::new(model_metadata).unwrap() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1098-L1106) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1126-L1134) pub fn input_type_info(&self, index: usize) -> self::Result { let mut type_info = ptr::null_mut::(); bail_on_error!(ORT_API.SessionGetInputTypeInfo.unwrap()( @@ -1719,7 +1889,7 @@ impl Session { Ok(TypeInfo { raw: NonNull::new(type_info).unwrap() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1108-L1116) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1136-L1144) pub fn output_type_info(&self, index: usize) -> self::Result { let mut type_info = ptr::null_mut::(); bail_on_error!(ORT_API.SessionGetOutputTypeInfo.unwrap()( @@ -1730,7 +1900,7 @@ impl Session { Ok(TypeInfo { raw: NonNull::new(type_info).unwrap() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1118-L1126) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1146-L1154) pub fn overridable_initializer_type_info(&self, index: usize) -> self::Result { let mut type_info = ptr::null_mut::(); bail_on_error!(ORT_API.SessionGetOverridableInitializerTypeInfo.unwrap()( @@ -1743,7 +1913,7 @@ impl Session { } impl Drop for Session { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1827) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1855) fn drop(&mut self) { unsafe { ORT_API.ReleaseSession.unwrap()(self.raw.as_ptr()); @@ -1762,30 +1932,30 @@ pub struct TensorTypeAndShapeInfo { } impl TensorTypeAndShapeInfo { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1389-L1395) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1417-L1423) pub fn new() -> Self { let mut tensor_type_info = ptr::null_mut::(); panic_on_error!(ORT_API.CreateTensorTypeAndShapeInfo.unwrap()(&mut tensor_type_info)); Self { raw: NonNull::new(tensor_type_info).unwrap() } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1397-L1404) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1425-L1432) pub fn set_element_type(&mut self, typ: ONNXTensorElementDataType) -> &mut Self { panic_on_error!(ORT_API.SetTensorElementType.unwrap()(self.raw.as_ptr(), typ)); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1416-L1426) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1444-L1454) pub fn element_type(&self) -> ONNXTensorElementDataType { element_type(unsafe { self.raw.as_ref() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1461-L1477) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1489-L1505) pub fn element_count(&self) -> self::Result { element_count(unsafe { self.raw.as_ref() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1406-L1414) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1434-L1442) pub fn set_dimensions(&mut self, dims: &[i64]) -> &mut Self { panic_on_error!(ORT_API.SetDimensions.unwrap()( self.raw.as_ptr(), @@ -1795,17 +1965,17 @@ impl TensorTypeAndShapeInfo { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1428-L1437) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1456-L1465) pub fn dimensions_count(&self) -> usize { dimensions_count(unsafe { self.raw.as_ref() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1439-L1448) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1467-L1476) pub fn dimensions(&self) -> Vec { dimensions(unsafe { self.raw.as_ref() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1450-L1459) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1478-L1487) pub fn symbolic_dimensions(&self) -> self::Result> { symbolic_dimensions(unsafe { self.raw.as_ref() }) } @@ -1818,7 +1988,7 @@ impl Default for TensorTypeAndShapeInfo { } impl Drop for TensorTypeAndShapeInfo { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1843) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1871) fn drop(&mut self) { unsafe { ORT_API.ReleaseTensorTypeAndShapeInfo.unwrap()(self.raw.as_ptr()); @@ -1832,40 +2002,40 @@ pub struct UnownedTensorTypeAndShapeInfo<'a> { } impl<'a> UnownedTensorTypeAndShapeInfo<'a> { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1416-L1426) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1444-L1454) pub fn element_type(&self) -> ONNXTensorElementDataType { element_type(self.raw) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1461-L1477) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1489-L1505) pub fn element_count(&self) -> self::Result { element_count(self.raw) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1428-L1437) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1456-L1465) pub fn dimensions_count(&self) -> usize { dimensions_count(self.raw) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1439-L1448) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1467-L1476) pub fn dimensions(&self) -> Vec { dimensions(self.raw) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1450-L1459) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1478-L1487) pub fn symbolic_dimensions(&self) -> self::Result> { symbolic_dimensions(self.raw) } } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1416-L1426) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1444-L1454) fn element_type(tensor_type_info: &OrtTensorTypeAndShapeInfo) -> ONNXTensorElementDataType { let mut typ = ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED; panic_on_error!(ORT_API.GetTensorElementType.unwrap()(tensor_type_info, &mut typ)); typ } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1461-L1477) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1489-L1505) fn element_count(tensor_type_info: &OrtTensorTypeAndShapeInfo) -> self::Result { let mut count = 0; bail_on_error!(ORT_API.GetTensorShapeElementCount.unwrap()( @@ -1876,14 +2046,14 @@ fn element_count(tensor_type_info: &OrtTensorTypeAndShapeInfo) -> self::Result usize { let mut count = 0; panic_on_error!(ORT_API.GetDimensionsCount.unwrap()(tensor_type_info, &mut count)); count } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1439-L1448) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1467-L1476) fn dimensions(tensor_type_info: &OrtTensorTypeAndShapeInfo) -> Vec { let mut dims = vec![0; dimensions_count(tensor_type_info)]; panic_on_error!(ORT_API.GetDimensions.unwrap()( @@ -1894,7 +2064,7 @@ fn dimensions(tensor_type_info: &OrtTensorTypeAndShapeInfo) -> Vec { dims } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1450-L1459) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1478-L1487) fn symbolic_dimensions(tensor_type_info: &OrtTensorTypeAndShapeInfo) -> self::Result> { let mut dimensions = vec![ptr::null::(); dimensions_count(tensor_type_info)]; panic_on_error!(ORT_API.GetSymbolicDimensions.unwrap()( @@ -1913,7 +2083,7 @@ pub struct TypeInfo { } impl TypeInfo { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1365-L1374) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1393-L1402) pub fn cast_to_tensor_type_info(&self) -> Option> { let mut tensor_info = ptr::null::(); panic_on_error!(ORT_API.CastTypeInfoToTensorInfo.unwrap()( @@ -1927,14 +2097,14 @@ impl TypeInfo { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1376-L1383) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1404-L1411) pub fn onnx_type(&self) -> ONNXType { let mut typ = ONNX_TYPE_UNKNOWN; panic_on_error!(ORT_API.GetOnnxTypeFromTypeInfo.unwrap()(self.raw.as_ptr(), &mut typ)); typ } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1857-L1870) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1885-L1898) pub fn denotation(&self) -> self::Result<&str> { let mut denotation = ptr::null::(); let mut length = 0; @@ -1948,7 +2118,7 @@ impl TypeInfo { } impl Drop for TypeInfo { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1839) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1867) fn drop(&mut self) { unsafe { ORT_API.ReleaseTypeInfo.unwrap()(self.raw.as_ptr()); @@ -2003,7 +2173,7 @@ impl<'d> Value<'d> { ) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1263-L1276) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1291-L1304) pub fn new_tensor_using_allocator( allocator: &mut Allocator, shape: &[i64], @@ -2020,7 +2190,7 @@ impl<'d> Value<'d> { Ok(Value { raw: value, phantom: PhantomData }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1278-L1295) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1306-L1323) pub fn new_tensor_with_data( memory_info: &MemoryInfo, data: &'d mut [T], @@ -2039,14 +2209,14 @@ impl<'d> Value<'d> { Ok(Value { raw: value, phantom: PhantomData }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1297-L1304) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1325-L1332) pub fn is_tensor(&self) -> bool { let mut result = 0; panic_on_error!(ORT_API.IsTensor.unwrap()(self.raw, &mut result)); result != 0 } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1306-L1316) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1334-L1344) /// /// # Safety /// @@ -2070,7 +2240,7 @@ impl<'d> Value<'d> { } let mut element_count = self.tensor_type_info()?.element_count()?; - // https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1413 + // https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1492 // // > If any dimension is less than 0, the result is always -1. if element_count < 0 { @@ -2080,7 +2250,7 @@ impl<'d> Value<'d> { Ok(unsafe { slice::from_raw_parts(data, element_count.try_into()?) }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1306-L1316) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1334-L1344) /// /// # Safety /// @@ -2104,7 +2274,7 @@ impl<'d> Value<'d> { } let mut element_count = self.tensor_type_info()?.element_count()?; - // https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1413 + // https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1492 // // > If any dimension is less than 0, the result is always -1. if element_count < 0 { @@ -2114,7 +2284,7 @@ impl<'d> Value<'d> { Ok(unsafe { slice::from_raw_parts_mut(data, element_count.try_into()?) }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2364-L2378) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2392-L2406) /// /// # Safety /// @@ -2130,7 +2300,7 @@ impl<'d> Value<'d> { Ok(&*element) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2364-L2378) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2392-L2406) /// /// # Safety /// @@ -2146,11 +2316,11 @@ impl<'d> Value<'d> { Ok(&mut *element) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1492-L1499) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1520-L1527) pub fn type_info(&self) -> self::Result> { let mut type_info = ptr::null_mut::(); bail_on_error!(ORT_API.GetTypeInfo.unwrap()(self.raw, &mut type_info)); - // https://github.com/microsoft/onnxruntime/blob/v1.15.1/onnxruntime/core/framework/tensor_type_and_shape.cc#L337-L343 + // https://github.com/microsoft/onnxruntime/blob/v1.16.0/onnxruntime/core/framework/tensor_type_and_shape.cc#L347-L353 // // > // TODO: This is consistent with the previous implementation but inconsistent with // > // GetValueType which returns ONNX_TYPE_UNKNOWN if v->Type() is null. Should we @@ -2167,28 +2337,28 @@ impl<'d> Value<'d> { }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1483-L1490) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1511-L1518) pub fn tensor_type_info(&self) -> self::Result { let mut tensor_type_info = ptr::null_mut::(); bail_on_error!(ORT_API.GetTensorTypeAndShape.unwrap()(self.raw, &mut tensor_type_info)); Ok(TensorTypeAndShapeInfo { raw: NonNull::new(tensor_type_info).unwrap() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3224-L3230) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3256-L3262) pub fn tensor_memory_info(&self) -> UnownedMemoryInfo<'_> { let mut memory_info = ptr::null::(); panic_on_error!(ORT_API.GetTensorMemoryInfo.unwrap()(self.raw, &mut memory_info)); UnownedMemoryInfo { raw: unsafe { &*memory_info } } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1501-L1508) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1529-L1536) pub fn value_type(&self) -> self::Result { let mut value_type = ONNX_TYPE_UNKNOWN; bail_on_error!(ORT_API.GetValueType.unwrap()(self.raw, &mut value_type)); Ok(value_type) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3189-L3201) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3221-L3233) pub fn has_value(&self) -> bool { let mut has_value = 0; panic_on_error!(ORT_API.HasValue.unwrap()(self.raw, &mut has_value)); @@ -2203,7 +2373,7 @@ impl<'d> Default for Value<'d> { } impl<'d> Drop for Value<'d> { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1831) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1859) fn drop(&mut self) { unsafe { ORT_API.ReleaseValue.unwrap()(self.raw); @@ -2218,7 +2388,7 @@ pub struct MemoryInfo { } impl MemoryInfo { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1514-L1525) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1542-L1553) pub fn new( name: &str, allocator_type: OrtAllocatorType, @@ -2237,7 +2407,7 @@ impl MemoryInfo { Ok(MemoryInfo { raw: NonNull::new(memory_info).unwrap() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1527-L1538) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1555-L1566) pub fn new_for_cpu(allocator_type: OrtAllocatorType, memory_type: OrtMemType) -> Self { let mut memory_info = ptr::null_mut::(); panic_on_error!(ORT_API.CreateCpuMemoryInfo.unwrap()( @@ -2248,34 +2418,34 @@ impl MemoryInfo { MemoryInfo { raw: NonNull::new(memory_info).unwrap() } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1552-L1559) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1580-L1587) pub fn allocator_name(&self) -> self::Result<&str> { memory_info_allocator_name(unsafe { self.raw.as_ref() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1569-L1571) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1597-L1599) pub fn allocator_type(&self) -> OrtAllocatorType { memory_info_allocator_type(unsafe { self.raw.as_ref() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1561-L1563) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1589-L1591) pub fn device_id(&self) -> i32 { memory_info_device_id(unsafe { self.raw.as_ref() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3688-L3692) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3726-L3730) pub fn device_type(&self) -> OrtMemoryInfoDeviceType { memory_info_device_type(unsafe { self.raw.as_ref() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1565-L1567) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1593-L1595) pub fn memory_type(&self) -> OrtMemType { memory_info_memory_type(unsafe { self.raw.as_ref() }) } } impl Drop for MemoryInfo { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1823) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1851) fn drop(&mut self) { unsafe { ORT_API.ReleaseMemoryInfo.unwrap()(self.raw.as_ptr()); @@ -2301,27 +2471,27 @@ pub struct UnownedMemoryInfo<'a> { } impl<'a> UnownedMemoryInfo<'a> { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1552-L1559) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1580-L1587) pub fn allocator_name(&self) -> self::Result<&str> { memory_info_allocator_name(self.raw) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1569-L1571) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1597-L1599) pub fn allocator_type(&self) -> OrtAllocatorType { memory_info_allocator_type(self.raw) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1561-L1563) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1589-L1591) pub fn device_id(&self) -> i32 { memory_info_device_id(self.raw) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3688-L3692) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3726-L3730) pub fn device_type(&self) -> OrtMemoryInfoDeviceType { memory_info_device_type(self.raw) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1565-L1567) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1593-L1595) pub fn memory_type(&self) -> OrtMemType { memory_info_memory_type(self.raw) } @@ -2339,42 +2509,42 @@ impl PartialEq for UnownedMemoryInfo<'_> { } } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1552-L1559) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1580-L1587) fn memory_info_allocator_name(memory_info: &OrtMemoryInfo) -> self::Result<&str> { let mut name = ptr::null::(); panic_on_error!(ORT_API.MemoryInfoGetName.unwrap()(memory_info, &mut name)); Ok(unsafe { CStr::from_ptr(name) }.to_str()?) } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1569-L1571) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1597-L1599) fn memory_info_allocator_type(memory_info: &OrtMemoryInfo) -> OrtAllocatorType { let mut allocator_type = OrtAllocatorType::OrtInvalidAllocator; panic_on_error!(ORT_API.MemoryInfoGetType.unwrap()(memory_info, &mut allocator_type)); allocator_type } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1561-L1563) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1589-L1591) fn memory_info_device_id(memory_info: &OrtMemoryInfo) -> i32 { let mut device_id = 0; panic_on_error!(ORT_API.MemoryInfoGetId.unwrap()(memory_info, &mut device_id)); device_id } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3688-L3692) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3726-L3730) fn memory_info_device_type(memory_info: &OrtMemoryInfo) -> OrtMemoryInfoDeviceType { let mut device_type = OrtMemoryInfoDeviceType_CPU; unsafe { ORT_API.MemoryInfoGetDeviceType.unwrap()(memory_info, &mut device_type) }; device_type } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1565-L1567) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1593-L1595) fn memory_info_memory_type(memory_info: &OrtMemoryInfo) -> OrtMemType { let mut memory_type = OrtMemTypeDefault; panic_on_error!(ORT_API.MemoryInfoGetMemType.unwrap()(memory_info, &mut memory_type)); memory_type } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1540-L1550) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1568-L1578) fn memory_info_is_equal(lhs: &OrtMemoryInfo, rhs: &OrtMemoryInfo) -> bool { let mut is_equal = 0; panic_on_error!(ORT_API.CompareMemoryInfo.unwrap()(lhs, rhs, &mut is_equal)); @@ -2387,7 +2557,7 @@ pub struct Allocator { } impl Allocator { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2219-L2228) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2247-L2256) pub fn new(session: &Session, memory_info: &MemoryInfo) -> self::Result { let mut allocator = ptr::null_mut::(); bail_on_error!(ORT_API.CreateAllocator.unwrap()( @@ -2398,7 +2568,7 @@ impl Allocator { Ok(Self { raw: NonNull::new(allocator).unwrap() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1577-L1578) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1605-L1606) pub fn alloc(&mut self) -> *mut T { let mut ptr = ptr::null_mut::(); panic_on_error!(ORT_API.AllocatorAlloc.unwrap()( @@ -2409,7 +2579,7 @@ impl Allocator { ptr } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1579-L1580) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1607-L1608) /// /// # Safety /// @@ -2418,7 +2588,7 @@ impl Allocator { panic_on_error!(ORT_API.AllocatorFree.unwrap()(self.raw.as_ptr(), ptr as *mut c_void)); } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L1581-L1582) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L1609-L1610) pub fn memory_info(&self) -> UnownedMemoryInfo<'_> { let mut memory_info = ptr::null::(); panic_on_error!(ORT_API.AllocatorGetInfo.unwrap()(self.raw.as_ptr(), &mut memory_info)); @@ -2427,7 +2597,7 @@ impl Allocator { } impl Drop for Allocator { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2230-L2232) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2258-L2260) fn drop(&mut self) { unsafe { ORT_API.ReleaseAllocator.unwrap()(self.raw.as_ptr()) } } @@ -2444,28 +2614,28 @@ pub struct IoBinding<'s> { } impl<'s> IoBinding<'s> { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2250-L2261) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2278-L2289) pub fn new(session: &'s mut Session) -> self::Result { let mut io_binding = ptr::null_mut::(); bail_on_error!(ORT_API.CreateIoBinding.unwrap()(session.raw.as_ptr(), &mut io_binding)); Ok(Self { raw: NonNull::new(io_binding).unwrap(), phantom: PhantomData }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2271-L2281) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2299-L2309) pub fn bind_input(&mut self, name: &str, value: &Value<'_>) -> self::Result<&mut Self> { let name = CString::new(name)?; bail_on_error!(ORT_API.BindInput.unwrap()(self.raw.as_ptr(), name.as_ptr(), value.raw)); Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2283-L2293) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2311-L2321) pub fn bind_output(&mut self, name: &str, value: &Value<'_>) -> self::Result<&mut Self> { let name = CString::new(name)?; panic_on_error!(ORT_API.BindOutput.unwrap()(self.raw.as_ptr(), name.as_ptr(), value.raw)); Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2295-L2310) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2323-L2338) pub fn bind_output_to_device( &mut self, name: &str, @@ -2480,7 +2650,7 @@ impl<'s> IoBinding<'s> { Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2312-L2330) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2340-L2358) pub fn bound_output_names(&self, allocator: &mut Allocator) -> self::Result> { let allocator = allocator.raw.as_ptr(); let mut buffer = ptr::null_mut::(); @@ -2513,7 +2683,7 @@ impl<'s> IoBinding<'s> { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2332-L2350) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2360-L2378) pub fn bound_output_values( &self, allocator: &mut Allocator, @@ -2541,27 +2711,27 @@ impl<'s> IoBinding<'s> { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2352-L2354) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2380-L2382) pub fn clear_bound_inputs(&mut self) { unsafe { ORT_API.ClearBoundInputs.unwrap()(self.raw.as_ptr()); } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2356-L2358) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2384-L2386) pub fn clear_bound_outputs(&mut self) { unsafe { ORT_API.ClearBoundOutputs.unwrap()(self.raw.as_ptr()); } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3309-L3317) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3341-L3349) pub fn synchronize_bound_inputs(&mut self) -> self::Result<()> { bail_on_error!(ORT_API.SynchronizeBoundInputs.unwrap()(self.raw.as_ptr())); Ok(()) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3319-L3327) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3351-L3359) pub fn synchronize_bound_outputs(&mut self) -> self::Result<()> { bail_on_error!(ORT_API.SynchronizeBoundOutputs.unwrap()(self.raw.as_ptr())); Ok(()) @@ -2569,7 +2739,7 @@ impl<'s> IoBinding<'s> { } impl<'s> Drop for IoBinding<'s> { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2267-L2269) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2295-L2297) fn drop(&mut self) { unsafe { ORT_API.ReleaseIoBinding.unwrap()(self.raw.as_ptr()) } } @@ -2581,14 +2751,14 @@ pub struct ThreadingOptions { } impl ThreadingOptions { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2091-L2096) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2119-L2124) pub fn new() -> Self { let mut threading_options = ptr::null_mut::(); panic_on_error!(ORT_API.CreateThreadingOptions.unwrap()(&mut threading_options)); Self { raw: NonNull::new(threading_options).unwrap() } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2433-L2444) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2461-L2472) pub fn set_global_intra_op_num_threads(&mut self, intra_op_num_threads: i32) -> &mut Self { panic_on_error!(ORT_API.SetGlobalIntraOpNumThreads.unwrap()( self.raw.as_ptr(), @@ -2597,7 +2767,7 @@ impl ThreadingOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2446-L2457) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2474-L2485) pub fn set_global_inter_op_num_threads(&mut self, inter_op_num_threads: i32) -> &mut Self { panic_on_error!(ORT_API.SetGlobalInterOpNumThreads.unwrap()( self.raw.as_ptr(), @@ -2606,7 +2776,7 @@ impl ThreadingOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3703-L3722) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3741-L3760) pub fn set_global_intra_op_thread_affinity( &mut self, affinity: &str, @@ -2619,7 +2789,7 @@ impl ThreadingOptions { Ok(self) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2459-L2472) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2487-L2500) pub fn set_global_spin_control(&mut self, allow_spinning: bool) -> &mut Self { panic_on_error!(ORT_API.SetGlobalSpinControl.unwrap()( self.raw.as_ptr(), @@ -2628,13 +2798,13 @@ impl ThreadingOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2561-L2571) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2589-L2599) pub fn set_global_denormal_as_zero(&mut self) -> &mut Self { panic_on_error!(ORT_API.SetGlobalDenormalAsZero.unwrap()(self.raw.as_ptr())); self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3281-L3288) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3313-L3320) pub fn set_global_custom_create_thread_fn( &mut self, custom_create_thread_fn: OrtCustomCreateThreadFn, @@ -2646,7 +2816,7 @@ impl ThreadingOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3290-L3297) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3322-L3329) #[allow(clippy::not_unsafe_ptr_arg_deref)] pub fn set_global_custom_thread_creation_options( &mut self, @@ -2659,7 +2829,7 @@ impl ThreadingOptions { self } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3299-L3306) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3331-L3338) pub fn set_global_custom_join_thread_fn( &mut self, custom_join_thread_fn: OrtCustomJoinThreadFn, @@ -2679,7 +2849,7 @@ impl Default for ThreadingOptions { } impl Drop for ThreadingOptions { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2098) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2126) fn drop(&mut self) { unsafe { ORT_API.ReleaseThreadingOptions.unwrap()(self.raw.as_ptr()) } } @@ -2691,7 +2861,7 @@ pub struct ArenaCfg { } impl ArenaCfg { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2714-L2743) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2742-L2775) pub fn new>( arena_config_keys: &[K], arena_config_values: &[usize], @@ -2700,7 +2870,7 @@ impl ArenaCfg { unsafe { Self::new_unchecked(arena_config_keys, arena_config_values) } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2714-L2743) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2742-L2775) /// /// # Safety /// @@ -2717,7 +2887,7 @@ impl ArenaCfg { Self::new_with_c_str_unchecked(&arena_config_keys_c_string, arena_config_values) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2714-L2743) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2742-L2775) pub fn new_with_c_str>( arena_config_keys: &[K], arena_config_values: &[usize], @@ -2726,7 +2896,7 @@ impl ArenaCfg { unsafe { Self::new_with_c_str_unchecked(arena_config_keys, arena_config_values) } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2714-L2743) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2742-L2775) /// /// # Safety /// @@ -2741,7 +2911,7 @@ impl ArenaCfg { Self::new_with_c_chars_with_nul(&arena_config_keys_c_char, arena_config_values) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2714-L2743) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2742-L2775) /// /// # Safety /// @@ -2763,7 +2933,7 @@ impl ArenaCfg { } impl Drop for ArenaCfg { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2592) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2620) fn drop(&mut self) { unsafe { ORT_API.ReleaseArenaCfg.unwrap()(self.raw.as_ptr()) } } @@ -2775,7 +2945,7 @@ pub struct PrepackedWeightsContainer { } impl PrepackedWeightsContainer { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2768-L2780) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2800-L2812) pub fn new() -> Self { let mut prepacked_weights_container = ptr::null_mut(); panic_on_error!(ORT_API.CreatePrepackedWeightsContainer.unwrap()( @@ -2792,7 +2962,7 @@ impl Default for PrepackedWeightsContainer { } impl Drop for PrepackedWeightsContainer { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2782-L2786) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2814-L2818) fn drop(&mut self) { unsafe { ORT_API.ReleasePrepackedWeightsContainer.unwrap()(self.raw.as_ptr()) } } @@ -2808,14 +2978,14 @@ pub struct CudaProviderOptions { } impl CudaProviderOptions { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3358-L3366) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3390-L3398) pub fn new() -> self::Result { let mut options = ptr::null_mut::(); bail_on_error!(ORT_API.CreateCUDAProviderOptions.unwrap()(&mut options)); Ok(Self { raw: NonNull::new(options).unwrap() }) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3390-L3404) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3422-L3436) pub fn to_string(&self, allocator: &mut Allocator) -> self::Result { let allocator = allocator.raw.as_ptr(); let mut options_ptr = ptr::null_mut::(); @@ -2831,7 +3001,7 @@ impl CudaProviderOptions { } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3368-L3388) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3400-L3420) pub fn set, V: AsRef>( &mut self, keys: &[K], @@ -2841,7 +3011,7 @@ impl CudaProviderOptions { unsafe { self.set_unchecked(keys, values) } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3368-L3388) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3400-L3420) /// /// # Safety /// @@ -2858,7 +3028,7 @@ impl CudaProviderOptions { self.set_with_c_str_unchecked(&keys_c_string, &values_c_string) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3368-L3388) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3400-L3420) pub fn set_with_c_str, V: AsRef>( &mut self, keys: &[K], @@ -2868,7 +3038,7 @@ impl CudaProviderOptions { unsafe { self.set_with_c_str_unchecked(keys, values) } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3368-L3388) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3400-L3420) /// /// # Safety /// @@ -2883,7 +3053,7 @@ impl CudaProviderOptions { self.set_with_c_chars_with_nul(&keys_c_char, &values_c_char) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3368-L3388) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3400-L3420) pub fn set_with_bytes_with_nul( &mut self, keys: &[&[u8]], @@ -2895,7 +3065,7 @@ impl CudaProviderOptions { unsafe { self.set_with_bytes_with_nul_unchecked(keys, values) } } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3368-L3388) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3400-L3420) /// /// # Safety /// @@ -2911,7 +3081,7 @@ impl CudaProviderOptions { self.set_with_c_chars_with_nul(&keys_c_char, &values_c_char) } - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3368-L3388) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3400-L3420) /// /// # Safety /// @@ -2934,18 +3104,27 @@ impl CudaProviderOptions { } impl Drop for CudaProviderOptions { - /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3406-L3412) + /// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3438-L3444) fn drop(&mut self) { unsafe { ORT_API.ReleaseCUDAProviderOptions.unwrap()(self.raw.as_ptr()) } } } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L4206-L4212) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L657-L661) +pub fn version_string() -> &'static str { + unsafe { + CStr::from_ptr(OrtGetApiBase().as_ref().unwrap().GetVersionString.unwrap()()) + .to_str() + .unwrap() + } +} + +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L4244-L4250) pub fn build_info_string() -> &'static str { unsafe { CStr::from_ptr(ORT_API.GetBuildInfoString.unwrap()()).to_str().unwrap() } } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2137-L2159) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2165-L2187) pub fn available_providers() -> self::Result> { let mut providers_ptr = ptr::null_mut::<*mut c_char>(); let mut num_providers = 0; @@ -2967,7 +3146,7 @@ pub fn available_providers() -> self::Result> { } } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L3235-L3245) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L3267-L3277) pub fn execution_provider_api(provider_name: &str) -> self::Result<*const c_void> { let mut provider_api = ptr::null::(); let provider_name_c_string = CString::new(provider_name)?; @@ -2979,13 +3158,13 @@ pub fn execution_provider_api(provider_name: &str) -> self::Result<*const c_void Ok(provider_api) } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2632-L2642) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2660-L2670) pub fn set_current_gpu_device_id(device_id: i32) -> self::Result<()> { bail_on_error!(ORT_API.SetCurrentGpuDeviceId.unwrap()(device_id)); Ok(()) } -/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.15.1/include/onnxruntime/core/session/onnxruntime_c_api.h#L2644-L2654) +/// [`onnxruntime_c_api.h`](https://github.com/microsoft/onnxruntime/blob/v1.16.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L2672-L2682) pub fn current_gpu_device_id() -> self::Result { let mut device_id = 0; bail_on_error!(ORT_API.GetCurrentGpuDeviceId.unwrap()(&mut device_id)); @@ -3005,6 +3184,7 @@ pub fn current_gpu_device_id() -> self::Result { // ORT_API2_STATUS(CreateOp, _In_ const OrtKernelInfo* info, _In_ const char* op_name, _In_ const char* domain, _In_ int version, _In_opt_ const char** type_constraint_names, _In_opt_ const ONNXTensorElementDataType* type_constraint_values, _In_opt_ int type_constraint_count, _In_opt_ const OrtOpAttr* const* attr_values, _In_opt_ int attr_count, _In_ int input_count, _In_ int output_count, _Outptr_ OrtOp** ort_op); // ORT_API2_STATUS(CreateOpAttr, _In_ const char* name, _In_ const void* data, _In_ int len, _In_ OrtOpAttrType type, _Outptr_ OrtOpAttr** op_attr); // ORT_API2_STATUS(CreateOpaqueValue, _In_z_ const char* domain_name, _In_z_ const char* type_name, _In_ const void* data_container, size_t data_container_size, _Outptr_ OrtValue** out); +// ORT_API2_STATUS(CreateROCMProviderOptions, _Outptr_ OrtROCMProviderOptions** out); // ORT_API2_STATUS(CreateSparseTensorAsOrtValue, _Inout_ OrtAllocator* allocator, _In_ const int64_t* dense_shape, size_t dense_shape_len, ONNXTensorElementDataType type, _Outptr_ OrtValue** out); // ORT_API2_STATUS(CreateSparseTensorWithValuesAsOrtValue, _In_ const OrtMemoryInfo* info, _Inout_ void* p_data, _In_ const int64_t* dense_shape, size_t dense_shape_len, _In_ const int64_t* values_shape, size_t values_shape_len, ONNXTensorElementDataType type, _Outptr_ OrtValue** out); // ORT_API2_STATUS(CreateTensorRTProviderOptions, _Outptr_ OrtTensorRTProviderOptionsV2** out); @@ -3016,11 +3196,13 @@ pub fn current_gpu_device_id() -> self::Result { // ORT_API2_STATUS(FillStringTensor, _Inout_ OrtValue* value, _In_ const char* const* s, size_t s_len); // ORT_API2_STATUS(FillStringTensorElement, _Inout_ OrtValue* value, _In_ const char* s, size_t index); // ORT_API2_STATUS(GetCANNProviderOptionsAsString, _In_ const OrtCANNProviderOptions* cann_options, _Inout_ OrtAllocator* allocator, _Outptr_ char** ptr); +// ORT_API2_STATUS(GetCUDAProviderOptionsByName, _In_ const OrtCUDAProviderOptionsV2* cuda_options, _In_ const char* key, _Outptr_ void** ptr); // ORT_API2_STATUS(GetDnnlProviderOptionsAsString, _In_ const OrtDnnlProviderOptions* dnnl_options, _Inout_ OrtAllocator* allocator, _Outptr_ char** ptr); // ORT_API2_STATUS(GetMapKeyType, _In_ const OrtMapTypeInfo* map_type_info, _Out_ enum ONNXTensorElementDataType* out); // ORT_API2_STATUS(GetMapValueType, _In_ const OrtMapTypeInfo* map_type_info, _Outptr_ OrtTypeInfo** type_info); // ORT_API2_STATUS(GetOpaqueValue, _In_ const char* domain_name, _In_ const char* type_name, _In_ const OrtValue* in, _Out_ void* data_container, size_t data_container_size); // ORT_API2_STATUS(GetOptionalContainedTypeInfo, _In_ const OrtOptionalTypeInfo* optional_type_info, _Outptr_ OrtTypeInfo** out); +// ORT_API2_STATUS(GetROCMProviderOptionsAsString, _In_ const OrtROCMProviderOptions* rocm_options, _Inout_ OrtAllocator* allocator, _Outptr_ char** ptr); // ORT_API2_STATUS(GetResizedStringTensorElementBuffer, _Inout_ OrtValue* value, _In_ size_t index, _In_ size_t length_in_bytes, _Inout_ char** buffer); // ORT_API2_STATUS(GetSequenceElementType, _In_ const OrtSequenceTypeInfo* sequence_type_info, _Outptr_ OrtTypeInfo** type_info); // ORT_API2_STATUS(GetSparseTensorFormat, _In_ const OrtValue* ort_value, _Out_ enum OrtSparseFormat* out); @@ -3033,6 +3215,7 @@ pub fn current_gpu_device_id() -> self::Result { // ORT_API2_STATUS(GetStringTensorElement, _In_ const OrtValue* value, size_t s_len, size_t index, _Out_writes_bytes_all_(s_len) void* s); // ORT_API2_STATUS(GetStringTensorElementLength, _In_ const OrtValue* value, size_t index, _Out_ size_t* out); // ORT_API2_STATUS(GetTensorRTProviderOptionsAsString, _In_ const OrtTensorRTProviderOptionsV2* tensorrt_options, _Inout_ OrtAllocator* allocator, _Outptr_ char** ptr); +// ORT_API2_STATUS(GetTensorRTProviderOptionsByName, _In_ const OrtTensorRTProviderOptionsV2* tensorrt_options, _In_ const char* key, _Outptr_ void** ptr); // ORT_API2_STATUS(GetValue, _In_ const OrtValue* value, int index, _Inout_ OrtAllocator* allocator, _Outptr_ OrtValue** out); // ORT_API2_STATUS(GetValueCount, _In_ const OrtValue* value, _Out_ size_t* out); // ORT_API2_STATUS(InvokeOp, _In_ const OrtKernelContext* context, _In_ const OrtOp* ort_op, _In_ const OrtValue* const* input_values, _In_ int input_count, _Inout_ OrtValue* const* output_values, _In_ int output_count); @@ -3044,6 +3227,7 @@ pub fn current_gpu_device_id() -> self::Result { // ORT_API2_STATUS(KernelContext_GetLogger, _In_ const OrtKernelContext* context, _Outptr_ const OrtLogger** logger); // ORT_API2_STATUS(KernelContext_GetOutput, _Inout_ OrtKernelContext* context, _In_ size_t index, _In_ const int64_t* dim_values, size_t dim_count, _Outptr_ OrtValue** out); // ORT_API2_STATUS(KernelContext_GetOutputCount, _In_ const OrtKernelContext* context, _Out_ size_t* out); +// ORT_API2_STATUS(KernelContext_GetResource, _In_ const OrtKernelContext* context, _In_ int resouce_version, _In_ int resource_id, _Outptr_ void** resource); // ORT_API2_STATUS(KernelInfoGetAttributeArray_float, _In_ const OrtKernelInfo* info, _In_ const char* name, _Out_ float* out, _Inout_ size_t* size); // ORT_API2_STATUS(KernelInfoGetAttributeArray_int64, _In_ const OrtKernelInfo* info, _In_ const char* name, _Out_ int64_t* out, _Inout_ size_t* size); // ORT_API2_STATUS(KernelInfoGetAttribute_float, _In_ const OrtKernelInfo* info, _In_ const char* name, _Out_ float* out); @@ -3064,6 +3248,7 @@ pub fn current_gpu_device_id() -> self::Result { // ORT_API2_STATUS(RegisterCustomOpsLibrary, _Inout_ OrtSessionOptions* options, _In_ const char* library_path, void** library_handle); // ORT_API2_STATUS(RegisterCustomOpsLibrary_V2, _Inout_ OrtSessionOptions* options, _In_ const ORTCHAR_T* library_name); // ORT_API2_STATUS(RegisterCustomOpsUsingFunction, _Inout_ OrtSessionOptions* options, _In_ const char* registration_func_name); +// ORT_API2_STATUS(RunAsync, _Inout_ OrtSession* session, _In_opt_ const OrtRunOptions* run_options, _In_reads_(input_len) const char* const* input_names, _In_reads_(input_len) const OrtValue* const* input, size_t input_len, _In_reads_(output_names_len) const char* const* output_names, size_t output_names_len, _Inout_updates_all_(output_names_len) OrtValue** output, _In_ RunAsyncCallbackFn run_async_callback, _In_opt_ void* user_data); // ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_CANN, _In_ OrtSessionOptions* options, _In_ const OrtCANNProviderOptions* cann_options); // ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_CUDA, _In_ OrtSessionOptions* options, _In_ const OrtCUDAProviderOptions* cuda_options); // ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_Dnnl, _In_ OrtSessionOptions* options, _In_ const OrtDnnlProviderOptions* dnnl_options); @@ -3073,15 +3258,21 @@ pub fn current_gpu_device_id() -> self::Result { // ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_TensorRT, _In_ OrtSessionOptions* options, _In_ const OrtTensorRTProviderOptions* tensorrt_options); // ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_TensorRT_V2, _In_ OrtSessionOptions* options, _In_ const OrtTensorRTProviderOptionsV2* tensorrt_options); // ORT_API2_STATUS(UpdateCANNProviderOptions, _Inout_ OrtCANNProviderOptions* cann_options, _In_reads_(num_keys) const char* const* provider_options_keys, _In_reads_(num_keys) const char* const* provider_options_values, _In_ size_t num_keys); +// ORT_API2_STATUS(UpdateCUDAProviderOptionsWithValue, _Inout_ OrtCUDAProviderOptionsV2* cuda_options, _In_ const char* key, _In_ void* value); // ORT_API2_STATUS(UpdateDnnlProviderOptions, _Inout_ OrtDnnlProviderOptions* dnnl_options, _In_reads_(num_keys) const char* const* provider_options_keys, _In_reads_(num_keys) const char* const* provider_options_values, _In_ size_t num_keys); +// ORT_API2_STATUS(UpdateROCMProviderOptions, _Inout_ OrtROCMProviderOptions* rocm_options, _In_reads_(num_keys) const char* const* provider_options_keys, _In_reads_(num_keys) const char* const* provider_options_values, _In_ size_t num_keys); // ORT_API2_STATUS(UpdateTensorRTProviderOptions, _Inout_ OrtTensorRTProviderOptionsV2* tensorrt_options, _In_reads_(num_keys) const char* const* provider_options_keys, _In_reads_(num_keys) const char* const* provider_options_values, _In_ size_t num_keys); +// ORT_API2_STATUS(UpdateTensorRTProviderOptionsWithValue, _Inout_ OrtTensorRTProviderOptionsV2* tensorrt_options, _In_ const char* key, _In_ void* value); // ORT_API2_STATUS(UseBlockSparseIndices, _Inout_ OrtValue* ort_value, const int64_t* indices_shape, size_t indices_shape_len, _Inout_ int32_t* indices_data); // ORT_API2_STATUS(UseCooIndices, _Inout_ OrtValue* ort_value, _Inout_ int64_t* indices_data, size_t indices_num); // ORT_API2_STATUS(UseCsrIndices, _Inout_ OrtValue* ort_value, _Inout_ int64_t* inner_data, size_t inner_num, _Inout_ int64_t* outer_data, size_t outer_num); // ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_CUDA, _In_ OrtSessionOptions* options, int device_id); // ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_Dnnl, _In_ OrtSessionOptions* options, int use_arena); // ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_MIGraphX, _In_ OrtSessionOptions* options, int device_id); +// ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_ROCM, _In_ OrtSessionOptions* options, int device_id); // OrtMemType(ORT_API_CALL* GetInputMemoryType)(_In_ const struct OrtCustomOp* op, _In_ size_t index); +// OrtStatusPtr(ORT_API_CALL* CreateKernelV2)(_In_ const struct OrtCustomOp* op, _In_ const OrtApi* api, _In_ const OrtKernelInfo* info, _Out_ void** kernel); +// OrtStatusPtr(ORT_API_CALL* KernelComputeV2)(_In_ void* op_kernel, _In_ OrtKernelContext* context); // const OrtTrainingApi*(ORT_API_CALL* GetTrainingApi)(uint32_t version) NO_EXCEPTION; // int(ORT_API_CALL* GetVariadicInputHomogeneity)(_In_ const struct OrtCustomOp* op); // int(ORT_API_CALL* GetVariadicInputMinArity)(_In_ const struct OrtCustomOp* op); @@ -3089,4 +3280,5 @@ pub fn current_gpu_device_id() -> self::Result { // int(ORT_API_CALL* GetVariadicOutputMinArity)(_In_ const struct OrtCustomOp* op); // void(ORT_API_CALL* ReleaseCANNProviderOptions)(_Frees_ptr_opt_ OrtCANNProviderOptions* input); // void(ORT_API_CALL* ReleaseDnnlProviderOptions)(_Frees_ptr_opt_ OrtDnnlProviderOptions* input); +// void(ORT_API_CALL* ReleaseROCMProviderOptions)(_Frees_ptr_opt_ OrtROCMProviderOptions* input); // void(ORT_API_CALL* ReleaseTensorRTProviderOptions)(_Frees_ptr_opt_ OrtTensorRTProviderOptionsV2* input);