1#![allow(non_upper_case_globals)]
2#![allow(non_camel_case_types)]
3#![allow(non_snake_case)]
4#![allow(clippy::type_complexity)]
5#![allow(clippy::missing_safety_doc)]
6#![cfg_attr(all(not(test), not(feature = "std")), no_std)]
7
8extern crate alloc;
9extern crate core;
10
11#[doc(hidden)]
12#[cfg(feature = "std")]
13pub mod internal;
14mod link_error;
15pub mod stub;
16mod version;
17
18pub use core::ffi::{c_char, c_int, c_ulong, c_ulonglong, c_ushort, c_void};
19
20pub use self::version::ORT_API_VERSION;
21
22#[doc(hidden)]
23pub const USING_PYKE_BINARIES: bool = cfg!(pyke);
24
25#[cfg(target_os = "windows")]
26pub type os_char = c_ushort;
27#[cfg(not(target_os = "windows"))]
28pub type os_char = c_char;
29
30#[repr(i32)]
31#[doc = " Copied from TensorProto::DataType\n Currently, Ort doesn't support complex64, complex128"]
32#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
33pub enum ONNXTensorElementDataType {
34 ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED = 0,
35 ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT = 1,
36 ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8 = 2,
37 ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8 = 3,
38 ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16 = 4,
39 ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16 = 5,
40 ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32 = 6,
41 ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64 = 7,
42 ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING = 8,
43 ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL = 9,
44 ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16 = 10,
45 ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE = 11,
46 ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32 = 12,
47 ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64 = 13,
48 ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64 = 14,
49 ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128 = 15,
50 ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16 = 16,
51 ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FN = 17,
52 ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FNUZ = 18,
53 ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2 = 19,
54 ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2FNUZ = 20,
55 ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT4 = 21,
56 ONNX_TENSOR_ELEMENT_DATA_TYPE_INT4 = 22,
57 ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT4E2M1 = 23,
58 ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT2 = 24,
59 ONNX_TENSOR_ELEMENT_DATA_TYPE_INT2 = 25,
60 ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E8M0 = 26
61}
62#[repr(i32)]
63#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
64pub enum ONNXType {
65 ONNX_TYPE_UNKNOWN = 0,
66 ONNX_TYPE_TENSOR = 1,
67 ONNX_TYPE_SEQUENCE = 2,
68 ONNX_TYPE_MAP = 3,
69 ONNX_TYPE_OPAQUE = 4,
70 ONNX_TYPE_SPARSETENSOR = 5,
71 ONNX_TYPE_OPTIONAL = 6
72}
73#[repr(i32)]
74#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
75pub enum OrtSparseFormat {
76 ORT_SPARSE_UNDEFINED = 0,
77 ORT_SPARSE_COO = 1,
78 ORT_SPARSE_CSRC = 2,
79 ORT_SPARSE_BLOCK_SPARSE = 4
80}
81#[repr(i32)]
82#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
83pub enum OrtSparseIndicesFormat {
84 ORT_SPARSE_COO_INDICES = 0,
85 ORT_SPARSE_CSR_INNER_INDICES = 1,
86 ORT_SPARSE_CSR_OUTER_INDICES = 2,
87 ORT_SPARSE_BLOCK_SPARSE_INDICES = 3
88}
89#[repr(i32)]
90#[doc = " \\brief Logging severity levels\n\n In typical API usage, specifying a logging severity level specifies the minimum severity of log messages to show."]
91#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
92pub enum OrtLoggingLevel {
93 #[doc = "< Verbose informational messages (least severe)."]
94 ORT_LOGGING_LEVEL_VERBOSE = 0,
95 #[doc = "< Informational messages."]
96 ORT_LOGGING_LEVEL_INFO = 1,
97 #[doc = "< Warning messages."]
98 ORT_LOGGING_LEVEL_WARNING = 2,
99 #[doc = "< Error messages."]
100 ORT_LOGGING_LEVEL_ERROR = 3,
101 #[doc = "< Fatal error messages (most severe)."]
102 ORT_LOGGING_LEVEL_FATAL = 4
103}
104#[repr(i32)]
105#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
106pub enum OrtErrorCode {
107 ORT_OK = 0,
108 ORT_FAIL = 1,
109 ORT_INVALID_ARGUMENT = 2,
110 ORT_NO_SUCHFILE = 3,
111 ORT_NO_MODEL = 4,
112 ORT_ENGINE_ERROR = 5,
113 ORT_RUNTIME_EXCEPTION = 6,
114 ORT_INVALID_PROTOBUF = 7,
115 ORT_MODEL_LOADED = 8,
116 ORT_NOT_IMPLEMENTED = 9,
117 ORT_INVALID_GRAPH = 10,
118 ORT_EP_FAIL = 11,
119 ORT_MODEL_LOAD_CANCELED = 12,
120 ORT_MODEL_REQUIRES_COMPILATION = 13,
121 ORT_NOT_FOUND = 14,
122 ORT_DEVICE_RESET = 15
123}
124#[repr(i32)]
125#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
126pub enum OrtOpAttrType {
127 ORT_OP_ATTR_UNDEFINED = 0,
128 ORT_OP_ATTR_INT = 1,
129 ORT_OP_ATTR_INTS = 2,
130 ORT_OP_ATTR_FLOAT = 3,
131 ORT_OP_ATTR_FLOATS = 4,
132 ORT_OP_ATTR_STRING = 5,
133 ORT_OP_ATTR_STRINGS = 6,
134 ORT_OP_ATTR_GRAPH = 7,
135 ORT_OP_ATTR_TENSOR = 8
136}
137#[repr(C)]
138#[derive(Debug, Copy, Clone)]
139pub struct OrtEnv {
140 _unused: [u8; 0]
141}
142#[repr(C)]
143#[derive(Debug, Copy, Clone)]
144pub struct OrtStatus {
145 _unused: [u8; 0]
146}
147#[repr(C)]
148#[derive(Debug, Copy, Clone)]
149pub struct OrtMemoryInfo {
150 _unused: [u8; 0]
151}
152#[repr(C)]
153#[derive(Debug, Copy, Clone)]
154pub struct OrtIoBinding {
155 _unused: [u8; 0]
156}
157#[repr(C)]
158#[derive(Debug, Copy, Clone)]
159pub struct OrtSession {
160 _unused: [u8; 0]
161}
162#[repr(C)]
163#[derive(Debug, Copy, Clone)]
164pub struct OrtValue {
165 _unused: [u8; 0]
166}
167#[repr(C)]
168#[derive(Debug, Copy, Clone)]
169pub struct OrtRunOptions {
170 _unused: [u8; 0]
171}
172#[repr(C)]
173#[derive(Debug, Copy, Clone)]
174pub struct OrtTypeInfo {
175 _unused: [u8; 0]
176}
177#[repr(C)]
178#[derive(Debug, Copy, Clone)]
179pub struct OrtTensorTypeAndShapeInfo {
180 _unused: [u8; 0]
181}
182#[repr(C)]
183#[derive(Debug, Copy, Clone)]
184pub struct OrtMapTypeInfo {
185 _unused: [u8; 0]
186}
187#[repr(C)]
188#[derive(Debug, Copy, Clone)]
189pub struct OrtSequenceTypeInfo {
190 _unused: [u8; 0]
191}
192#[repr(C)]
193#[derive(Debug, Copy, Clone)]
194pub struct OrtOptionalTypeInfo {
195 _unused: [u8; 0]
196}
197#[repr(C)]
198#[derive(Debug, Copy, Clone)]
199pub struct OrtSessionOptions {
200 _unused: [u8; 0]
201}
202#[repr(C)]
203#[derive(Debug, Copy, Clone)]
204pub struct OrtCustomOpDomain {
205 _unused: [u8; 0]
206}
207#[repr(C)]
208#[derive(Debug, Copy, Clone)]
209pub struct OrtModelMetadata {
210 _unused: [u8; 0]
211}
212#[repr(C)]
213#[derive(Debug, Copy, Clone)]
214pub struct OrtThreadPoolParams {
215 _unused: [u8; 0]
216}
217#[repr(C)]
218#[derive(Debug, Copy, Clone)]
219pub struct OrtThreadingOptions {
220 _unused: [u8; 0]
221}
222#[repr(C)]
223#[derive(Debug, Copy, Clone)]
224pub struct OrtArenaCfg {
225 _unused: [u8; 0]
226}
227#[repr(C)]
228#[derive(Debug, Copy, Clone)]
229pub struct OrtPrepackedWeightsContainer {
230 _unused: [u8; 0]
231}
232#[repr(C)]
233#[derive(Debug, Copy, Clone)]
234pub struct OrtTensorRTProviderOptionsV2 {
235 _unused: [u8; 0]
236}
237#[repr(C)]
238#[derive(Debug, Copy, Clone)]
239pub struct OrtNvTensorRtRtxProviderOptions {
240 _unused: [u8; 0]
241}
242#[repr(C)]
243#[derive(Debug, Copy, Clone)]
244pub struct OrtCUDAProviderOptionsV2 {
245 _unused: [u8; 0]
246}
247#[repr(C)]
248#[derive(Debug, Copy, Clone)]
249pub struct OrtCANNProviderOptions {
250 _unused: [u8; 0]
251}
252#[repr(C)]
253#[derive(Debug, Copy, Clone)]
254pub struct OrtDnnlProviderOptions {
255 _unused: [u8; 0]
256}
257#[repr(C)]
258#[derive(Debug, Copy, Clone)]
259pub struct OrtOp {
260 _unused: [u8; 0]
261}
262#[repr(C)]
263#[derive(Debug, Copy, Clone)]
264pub struct OrtOpAttr {
265 _unused: [u8; 0]
266}
267#[repr(C)]
268#[derive(Debug, Copy, Clone)]
269pub struct OrtLogger {
270 _unused: [u8; 0]
271}
272#[repr(C)]
273#[derive(Debug, Copy, Clone)]
274pub struct OrtShapeInferContext {
275 _unused: [u8; 0]
276}
277#[repr(C)]
278#[derive(Debug, Copy, Clone)]
279pub struct OrtLoraAdapter {
280 _unused: [u8; 0]
281}
282#[repr(C)]
283#[derive(Debug, Copy, Clone)]
284pub struct OrtValueInfo {
285 _unused: [u8; 0]
286}
287#[repr(C)]
288#[derive(Debug, Copy, Clone)]
289pub struct OrtNode {
290 _unused: [u8; 0]
291}
292#[repr(C)]
293#[derive(Debug, Copy, Clone)]
294pub struct OrtGraph {
295 _unused: [u8; 0]
296}
297#[repr(C)]
298#[derive(Debug, Copy, Clone)]
299pub struct OrtModel {
300 _unused: [u8; 0]
301}
302#[repr(C)]
303#[derive(Debug, Copy, Clone)]
304pub struct OrtModelCompilationOptions {
305 _unused: [u8; 0]
306}
307#[repr(C)]
308#[derive(Debug, Copy, Clone)]
309pub struct OrtHardwareDevice {
310 _unused: [u8; 0]
311}
312#[repr(C)]
313#[derive(Debug, Copy, Clone)]
314pub struct OrtEpDevice {
315 _unused: [u8; 0]
316}
317#[repr(C)]
318#[derive(Debug, Copy, Clone)]
319pub struct OrtKeyValuePairs {
320 _unused: [u8; 0]
321}
322#[repr(C)]
323#[derive(Debug, Copy, Clone)]
324pub struct OrtSyncStream {
325 _unused: [u8; 0]
326}
327#[repr(C)]
328#[derive(Debug, Copy, Clone)]
329pub struct OrtExternalInitializerInfo {
330 _unused: [u8; 0]
331}
332#[repr(C)]
333#[derive(Debug, Copy, Clone)]
334pub struct OrtExternalResourceImporter {
335 _unused: [u8; 0]
336}
337#[repr(C)]
338#[derive(Debug, Copy, Clone)]
339pub struct OrtExternalMemoryHandle {
340 _unused: [u8; 0]
341}
342#[repr(C)]
343#[derive(Debug, Copy, Clone)]
344pub struct OrtExternalSemaphoreHandle {
345 _unused: [u8; 0]
346}
347#[repr(C)]
348#[derive(Debug, Copy, Clone)]
349pub struct OrtDeviceEpIncompatibilityDetails {
350 _unused: [u8; 0]
351}
352#[repr(C)]
353#[derive(Debug, Copy, Clone)]
354pub struct OrtEpAssignedSubgraph {
355 _unused: [u8; 0]
356}
357#[repr(C)]
358#[derive(Debug, Copy, Clone)]
359pub struct OrtEpAssignedNode {
360 _unused: [u8; 0]
361}
362#[repr(C)]
363#[derive(Debug, Copy, Clone)]
364pub struct OrtModelPackageOptions {
365 _unused: [u8; 0]
366}
367#[repr(C)]
368#[derive(Debug, Copy, Clone)]
369pub struct OrtModelPackageContext {
370 _unused: [u8; 0]
371}
372#[repr(C)]
373#[derive(Debug, Copy, Clone)]
374pub struct OrtModelPackageComponentContext {
375 _unused: [u8; 0]
376}
377#[repr(transparent)]
378#[derive(Debug, Copy, Clone)]
379#[must_use = "statuses must be freed with `OrtApi::ReleaseStatus` if they are not null"]
380pub struct OrtStatusPtr(pub *mut OrtStatus);
381impl Default for OrtStatusPtr {
382 fn default() -> Self {
383 OrtStatusPtr(core::ptr::null_mut())
384 }
385}
386#[doc = " \\brief Memory allocation interface\n\n Structure of function pointers that defines a memory allocator. This can be created and filled in by the user for custom allocators.\n\n When an allocator is passed to any function, be sure that the allocator object is not destroyed until the last allocated object using it is freed."]
387#[repr(C)]
388#[derive(Debug, Copy, Clone)]
389pub struct OrtAllocator {
390 #[doc = "< Must be initialized to ORT_API_VERSION"]
391 pub version: u32,
392 #[doc = "< Returns a pointer to an allocated block of `size` bytes"]
393 pub Alloc: Option<unsafe extern "system" fn(this_: *mut OrtAllocator, size: usize) -> *mut core::ffi::c_void>,
394 #[doc = "< Free a block of memory previously allocated with OrtAllocator::Alloc"]
395 pub Free: Option<unsafe extern "system" fn(this_: *mut OrtAllocator, p: *mut core::ffi::c_void)>,
396 #[doc = "< Return a pointer to an ::OrtMemoryInfo that describes this allocator"]
397 pub Info: Option<unsafe extern "system" fn(this_: *const OrtAllocator) -> *const OrtMemoryInfo>,
398 pub Reserve: Option<unsafe extern "system" fn(this_: *const OrtAllocator, size: usize) -> *mut core::ffi::c_void>,
399 #[cfg(feature = "api-23")]
401 pub GetStats: Option<unsafe extern "system" fn(this_: *const OrtAllocator, out: *mut *mut OrtKeyValuePairs) -> OrtStatusPtr>,
402 #[cfg(feature = "api-23")]
403 pub AllocOnStream: Option<unsafe extern "system" fn(this_: *mut OrtAllocator, size: usize, stream: *mut OrtSyncStream) -> *mut core::ffi::c_void>,
404 #[cfg(feature = "api-25")]
405 pub Shrink: Option<unsafe extern "system" fn(this_: *mut OrtAllocator) -> OrtStatusPtr>
406}
407impl OrtAllocator {
408 pub const unsafe fn default() -> Self {
409 Self {
410 version: ORT_API_VERSION,
411 Alloc: None,
412 Free: None,
413 Info: None,
414 Reserve: None,
415 #[cfg(feature = "api-23")]
416 GetStats: None,
417 #[cfg(feature = "api-23")]
418 AllocOnStream: None,
419 #[cfg(feature = "api-25")]
420 Shrink: None
421 }
422 }
423}
424pub type OrtLoggingFunction = unsafe extern "system" fn(
425 param: *mut core::ffi::c_void,
426 severity: OrtLoggingLevel,
427 category: *const core::ffi::c_char,
428 logid: *const core::ffi::c_char,
429 code_location: *const core::ffi::c_char,
430 message: *const core::ffi::c_char
431);
432#[repr(i32)]
433#[doc = " \\brief Graph optimization level\n\n Refer to https://www.onnxruntime.ai/docs/performance/graph-optimizations.html#graph-optimization-levels\n for an in-depth understanding of the Graph Optimization Levels."]
434#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
435pub enum GraphOptimizationLevel {
436 ORT_DISABLE_ALL = 0,
437 ORT_ENABLE_BASIC = 1,
438 ORT_ENABLE_EXTENDED = 2,
439 ORT_ENABLE_LAYOUT = 3,
440 ORT_ENABLE_ALL = 99
441}
442#[repr(i32)]
443#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
444pub enum ExecutionMode {
445 ORT_SEQUENTIAL = 0,
446 ORT_PARALLEL = 1
447}
448#[repr(i32)]
449#[doc = " \\brief Language projection identifiers\n /see OrtApi::SetLanguageProjection"]
450#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
451pub enum OrtLanguageProjection {
452 ORT_PROJECTION_C = 0,
453 ORT_PROJECTION_CPLUSPLUS = 1,
454 ORT_PROJECTION_CSHARP = 2,
455 ORT_PROJECTION_PYTHON = 3,
456 ORT_PROJECTION_JAVA = 4,
457 ORT_PROJECTION_WINML = 5,
458 ORT_PROJECTION_NODEJS = 6
459}
460#[repr(C)]
461#[derive(Debug, Copy, Clone)]
462pub struct OrtKernelInfo {
463 _unused: [u8; 0]
464}
465#[repr(C)]
466#[derive(Debug, Copy, Clone)]
467pub struct OrtKernelContext {
468 _unused: [u8; 0]
469}
470#[repr(i32)]
471#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
472pub enum OrtAllocatorType {
473 OrtInvalidAllocator = -1,
474 OrtDeviceAllocator = 0,
475 OrtArenaAllocator = 1,
476 OrtReadOnlyAllocator = 2
477}
478impl OrtMemType {
479 pub const OrtMemTypeCPU: OrtMemType = OrtMemType::OrtMemTypeCPUOutput;
480}
481#[repr(i32)]
482#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
483pub enum OrtDeviceMemoryType {
484 OrtDeviceMemoryType_DEFAULT = 0,
485 OrtDeviceMemoryType_HOST_ACCESSIBLE = 5
486}
487#[repr(i32)]
488#[doc = " \\brief Memory types for allocated memory, execution provider specific types should be extended in each provider."]
489#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
490pub enum OrtMemType {
491 #[doc = "< Any CPU memory used by non-CPU execution provider"]
492 OrtMemTypeCPUInput = -2,
493 #[doc = "< CPU accessible memory outputted by non-CPU execution provider, i.e. CUDA_PINNED"]
494 OrtMemTypeCPUOutput = -1,
495 #[doc = "< The default allocator for execution provider"]
496 OrtMemTypeDefault = 0
497}
498#[repr(i32)]
499#[doc = " \\brief This mimics OrtDevice type constants so they can be returned in the API"]
500#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
501pub enum OrtMemoryInfoDeviceType {
502 OrtMemoryInfoDeviceType_CPU = 0,
503 OrtMemoryInfoDeviceType_GPU = 1,
504 OrtMemoryInfoDeviceType_FPGA = 2,
505 OrtMemoryInfoDeviceType_NPU = 3
506}
507#[repr(i32)]
508#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
509pub enum OrtHardwareDeviceType {
510 OrtHardwareDeviceType_CPU = 0,
511 OrtHardwareDeviceType_GPU = 1,
512 OrtHardwareDeviceType_NPU = 2
513}
514#[repr(i32)]
515#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
516pub enum OrtExecutionProviderDevicePolicy {
517 OrtExecutionProviderDevicePolicy_DEFAULT = 0,
518 OrtExecutionProviderDevicePolicy_PREFER_CPU = 1,
519 OrtExecutionProviderDevicePolicy_PREFER_NPU = 2,
520 OrtExecutionProviderDevicePolicy_PREFER_GPU = 3,
521 OrtExecutionProviderDevicePolicy_MAX_PERFORMANCE = 4,
522 OrtExecutionProviderDevicePolicy_MAX_EFFICIENCY = 5,
523 OrtExecutionProviderDevicePolicy_MIN_OVERALL_POWER = 6
524}
525pub type EpSelectionDelegate = Option<
526 unsafe extern "system" fn(
527 ep_devices: *const *const OrtEpDevice,
528 num_devices: usize,
529 model_metadata: *const OrtKeyValuePairs,
530 runtime_metadata: *const OrtKeyValuePairs,
531 selected: *mut *const OrtEpDevice,
532 max_selected: usize,
533 num_selected: *mut usize,
534 state: *mut c_void
535 ) -> OrtStatusPtr
536>;
537pub type OrtWriteBufferFunc = Option<unsafe extern "system" fn(state: *mut c_void, buffer: *const c_void, buffer_num_bytes: usize) -> OrtStatusPtr>;
538pub type OrtWriteNamedBufferFunc =
539 Option<unsafe extern "system" fn(state: *mut c_void, name: *const c_char, buffer: *const c_void, buffer_num_bytes: usize) -> OrtStatusPtr>;
540pub type OrtReadNamedBufferFunc = Option<
541 unsafe extern "system" fn(
542 state: *mut c_void,
543 name: *const c_char,
544 allocator: *mut OrtAllocator,
545 buffer: *mut *mut c_void,
546 data_size: *mut usize
547 ) -> OrtStatusPtr
548>;
549pub type OrtGetInitializerLocationFunc = Option<
550 unsafe extern "system" fn(
551 state: *mut c_void,
552 initializer_name: *const c_char,
553 initializer_value: *const OrtValue,
554 external_info: *const OrtExternalInitializerInfo,
555 new_external_info: *mut *mut OrtExternalInitializerInfo
556 ) -> OrtStatusPtr
557>;
558#[repr(i32)]
559#[doc = " \\brief Algorithm to use for cuDNN Convolution Op"]
560#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
561pub enum OrtCudnnConvAlgoSearch {
562 OrtCudnnConvAlgoSearchExhaustive = 0,
563 OrtCudnnConvAlgoSearchHeuristic = 1,
564 OrtCudnnConvAlgoSearchDefault = 2
565}
566#[doc = " \\brief CUDA Provider Options\n\n \\see OrtApi::SessionOptionsAppendExecutionProvider_CUDA"]
567#[repr(C)]
568#[derive(Debug, Copy, Clone)]
569pub struct OrtCUDAProviderOptions {
570 #[doc = " \\brief CUDA device Id\n Defaults to 0."]
571 pub device_id: core::ffi::c_int,
572 #[doc = " \\brief CUDA Convolution algorithm search configuration.\n See enum OrtCudnnConvAlgoSearch for more details.\n Defaults to OrtCudnnConvAlgoSearchExhaustive."]
573 pub cudnn_conv_algo_search: OrtCudnnConvAlgoSearch,
574 #[doc = " \\brief CUDA memory limit (To use all possible memory pass in maximum usize)\n Defaults to SIZE_MAX.\n \\note If a ::OrtArenaCfg has been applied, it will override this field"]
575 pub gpu_mem_limit: usize,
576 #[doc = " \\brief Strategy used to grow the memory arena\n 0 = kNextPowerOfTwo<br>\n 1 = kSameAsRequested<br>\n Defaults to 0.\n \\note If a ::OrtArenaCfg has been applied, it will override this field"]
577 pub arena_extend_strategy: core::ffi::c_int,
578 #[doc = " \\brief Flag indicating if copying needs to take place on the same stream as the compute stream in the CUDA EP\n 0 = Use separate streams for copying and compute.\n 1 = Use the same stream for copying and compute.\n Defaults to 1.\n WARNING: Setting this to 0 may result in data races for some models.\n Please see issue #4829 for more details."]
579 pub do_copy_in_default_stream: core::ffi::c_int,
580 #[doc = " \\brief Flag indicating if there is a user provided compute stream\n Defaults to 0."]
581 pub has_user_compute_stream: core::ffi::c_int,
582 #[doc = " \\brief User provided compute stream.\n If provided, please set `has_user_compute_stream` to 1."]
583 pub user_compute_stream: *mut core::ffi::c_void,
584 #[doc = " \\brief CUDA memory arena configuration parameters"]
585 pub default_memory_arena_cfg: *mut OrtArenaCfg,
586 #[doc = " \\brief Enable TunableOp for using.\n Set it to 1/0 to enable/disable TunableOp. Otherwise, it is disabled by default.\n This option can be overriden by environment variable ORT_CUDA_TUNABLE_OP_ENABLE."]
587 pub tunable_op_enable: core::ffi::c_int,
588 #[doc = " \\brief Enable TunableOp for tuning.\n Set it to 1/0 to enable/disable TunableOp tuning. Otherwise, it is disabled by default.\n This option can be overriden by environment variable ORT_CUDA_TUNABLE_OP_TUNING_ENABLE."]
589 pub tunable_op_tuning_enable: core::ffi::c_int,
590 #[doc = " \\brief Max tuning duration time limit for each instance of TunableOp.\n Defaults to 0 to disable the limit."]
591 pub tunable_op_max_tuning_duration_ms: core::ffi::c_int
592}
593#[doc = " \\brief ROCM Provider Options\n\n \\see OrtApi::SessionOptionsAppendExecutionProvider_ROCM"]
594#[repr(C)]
595#[derive(Debug, Copy, Clone)]
596pub struct OrtROCMProviderOptions {
597 #[doc = " \\brief ROCM device Id\n Defaults to 0."]
598 pub device_id: core::ffi::c_int,
599 #[doc = " \\brief ROCM MIOpen Convolution algorithm exaustive search option.\n Defaults to 0 (false)."]
600 pub miopen_conv_exhaustive_search: core::ffi::c_int,
601 #[doc = " \\brief ROCM memory limit (To use all possible memory pass in maximum usize)\n Defaults to SIZE_MAX.\n \\note If a ::OrtArenaCfg has been applied, it will override this field"]
602 pub gpu_mem_limit: usize,
603 #[doc = " \\brief Strategy used to grow the memory arena\n 0 = kNextPowerOfTwo<br>\n 1 = kSameAsRequested<br>\n Defaults to 0.\n \\note If a ::OrtArenaCfg has been applied, it will override this field"]
604 pub arena_extend_strategy: core::ffi::c_int,
605 #[doc = " \\brief Flag indicating if copying needs to take place on the same stream as the compute stream in the ROCM EP\n 0 = Use separate streams for copying and compute.\n 1 = Use the same stream for copying and compute.\n Defaults to 1.\n WARNING: Setting this to 0 may result in data races for some models.\n Please see issue #4829 for more details."]
606 pub do_copy_in_default_stream: core::ffi::c_int,
607 #[doc = " \\brief Flag indicating if there is a user provided compute stream\n Defaults to 0."]
608 pub has_user_compute_stream: core::ffi::c_int,
609 #[doc = " \\brief User provided compute stream.\n If provided, please set `has_user_compute_stream` to 1."]
610 pub user_compute_stream: *mut core::ffi::c_void,
611 #[doc = " \\brief ROCM memory arena configuration parameters"]
612 pub default_memory_arena_cfg: *mut OrtArenaCfg,
613 pub enable_hip_graph: core::ffi::c_int,
614 #[doc = " \\brief Enable TunableOp for using.\n Set it to 1/0 to enable/disable TunableOp. Otherwise, it is disabled by default.\n This option can be overriden by environment variable ORT_ROCM_TUNABLE_OP_ENABLE."]
615 pub tunable_op_enable: core::ffi::c_int,
616 #[doc = " \\brief Enable TunableOp for tuning.\n Set it to 1/0 to enable/disable TunableOp tuning. Otherwise, it is disabled by default.\n This option can be overriden by environment variable ORT_ROCM_TUNABLE_OP_TUNING_ENABLE."]
617 pub tunable_op_tuning_enable: core::ffi::c_int,
618 #[doc = " \\brief Max tuning duration time limit for each instance of TunableOp.\n Defaults to 0 to disable the limit."]
619 pub tunable_op_max_tuning_duration_ms: core::ffi::c_int
620}
621#[doc = " \\brief TensorRT Provider Options\n\n \\see OrtApi::SessionOptionsAppendExecutionProvider_TensorRT"]
622#[repr(C)]
623#[derive(Debug, Copy, Clone)]
624pub struct OrtTensorRTProviderOptions {
625 #[doc = "< CUDA device id (0 = default device)"]
626 pub device_id: core::ffi::c_int,
627 pub has_user_compute_stream: core::ffi::c_int,
628 pub user_compute_stream: *mut core::ffi::c_void,
629 pub trt_max_partition_iterations: core::ffi::c_int,
630 pub trt_min_subgraph_size: core::ffi::c_int,
631 pub trt_max_workspace_size: usize,
632 pub trt_fp16_enable: core::ffi::c_int,
633 pub trt_int8_enable: core::ffi::c_int,
634 pub trt_int8_calibration_table_name: *const core::ffi::c_char,
635 pub trt_int8_use_native_calibration_table: core::ffi::c_int,
636 pub trt_dla_enable: core::ffi::c_int,
637 pub trt_dla_core: core::ffi::c_int,
638 pub trt_dump_subgraphs: core::ffi::c_int,
639 pub trt_engine_cache_enable: core::ffi::c_int,
640 pub trt_engine_cache_path: *const core::ffi::c_char,
641 pub trt_engine_decryption_enable: core::ffi::c_int,
642 pub trt_engine_decryption_lib_path: *const core::ffi::c_char,
643 pub trt_force_sequential_engine_build: core::ffi::c_int
644}
645#[doc = " \\brief MIGraphX Provider Options\n\n \\see OrtApi::SessionOptionsAppendExecutionProvider_MIGraphX"]
646#[repr(C)]
647#[derive(Debug, Copy, Clone)]
648pub struct OrtMIGraphXProviderOptions {
649 pub device_id: core::ffi::c_int,
650 pub migraphx_fp16_enable: core::ffi::c_int,
651 pub migraphx_fp8_enable: core::ffi::c_int,
652 pub migraphx_int8_enable: core::ffi::c_int,
653 pub migraphx_use_native_calibration_table: core::ffi::c_int,
654 pub migraphx_int8_calibration_table_name: *const core::ffi::c_char,
655 pub migraphx_save_compiled_model: core::ffi::c_int,
656 pub migraphx_save_model_path: *const core::ffi::c_char,
657 pub migraphx_load_compiled_model: core::ffi::c_int,
658 pub migraphx_load_model_path: *const core::ffi::c_char,
659 pub migraphx_exhaustive_tune: bool,
660 pub migraphx_mem_limit: usize,
661 pub migraphx_arena_extend_strategy: core::ffi::c_int
662}
663#[doc = " \\brief OpenVINO Provider Options\n\n \\see OrtApi::SessionOptionsAppendExecutionProvider_OpenVINO"]
664#[repr(C)]
665#[derive(Debug, Copy, Clone)]
666pub struct OrtOpenVINOProviderOptions {
667 #[doc = " \\brief Device type string\n\n Valid settings are one of: \"CPU_FP32\", \"CPU_FP16\", \"GPU_FP32\", \"GPU_FP16\""]
668 pub device_type: *const core::ffi::c_char,
669 #[doc = "< 0 = disabled, nonzero = enabled"]
670 pub enable_npu_fast_compile: core::ffi::c_uchar,
671 pub device_id: *const core::ffi::c_char,
672 #[doc = "< 0 = Use default number of threads"]
673 pub num_of_threads: usize,
674 pub cache_dir: *const core::ffi::c_char,
675 pub context: *mut core::ffi::c_void,
676 #[doc = "< 0 = disabled, nonzero = enabled"]
677 pub enable_opencl_throttling: core::ffi::c_uchar,
678 #[doc = "< 0 = disabled, nonzero = enabled"]
679 pub enable_dynamic_shapes: core::ffi::c_uchar
680}
681#[repr(i32)]
682#[derive(Default, Debug, Copy, Clone, Hash, PartialEq, Eq)]
683pub enum OrtDmlPerformancePreference {
684 #[default]
685 Default = 0,
686 HighPerformance = 1,
687 MinimumPower = 2
688}
689#[repr(u32)]
690#[derive(Default, Debug, Copy, Clone, Hash, PartialEq, Eq)]
691pub enum OrtDmlDeviceFilter {
692 Any = 0xFFFF_FFFF,
693 #[default]
694 Gpu = 1 << 0,
695 Npu = 1 << 1
696}
697#[repr(C)]
698#[derive(Debug, Clone)]
699pub struct OrtDmlDeviceOptions {
700 pub Preference: OrtDmlPerformancePreference,
701 pub Filter: OrtDmlDeviceFilter
702}
703#[repr(C)]
704#[derive(Debug, Clone)]
705pub struct OrtDmlApi {
706 pub SessionOptionsAppendExecutionProvider_DML: unsafe extern "system" fn(options: *mut OrtSessionOptions, device_id: c_int) -> OrtStatusPtr,
707 pub SessionOptionsAppendExecutionProvider_DML1:
708 unsafe extern "system" fn(options: *mut OrtSessionOptions, dml_device: *mut c_void, cmd_queue: *mut c_void) -> OrtStatusPtr,
709 pub CreateGPUAllocationFromD3DResource: unsafe extern "system" fn(resource: *mut c_void, dml_resource: *mut *mut c_void) -> OrtStatusPtr,
710 pub FreeGPUAllocation: unsafe extern "system" fn(dml_resource: *mut c_void) -> OrtStatusPtr,
711 pub GetD3D12ResourceFromAllocation:
712 unsafe extern "system" fn(provider: *mut OrtAllocator, dml_resource: *mut c_void, d3d_resource: *mut *mut c_void) -> OrtStatusPtr,
713 pub SessionOptionsAppendExecutionProvider_DML2:
714 unsafe extern "system" fn(options: *mut OrtSessionOptions, device_opts: *const OrtDmlDeviceOptions) -> OrtStatusPtr,
715 pub GetDMLDevice: unsafe extern "system" fn(options: *mut OrtSessionOptions, dmlDevice: *mut *mut c_void) -> OrtStatusPtr,
716 pub GetDMLCommandQueue: unsafe extern "system" fn(options: *mut OrtSessionOptions, dmlCommandQueue: *mut *mut c_void) -> OrtStatusPtr
717}
718#[repr(C)]
719#[derive(Debug, Copy, Clone)]
720pub struct OrtTrainingSession {
721 _unused: [u8; 0]
722}
723#[repr(C)]
724#[derive(Debug, Copy, Clone)]
725pub struct OrtCheckpointState {
726 _unused: [u8; 0]
727}
728#[repr(i32)]
729#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
730pub enum OrtPropertyType {
731 OrtIntProperty = 0,
732 OrtFloatProperty = 1,
733 OrtStringProperty = 2
734}
735#[repr(C)]
736#[derive(Debug, Copy, Clone)]
737pub struct OrtTrainingApi {
738 pub LoadCheckpoint: unsafe extern "system" fn(checkpoint_path: *const os_char, checkpoint_state: *mut *mut OrtCheckpointState) -> OrtStatusPtr,
739 pub SaveCheckpoint:
740 unsafe extern "system" fn(checkpoint_state: *mut OrtCheckpointState, checkpoint_path: *const os_char, include_optimizer_state: bool) -> OrtStatusPtr,
741 pub CreateTrainingSession: unsafe extern "system" fn(
742 env: *const OrtEnv,
743 options: *const OrtSessionOptions,
744 checkpoint_state: *mut OrtCheckpointState,
745 train_model_path: *const os_char,
746 eval_model_path: *const os_char,
747 optimizer_model_path: *const os_char,
748 out: *mut *mut OrtTrainingSession
749 ) -> OrtStatusPtr,
750 pub CreateTrainingSessionFromBuffer: unsafe extern "system" fn(
751 env: *const OrtEnv,
752 options: *const OrtSessionOptions,
753 checkpoint_state: *mut OrtCheckpointState,
754 train_model_data: *const (),
755 train_data_length: usize,
756 eval_model_data: *const (),
757 eval_data_length: usize,
758 optimizer_model_data: *const (),
759 optimizer_data_length: usize,
760 out: *mut *mut OrtTrainingSession
761 ) -> OrtStatusPtr,
762 pub TrainingSessionGetTrainingModelOutputCount: unsafe extern "system" fn(sess: *const OrtTrainingSession, out: *mut usize) -> OrtStatusPtr,
763 pub TrainingSessionGetEvalModelOutputCount: unsafe extern "system" fn(sess: *const OrtTrainingSession, out: *mut usize) -> OrtStatusPtr,
764 pub TrainingSessionGetTrainingModelOutputName:
765 unsafe extern "system" fn(sess: *const OrtTrainingSession, index: usize, allocator: *mut OrtAllocator, output: *mut *const c_char) -> OrtStatusPtr,
766 pub TrainingSessionGetEvalModelOutputName:
767 unsafe extern "system" fn(sess: *const OrtTrainingSession, index: usize, allocator: *mut OrtAllocator, output: *mut *const c_char) -> OrtStatusPtr,
768 pub LazyResetGrad: unsafe extern "system" fn(session: *mut OrtTrainingSession) -> OrtStatusPtr,
769 pub TrainStep: unsafe extern "system" fn(
770 session: *mut OrtTrainingSession,
771 run_options: *const OrtRunOptions,
772 inputs_len: usize,
773 inputs: *const *const OrtValue,
774 outputs_len: usize,
775 outputs: *mut *mut OrtValue
776 ) -> OrtStatusPtr,
777 pub EvalStep: unsafe extern "system" fn(
778 session: *mut OrtTrainingSession,
779 run_options: *const OrtRunOptions,
780 inputs_len: usize,
781 inputs: *const *const OrtValue,
782 outputs_len: usize,
783 outputs: *mut *mut OrtValue
784 ) -> OrtStatusPtr,
785 pub SetLearningRate: unsafe extern "system" fn(session: *mut OrtTrainingSession, learning_rate: f32) -> OrtStatusPtr,
786 pub GetLearningRate: unsafe extern "system" fn(session: *mut OrtTrainingSession, learning_rate: *mut f32) -> OrtStatusPtr,
787 pub OptimizerStep: unsafe extern "system" fn(session: *mut OrtTrainingSession, run_options: *const OrtRunOptions) -> OrtStatusPtr,
788 pub RegisterLinearLRScheduler:
789 unsafe extern "system" fn(session: *mut OrtTrainingSession, warmup_step_count: i64, total_step_count: i64, initial_lr: f32) -> OrtStatusPtr,
790 pub SchedulerStep: unsafe extern "system" fn(session: *mut OrtTrainingSession) -> OrtStatusPtr,
791 pub GetParametersSize: unsafe extern "system" fn(session: *mut OrtTrainingSession, out: *mut usize, trainable_only: bool) -> OrtStatusPtr,
792 pub CopyParametersToBuffer:
793 unsafe extern "system" fn(session: *mut OrtTrainingSession, parameters_buffer: *mut OrtValue, trainable_only: bool) -> OrtStatusPtr,
794 pub CopyBufferToParameters:
795 unsafe extern "system" fn(session: *mut OrtTrainingSession, parameters_buffer: *mut OrtValue, trainable_only: bool) -> OrtStatusPtr,
796 pub ReleaseTrainingSession: unsafe extern "system" fn(input: *mut OrtTrainingSession),
797 pub ReleaseCheckpointState: unsafe extern "system" fn(input: *mut OrtCheckpointState),
798 pub ExportModelForInferencing: unsafe extern "system" fn(
799 session: *mut OrtTrainingSession,
800 inference_model_path: *const os_char,
801 graph_outputs_len: usize,
802 graph_output_names: *const *const c_char
803 ) -> OrtStatusPtr,
804 pub SetSeed: unsafe extern "system" fn(seed: i64) -> OrtStatusPtr,
805 pub TrainingSessionGetTrainingModelInputCount: unsafe extern "system" fn(session: *const OrtTrainingSession, out: *mut usize) -> OrtStatusPtr,
806 pub TrainingSessionGetEvalModelInputCount: unsafe extern "system" fn(session: *const OrtTrainingSession, out: *mut usize) -> OrtStatusPtr,
807 pub TrainingSessionGetTrainingModelInputName:
808 unsafe extern "system" fn(session: *const OrtTrainingSession, index: usize, allocator: *mut OrtAllocator, output: *mut *const c_char) -> OrtStatusPtr,
809 pub TrainingSessionGetEvalModelInputName:
810 unsafe extern "system" fn(session: *const OrtTrainingSession, index: usize, allocator: *mut OrtAllocator, output: *mut *const c_char) -> OrtStatusPtr,
811 pub AddProperty: unsafe extern "system" fn(
812 checkpoint_state: *mut OrtCheckpointState,
813 property_name: *const c_char,
814 property_type: OrtPropertyType,
815 property_value: *const ()
816 ) -> OrtStatusPtr,
817 pub GetProperty: unsafe extern "system" fn(
818 checkpoint_state: *mut OrtCheckpointState,
819 property_name: *const c_char,
820 allocator: *mut OrtAllocator,
821 property_type: *mut OrtPropertyType,
822 property_value: *mut *const ()
823 ) -> OrtStatusPtr,
824 pub LoadCheckpointFromBuffer:
825 unsafe extern "system" fn(checkpoint_buffer: *const (), num_bytes: usize, checkpoint_state: *mut *mut OrtCheckpointState) -> OrtStatusPtr,
826 pub GetParameterTypeAndShape: unsafe extern "system" fn(
827 checkpoint_state: *const OrtCheckpointState,
828 parameter_name: *const c_char,
829 parameter_type_and_shape: *mut *mut OrtTensorTypeAndShapeInfo
830 ) -> OrtStatusPtr,
831 pub UpdateParameter:
832 unsafe extern "system" fn(checkpoint_state: *mut OrtCheckpointState, parameter_name: *const c_char, parameter: *mut OrtValue) -> OrtStatusPtr,
833 pub GetParameter: unsafe extern "system" fn(
834 checkpoint_state: *const OrtCheckpointState,
835 parameter_name: *const c_char,
836 allocator: *mut OrtAllocator,
837 parameter: *mut *mut OrtValue
838 ) -> OrtStatusPtr
839}
840#[repr(C)]
841#[derive(Debug, Copy, Clone)]
842pub struct OrtModelEditorApi {
843 pub CreateTensorTypeInfo: unsafe extern "system" fn(tensor_info: *const OrtTensorTypeAndShapeInfo, type_info: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
844 pub CreateSparseTensorTypeInfo: unsafe extern "system" fn(tensor_info: *const OrtTensorTypeAndShapeInfo, type_info: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
845 pub CreateMapTypeInfo: unsafe extern "system" fn(
846 map_key_type: ONNXTensorElementDataType,
847 map_value_type: *const OrtTypeInfo,
848 type_info: *mut *mut OrtTypeInfo
849 ) -> OrtStatusPtr,
850 pub CreateSequenceTypeInfo: unsafe extern "system" fn(sequence_type: *const OrtTypeInfo, type_info: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
851 pub CreateOptionalTypeInfo: unsafe extern "system" fn(contained_type: *const OrtTypeInfo, type_info: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
852 pub CreateValueInfo: unsafe extern "system" fn(name: *const c_char, type_info: *const OrtTypeInfo, value_info: *mut *mut OrtValueInfo) -> OrtStatusPtr,
853 pub CreateNode: unsafe extern "system" fn(
854 operator_name: *const c_char,
855 domain_name: *const c_char,
856 node_name: *const c_char,
857 input_names: *const *const c_char,
858 input_names_len: usize,
859 output_names: *const *const c_char,
860 output_names_len: usize,
861 attributes: *mut *mut OrtOpAttr,
862 attribs_len: usize,
863 node: *mut *mut OrtNode
864 ) -> OrtStatusPtr,
865 pub CreateGraph: unsafe extern "system" fn(graph: *mut *mut OrtGraph) -> OrtStatusPtr,
866 pub SetGraphInputs: unsafe extern "system" fn(graph: *mut OrtGraph, inputs: *mut *mut OrtValueInfo, inputs_len: usize) -> OrtStatusPtr,
867 pub SetGraphOutputs: unsafe extern "system" fn(graph: *mut OrtGraph, outputs: *mut *mut OrtValueInfo, outputs_len: usize) -> OrtStatusPtr,
868 pub AddInitializerToGraph:
869 unsafe extern "system" fn(graph: *mut OrtGraph, name: *const c_char, tensor: *mut OrtValue, data_is_external: bool) -> OrtStatusPtr,
870 pub AddNodeToGraph: unsafe extern "system" fn(graph: *mut OrtGraph, node: *mut OrtNode) -> OrtStatusPtr,
871 pub CreateModel: unsafe extern "system" fn(
872 domain_names: *const *const c_char,
873 opset_versions: *const i32,
874 opset_entries_len: usize,
875 model: *mut *mut OrtModel
876 ) -> OrtStatusPtr,
877 pub AddGraphToModel: unsafe extern "system" fn(model: *mut OrtModel, graph: *mut OrtGraph) -> OrtStatusPtr,
878 pub CreateSessionFromModel:
879 unsafe extern "system" fn(env: *const OrtEnv, model: *const OrtModel, options: *const OrtSessionOptions, out: *mut *mut OrtSession) -> OrtStatusPtr,
880 pub CreateModelEditorSession:
881 unsafe extern "system" fn(env: *const OrtEnv, model_path: *const os_char, options: *const OrtSessionOptions, out: *mut *mut OrtSession) -> OrtStatusPtr,
882 pub CreateModelEditorSessionFromArray: unsafe extern "system" fn(
883 env: *const OrtEnv,
884 model_data: *const c_void,
885 model_data_length: usize,
886 options: *const OrtSessionOptions,
887 out: *mut *mut OrtSession
888 ) -> OrtStatusPtr,
889 pub SessionGetOpsetForDomain: unsafe extern "system" fn(session: *const OrtSession, domain: *const c_char, opset: *mut i32) -> OrtStatusPtr,
890 pub ApplyModelToModelEditorSession: unsafe extern "system" fn(session: *mut OrtSession, model: *mut OrtModel) -> OrtStatusPtr,
891 pub FinalizeModelEditorSession: unsafe extern "system" fn(
892 session: *mut OrtSession,
893 options: *const OrtSessionOptions,
894 prepacked_weights_container: *const OrtPrepackedWeightsContainer
895 ) -> OrtStatusPtr
896}
897#[repr(C)]
898#[derive(Debug, Copy, Clone)]
899pub struct OrtCompileApi {
900 pub ReleaseModelCompilationOptions: unsafe extern "system" fn(input: *mut OrtModelCompilationOptions),
901 pub CreateModelCompilationOptionsFromSessionOptions:
902 unsafe extern "system" fn(env: *const OrtEnv, session_options: *const OrtSessionOptions, out: *mut *mut OrtModelCompilationOptions) -> OrtStatusPtr,
903 pub ModelCompilationOptions_SetInputModelPath:
904 unsafe extern "system" fn(model_compile_options: *mut OrtModelCompilationOptions, input_model_path: *const os_char) -> OrtStatusPtr,
905 pub ModelCompilationOptions_SetInputModelFromBuffer: unsafe extern "system" fn(
906 model_compile_options: *mut OrtModelCompilationOptions,
907 input_model_data: *const c_void,
908 input_model_data_size: usize
909 ) -> OrtStatusPtr,
910 pub ModelCompilationOptions_SetOutputModelPath:
911 unsafe extern "system" fn(model_compile_options: *mut OrtModelCompilationOptions, output_model_path: *const os_char) -> OrtStatusPtr,
912 pub ModelCompilationOptions_SetOutputModelExternalInitializersFile: unsafe extern "system" fn(
913 model_compile_options: *mut OrtModelCompilationOptions,
914 external_initializers_file_path: *const os_char,
915 external_initializers_size_threshold: usize
916 ) -> OrtStatusPtr,
917 pub ModelCompilationOptions_SetOutputModelBuffer: unsafe extern "system" fn(
918 model_compile_options: *mut OrtModelCompilationOptions,
919 allocator: *mut OrtAllocator,
920 output_model_buffer_ptr: *mut *mut c_void,
921 output_model_buffer_size_ptr: *mut usize
922 ) -> OrtStatusPtr,
923 pub ModelCompilationOptions_SetEpContextEmbedMode:
924 unsafe extern "system" fn(model_compile_options: *mut OrtModelCompilationOptions, embed_ep_context_in_model: bool) -> OrtStatusPtr,
925 pub CompileModel: unsafe extern "system" fn(env: *const OrtEnv, model_options: *const OrtModelCompilationOptions) -> OrtStatusPtr
926}
927#[repr(C)]
928#[derive(Debug, Copy, Clone)]
929pub struct OrtInteropApi {
930 _unused: [u8; 0]
931}
932#[repr(C)]
933#[derive(Debug, Copy, Clone)]
934pub struct OrtEpApi {
935 _unused: [u8; 0]
936}
937#[doc = " \\brief The helper interface to get the right version of OrtApi\n\n Get a pointer to this structure through ::OrtGetApiBase"]
938#[repr(C)]
939#[derive(Debug, Copy, Clone)]
940pub struct OrtApiBase {
941 #[doc = " \\brief Get a pointer to the requested version of the ::OrtApi\n\n \\param[in] version Must be ::ORT_API_VERSION\n \\return The ::OrtApi for the version requested, nullptr will be returned if this version is unsupported, for example when using a runtime\n older than the version created with this header file.\n\n One can call GetVersionString() to get the version of the Onnxruntime library for logging\n and error reporting purposes."]
942 pub GetApi: unsafe extern "system" fn(version: u32) -> *const OrtApi,
943 #[doc = " \\brief Returns a null terminated string of the version of the Onnxruntime library (eg: \"1.8.1\")\n\n \\return UTF-8 encoded version string. Do not deallocate the returned buffer."]
944 pub GetVersionString: unsafe extern "system" fn() -> *const core::ffi::c_char
945}
946unsafe extern "system" {
947 #[doc = " \\brief The Onnxruntime library's entry point to access the C API\n\n Call this to get the a pointer to an ::OrtApiBase"]
948 pub fn OrtGetApiBase() -> *const OrtApiBase;
949}
950#[doc = " \\brief Thread work loop function\n\n Onnxruntime will provide the working loop on custom thread creation\n Argument is an onnxruntime built-in type which will be provided when thread pool calls OrtCustomCreateThreadFn"]
951pub type OrtThreadWorkerFn = unsafe extern "C" fn(ort_worker_fn_param: *mut core::ffi::c_void);
952#[repr(C)]
953#[derive(Debug, Copy, Clone)]
954pub struct OrtCustomHandleType {
955 pub __place_holder: core::ffi::c_char
956}
957pub type OrtCustomThreadHandle = *const OrtCustomHandleType;
958#[doc = " \\brief Ort custom thread creation function\n\n The function should return a thread handle to be used in onnxruntime thread pools\n Onnxruntime will throw exception on return value of nullptr or 0, indicating that the function failed to create a thread"]
959pub type OrtCustomCreateThreadFn = Option<
960 unsafe extern "C" fn(
961 ort_custom_thread_creation_options: *mut core::ffi::c_void,
962 ort_thread_worker_fn: OrtThreadWorkerFn,
963 ort_worker_fn_param: *mut core::ffi::c_void
964 ) -> OrtCustomThreadHandle
965>;
966#[doc = " \\brief Custom thread join function\n\n Onnxruntime thread pool destructor will call the function to join a custom thread.\n Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn"]
967pub type OrtCustomJoinThreadFn = Option<unsafe extern "C" fn(ort_custom_thread_handle: OrtCustomThreadHandle)>;
968pub type OrtThreadPoolWorkEnqueueFn = Option<unsafe extern "C" fn(user_context: *mut c_void) -> *mut c_void>;
969pub type OrtThreadPoolWorkStartFn = Option<unsafe extern "C" fn(user_context: *mut c_void, enqueue_data: *mut c_void)>;
970pub type OrtThreadPoolWorkStopFn = Option<unsafe extern "C" fn(user_context: *mut c_void, enqueue_data: *mut c_void)>;
971pub type OrtThreadPoolWorkAbandonFn = Option<unsafe extern "C" fn(user_context: *mut c_void, enqueue_data: *mut c_void)>;
972#[repr(C)]
973#[derive(Default, Debug, Clone)]
974pub struct OrtThreadPoolCallbacksConfig {
975 version: u32,
976 on_enqueue: OrtThreadPoolWorkEnqueueFn,
977 on_start_work: OrtThreadPoolWorkStartFn,
978 on_stop_work: OrtThreadPoolWorkStopFn,
979 on_abandon: OrtThreadPoolWorkAbandonFn,
980 user_context: *mut c_void
981}
982#[doc = " \\brief Callback function for RunAsync\n\n \\param[in] user_data User specific data that passed back to the callback\n \\param[out] outputs On succeed, outputs host inference results, on error, the value will be nullptr\n \\param[out] num_outputs Number of outputs, on error, the value will be zero\n \\param[out] status On error, status will provide details"]
983pub type RunAsyncCallbackFn =
984 Option<unsafe extern "C" fn(user_data: *mut core::ffi::c_void, outputs: *mut *mut OrtValue, num_outputs: usize, status: OrtStatusPtr)>;
985#[repr(i32)]
986#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
987pub enum OrtCompiledModelCompatibility {
988 EP_NOT_APPLICABLE = 0,
989 EP_SUPPORTED_OPTIMAL,
990 EP_SUPPORTED_PREFER_RECOMPILATION,
991 EP_UNSUPPORTED
992}
993#[repr(C)]
994#[derive(Default, Debug, Clone)]
995pub struct OrtEnvCreationOptions {
996 pub version: u32,
997 pub logging_severity_level: i32,
998 pub log_id: *const c_char,
999 pub custom_logging_function: Option<OrtLoggingFunction>,
1000 pub custom_logging_param: *mut c_void,
1001 pub threading_options: *const OrtThreadingOptions,
1002 pub config_entries: *const OrtKeyValuePairs
1003}
1004#[doc = " \\brief The C API\n\n All C API functions are defined inside this structure as pointers to functions.\n Call OrtApiBase::GetApi to get a pointer to it\n\n \\nosubgrouping"]
1005#[repr(C)]
1006#[derive(Debug, Clone)]
1007pub struct OrtApi {
1008 #[doc = " \\brief Create an OrtStatus from a null terminated string\n\n \\param[in] code\n \\param[in] msg A null-terminated string. Its contents will be copied.\n \\return A new OrtStatus object, must be destroyed with OrtApi::ReleaseStatus"]
1009 pub CreateStatus: unsafe extern "system" fn(code: OrtErrorCode, msg: *const core::ffi::c_char) -> OrtStatusPtr,
1010 #[doc = " \\brief Get OrtErrorCode from OrtStatus\n\n \\param[in] status\n \\return OrtErrorCode that \\p status was created with"]
1011 pub GetErrorCode: unsafe extern "system" fn(status: *const OrtStatus) -> OrtErrorCode,
1012 #[doc = " \\brief Get error string from OrtStatus\n\n \\param[in] status\n \\return The error message inside the `status`. Do not free the returned value."]
1013 pub GetErrorMessage: unsafe extern "system" fn(status: *const OrtStatus) -> *const core::ffi::c_char,
1014 pub CreateEnv: unsafe extern "system" fn(log_severity_level: OrtLoggingLevel, logid: *const core::ffi::c_char, out: *mut *mut OrtEnv) -> OrtStatusPtr,
1015 pub CreateEnvWithCustomLogger: unsafe extern "system" fn(
1016 logging_function: OrtLoggingFunction,
1017 logger_param: *mut core::ffi::c_void,
1018 log_severity_level: OrtLoggingLevel,
1019 logid: *const core::ffi::c_char,
1020 out: *mut *mut OrtEnv
1021 ) -> OrtStatusPtr,
1022 pub EnableTelemetryEvents: unsafe extern "system" fn(env: *const OrtEnv) -> OrtStatusPtr,
1023 pub DisableTelemetryEvents: unsafe extern "system" fn(env: *const OrtEnv) -> OrtStatusPtr,
1024 #[cfg(not(all(target_family = "wasm", target_os = "unknown")))]
1025 pub CreateSession:
1026 unsafe extern "system" fn(env: *const OrtEnv, model_path: *const os_char, options: *const OrtSessionOptions, out: *mut *mut OrtSession) -> OrtStatusPtr,
1027 #[cfg(all(target_family = "wasm", target_os = "unknown"))]
1028 pub CreateSession: unsafe fn(
1029 env: *const OrtEnv,
1030 model_path: &str,
1031 options: *const OrtSessionOptions,
1032 out: *mut *mut OrtSession
1033 ) -> core::pin::Pin<alloc::boxed::Box<dyn core::future::Future<Output = OrtStatusPtr>>>,
1034 #[cfg(not(all(target_family = "wasm", target_os = "unknown")))]
1035 pub CreateSessionFromArray: unsafe extern "system" fn(
1036 env: *const OrtEnv,
1037 model_data: *const core::ffi::c_void,
1038 model_data_length: usize,
1039 options: *const OrtSessionOptions,
1040 out: *mut *mut OrtSession
1041 ) -> OrtStatusPtr,
1042 #[cfg(all(target_family = "wasm", target_os = "unknown"))]
1043 pub CreateSessionFromArray: unsafe fn(
1044 env: *const OrtEnv,
1045 model_data: &[u8],
1046 options: *const OrtSessionOptions,
1047 out: *mut *mut OrtSession
1048 ) -> core::pin::Pin<alloc::boxed::Box<dyn core::future::Future<Output = OrtStatusPtr>>>,
1049 pub Run: unsafe extern "system" fn(
1050 session: *mut OrtSession,
1051 run_options: *const OrtRunOptions,
1052 input_names: *const *const core::ffi::c_char,
1053 inputs: *const *const OrtValue,
1054 input_len: usize,
1055 output_names: *const *const core::ffi::c_char,
1056 output_names_len: usize,
1057 outputs: *mut *mut OrtValue
1058 ) -> OrtStatusPtr,
1059 pub CreateSessionOptions: unsafe extern "system" fn(options: *mut *mut OrtSessionOptions) -> OrtStatusPtr,
1060 pub SetOptimizedModelFilePath: unsafe extern "system" fn(options: *mut OrtSessionOptions, optimized_model_filepath: *const os_char) -> OrtStatusPtr,
1061 pub CloneSessionOptions: unsafe extern "system" fn(in_options: *const OrtSessionOptions, out_options: *mut *mut OrtSessionOptions) -> OrtStatusPtr,
1062 pub SetSessionExecutionMode: unsafe extern "system" fn(options: *mut OrtSessionOptions, execution_mode: ExecutionMode) -> OrtStatusPtr,
1063 pub EnableProfiling: unsafe extern "system" fn(options: *mut OrtSessionOptions, profile_file_prefix: *const os_char) -> OrtStatusPtr,
1064 pub DisableProfiling: unsafe extern "system" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr,
1065 pub EnableMemPattern: unsafe extern "system" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr,
1066 pub DisableMemPattern: unsafe extern "system" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr,
1067 pub EnableCpuMemArena: unsafe extern "system" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr,
1068 pub DisableCpuMemArena: unsafe extern "system" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr,
1069 pub SetSessionLogId: unsafe extern "system" fn(options: *mut OrtSessionOptions, logid: *const core::ffi::c_char) -> OrtStatusPtr,
1070 pub SetSessionLogVerbosityLevel: unsafe extern "system" fn(options: *mut OrtSessionOptions, session_log_verbosity_level: core::ffi::c_int) -> OrtStatusPtr,
1071 pub SetSessionLogSeverityLevel: unsafe extern "system" fn(options: *mut OrtSessionOptions, session_log_severity_level: core::ffi::c_int) -> OrtStatusPtr,
1072 pub SetSessionGraphOptimizationLevel:
1073 unsafe extern "system" fn(options: *mut OrtSessionOptions, graph_optimization_level: GraphOptimizationLevel) -> OrtStatusPtr,
1074 pub SetIntraOpNumThreads: unsafe extern "system" fn(options: *mut OrtSessionOptions, intra_op_num_threads: core::ffi::c_int) -> OrtStatusPtr,
1075 pub SetInterOpNumThreads: unsafe extern "system" fn(options: *mut OrtSessionOptions, inter_op_num_threads: core::ffi::c_int) -> OrtStatusPtr,
1076 pub CreateCustomOpDomain: unsafe extern "system" fn(domain: *const core::ffi::c_char, out: *mut *mut OrtCustomOpDomain) -> OrtStatusPtr,
1077 pub CustomOpDomain_Add: unsafe extern "system" fn(custom_op_domain: *mut OrtCustomOpDomain, op: *const OrtCustomOp) -> OrtStatusPtr,
1078 pub AddCustomOpDomain: unsafe extern "system" fn(options: *mut OrtSessionOptions, custom_op_domain: *mut OrtCustomOpDomain) -> OrtStatusPtr,
1079 pub RegisterCustomOpsLibrary: unsafe extern "system" fn(
1080 options: *mut OrtSessionOptions,
1081 library_path: *const core::ffi::c_char,
1082 library_handle: *mut *mut core::ffi::c_void
1083 ) -> OrtStatusPtr,
1084 pub SessionGetInputCount: unsafe extern "system" fn(session: *const OrtSession, out: *mut usize) -> OrtStatusPtr,
1085 pub SessionGetOutputCount: unsafe extern "system" fn(session: *const OrtSession, out: *mut usize) -> OrtStatusPtr,
1086 pub SessionGetOverridableInitializerCount: unsafe extern "system" fn(session: *const OrtSession, out: *mut usize) -> OrtStatusPtr,
1087 pub SessionGetInputTypeInfo: unsafe extern "system" fn(session: *const OrtSession, index: usize, type_info: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
1088 pub SessionGetOutputTypeInfo: unsafe extern "system" fn(session: *const OrtSession, index: usize, type_info: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
1089 pub SessionGetOverridableInitializerTypeInfo:
1090 unsafe extern "system" fn(session: *const OrtSession, index: usize, type_info: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
1091 pub SessionGetInputName:
1092 unsafe extern "system" fn(session: *const OrtSession, index: usize, allocator: *mut OrtAllocator, value: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1093 pub SessionGetOutputName:
1094 unsafe extern "system" fn(session: *const OrtSession, index: usize, allocator: *mut OrtAllocator, value: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1095 pub SessionGetOverridableInitializerName:
1096 unsafe extern "system" fn(session: *const OrtSession, index: usize, allocator: *mut OrtAllocator, value: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1097 pub CreateRunOptions: unsafe extern "system" fn(out: *mut *mut OrtRunOptions) -> OrtStatusPtr,
1098 pub RunOptionsSetRunLogVerbosityLevel: unsafe extern "system" fn(options: *mut OrtRunOptions, log_verbosity_level: core::ffi::c_int) -> OrtStatusPtr,
1099 pub RunOptionsSetRunLogSeverityLevel: unsafe extern "system" fn(options: *mut OrtRunOptions, log_severity_level: core::ffi::c_int) -> OrtStatusPtr,
1100 pub RunOptionsSetRunTag: unsafe extern "system" fn(options: *mut OrtRunOptions, run_tag: *const core::ffi::c_char) -> OrtStatusPtr,
1101 pub RunOptionsGetRunLogVerbosityLevel: unsafe extern "system" fn(options: *const OrtRunOptions, log_verbosity_level: *mut core::ffi::c_int) -> OrtStatusPtr,
1102 pub RunOptionsGetRunLogSeverityLevel: unsafe extern "system" fn(options: *const OrtRunOptions, log_severity_level: *mut core::ffi::c_int) -> OrtStatusPtr,
1103 pub RunOptionsGetRunTag: unsafe extern "system" fn(options: *const OrtRunOptions, run_tag: *mut *const core::ffi::c_char) -> OrtStatusPtr,
1104 pub RunOptionsSetTerminate: unsafe extern "system" fn(options: *mut OrtRunOptions) -> OrtStatusPtr,
1105 pub RunOptionsUnsetTerminate: unsafe extern "system" fn(options: *mut OrtRunOptions) -> OrtStatusPtr,
1106 pub CreateTensorAsOrtValue: unsafe extern "system" fn(
1107 allocator: *mut OrtAllocator,
1108 shape: *const i64,
1109 shape_len: usize,
1110 type_: ONNXTensorElementDataType,
1111 out: *mut *mut OrtValue
1112 ) -> OrtStatusPtr,
1113 pub CreateTensorWithDataAsOrtValue: unsafe extern "system" fn(
1114 info: *const OrtMemoryInfo,
1115 p_data: *mut core::ffi::c_void,
1116 p_data_len: usize,
1117 shape: *const i64,
1118 shape_len: usize,
1119 type_: ONNXTensorElementDataType,
1120 out: *mut *mut OrtValue
1121 ) -> OrtStatusPtr,
1122 pub IsTensor: unsafe extern "system" fn(value: *const OrtValue, out: *mut core::ffi::c_int) -> OrtStatusPtr,
1123 pub GetTensorMutableData: unsafe extern "system" fn(value: *mut OrtValue, out: *mut *mut core::ffi::c_void) -> OrtStatusPtr,
1124 pub FillStringTensor: unsafe extern "system" fn(value: *mut OrtValue, s: *const *const core::ffi::c_char, s_len: usize) -> OrtStatusPtr,
1125 pub GetStringTensorDataLength: unsafe extern "system" fn(value: *const OrtValue, len: *mut usize) -> OrtStatusPtr,
1126 pub GetStringTensorContent:
1127 unsafe extern "system" fn(value: *const OrtValue, s: *mut core::ffi::c_void, s_len: usize, offsets: *mut usize, offsets_len: usize) -> OrtStatusPtr,
1128 pub CastTypeInfoToTensorInfo: unsafe extern "system" fn(type_info: *const OrtTypeInfo, out: *mut *const OrtTensorTypeAndShapeInfo) -> OrtStatusPtr,
1129 pub GetOnnxTypeFromTypeInfo: unsafe extern "system" fn(type_info: *const OrtTypeInfo, out: *mut ONNXType) -> OrtStatusPtr,
1130 pub CreateTensorTypeAndShapeInfo: unsafe extern "system" fn(out: *mut *mut OrtTensorTypeAndShapeInfo) -> OrtStatusPtr,
1131 pub SetTensorElementType: unsafe extern "system" fn(info: *mut OrtTensorTypeAndShapeInfo, type_: ONNXTensorElementDataType) -> OrtStatusPtr,
1132 pub SetDimensions: unsafe extern "system" fn(info: *mut OrtTensorTypeAndShapeInfo, dim_values: *const i64, dim_count: usize) -> OrtStatusPtr,
1133 pub GetTensorElementType: unsafe extern "system" fn(info: *const OrtTensorTypeAndShapeInfo, out: *mut ONNXTensorElementDataType) -> OrtStatusPtr,
1134 pub GetDimensionsCount: unsafe extern "system" fn(info: *const OrtTensorTypeAndShapeInfo, out: *mut usize) -> OrtStatusPtr,
1135 pub GetDimensions: unsafe extern "system" fn(info: *const OrtTensorTypeAndShapeInfo, dim_values: *mut i64, dim_values_length: usize) -> OrtStatusPtr,
1136 pub GetSymbolicDimensions:
1137 unsafe extern "system" fn(info: *const OrtTensorTypeAndShapeInfo, dim_params: *mut *const core::ffi::c_char, dim_params_length: usize) -> OrtStatusPtr,
1138 pub GetTensorShapeElementCount: unsafe extern "system" fn(info: *const OrtTensorTypeAndShapeInfo, out: *mut usize) -> OrtStatusPtr,
1139 pub GetTensorTypeAndShape: unsafe extern "system" fn(value: *const OrtValue, out: *mut *mut OrtTensorTypeAndShapeInfo) -> OrtStatusPtr,
1140 pub GetTypeInfo: unsafe extern "system" fn(value: *const OrtValue, out: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
1141 pub GetValueType: unsafe extern "system" fn(value: *const OrtValue, out: *mut ONNXType) -> OrtStatusPtr,
1142 pub CreateMemoryInfo: unsafe extern "system" fn(
1143 name: *const core::ffi::c_char,
1144 type_: OrtAllocatorType,
1145 id: core::ffi::c_int,
1146 mem_type: OrtMemType,
1147 out: *mut *mut OrtMemoryInfo
1148 ) -> OrtStatusPtr,
1149 pub CreateCpuMemoryInfo: unsafe extern "system" fn(type_: OrtAllocatorType, mem_type: OrtMemType, out: *mut *mut OrtMemoryInfo) -> OrtStatusPtr,
1150 pub CompareMemoryInfo: unsafe extern "system" fn(info1: *const OrtMemoryInfo, info2: *const OrtMemoryInfo, out: *mut core::ffi::c_int) -> OrtStatusPtr,
1151 pub MemoryInfoGetName: unsafe extern "system" fn(ptr: *const OrtMemoryInfo, out: *mut *const core::ffi::c_char) -> OrtStatusPtr,
1152 pub MemoryInfoGetId: unsafe extern "system" fn(ptr: *const OrtMemoryInfo, out: *mut core::ffi::c_int) -> OrtStatusPtr,
1153 pub MemoryInfoGetMemType: unsafe extern "system" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemType) -> OrtStatusPtr,
1154 pub MemoryInfoGetType: unsafe extern "system" fn(ptr: *const OrtMemoryInfo, out: *mut OrtAllocatorType) -> OrtStatusPtr,
1155 pub AllocatorAlloc: unsafe extern "system" fn(ort_allocator: *mut OrtAllocator, size: usize, out: *mut *mut core::ffi::c_void) -> OrtStatusPtr,
1156 pub AllocatorFree: unsafe extern "system" fn(ort_allocator: *mut OrtAllocator, p: *mut core::ffi::c_void) -> OrtStatusPtr,
1157 pub AllocatorGetInfo: unsafe extern "system" fn(ort_allocator: *const OrtAllocator, out: *mut *const OrtMemoryInfo) -> OrtStatusPtr,
1158 pub GetAllocatorWithDefaultOptions: unsafe extern "system" fn(out: *mut *mut OrtAllocator) -> OrtStatusPtr,
1159 pub AddFreeDimensionOverride:
1160 unsafe extern "system" fn(options: *mut OrtSessionOptions, dim_denotation: *const core::ffi::c_char, dim_value: i64) -> OrtStatusPtr,
1161 pub GetValue:
1162 unsafe extern "system" fn(value: *const OrtValue, index: core::ffi::c_int, allocator: *mut OrtAllocator, out: *mut *mut OrtValue) -> OrtStatusPtr,
1163 pub GetValueCount: unsafe extern "system" fn(value: *const OrtValue, out: *mut usize) -> OrtStatusPtr,
1164 pub CreateValue: unsafe extern "system" fn(in_: *const *const OrtValue, num_values: usize, value_type: ONNXType, out: *mut *mut OrtValue) -> OrtStatusPtr,
1165 pub CreateOpaqueValue: unsafe extern "system" fn(
1166 domain_name: *const core::ffi::c_char,
1167 type_name: *const core::ffi::c_char,
1168 data_container: *const core::ffi::c_void,
1169 data_container_size: usize,
1170 out: *mut *mut OrtValue
1171 ) -> OrtStatusPtr,
1172 pub GetOpaqueValue: unsafe extern "system" fn(
1173 domain_name: *const core::ffi::c_char,
1174 type_name: *const core::ffi::c_char,
1175 in_: *const OrtValue,
1176 data_container: *mut core::ffi::c_void,
1177 data_container_size: usize
1178 ) -> OrtStatusPtr,
1179 pub KernelInfoGetAttribute_float: unsafe extern "system" fn(info: *const OrtKernelInfo, name: *const core::ffi::c_char, out: *mut f32) -> OrtStatusPtr,
1180 pub KernelInfoGetAttribute_int64: unsafe extern "system" fn(info: *const OrtKernelInfo, name: *const core::ffi::c_char, out: *mut i64) -> OrtStatusPtr,
1181 pub KernelInfoGetAttribute_string:
1182 unsafe extern "system" fn(info: *const OrtKernelInfo, name: *const core::ffi::c_char, out: *mut core::ffi::c_char, size: *mut usize) -> OrtStatusPtr,
1183 pub KernelContext_GetInputCount: unsafe extern "system" fn(context: *const OrtKernelContext, out: *mut usize) -> OrtStatusPtr,
1184 pub KernelContext_GetOutputCount: unsafe extern "system" fn(context: *const OrtKernelContext, out: *mut usize) -> OrtStatusPtr,
1185 pub KernelContext_GetInput: unsafe extern "system" fn(context: *const OrtKernelContext, index: usize, out: *mut *const OrtValue) -> OrtStatusPtr,
1186 pub KernelContext_GetOutput: unsafe extern "system" fn(
1187 context: *mut OrtKernelContext,
1188 index: usize,
1189 dim_values: *const i64,
1190 dim_count: usize,
1191 out: *mut *mut OrtValue
1192 ) -> OrtStatusPtr,
1193 pub ReleaseEnv: unsafe extern "system" fn(input: *mut OrtEnv),
1194 pub ReleaseStatus: unsafe extern "system" fn(input: *mut OrtStatus),
1195 pub ReleaseMemoryInfo: unsafe extern "system" fn(input: *mut OrtMemoryInfo),
1196 pub ReleaseSession: unsafe extern "system" fn(input: *mut OrtSession),
1197 pub ReleaseValue: unsafe extern "system" fn(input: *mut OrtValue),
1198 pub ReleaseRunOptions: unsafe extern "system" fn(input: *mut OrtRunOptions),
1199 pub ReleaseTypeInfo: unsafe extern "system" fn(input: *mut OrtTypeInfo),
1200 pub ReleaseTensorTypeAndShapeInfo: unsafe extern "system" fn(input: *mut OrtTensorTypeAndShapeInfo),
1201 pub ReleaseSessionOptions: unsafe extern "system" fn(input: *mut OrtSessionOptions),
1202 pub ReleaseCustomOpDomain: unsafe extern "system" fn(input: *mut OrtCustomOpDomain),
1203 pub GetDenotationFromTypeInfo:
1204 unsafe extern "system" fn(type_info: *const OrtTypeInfo, denotation: *mut *const core::ffi::c_char, len: *mut usize) -> OrtStatusPtr,
1205 pub CastTypeInfoToMapTypeInfo: unsafe extern "system" fn(type_info: *const OrtTypeInfo, out: *mut *const OrtMapTypeInfo) -> OrtStatusPtr,
1206 pub CastTypeInfoToSequenceTypeInfo: unsafe extern "system" fn(type_info: *const OrtTypeInfo, out: *mut *const OrtSequenceTypeInfo) -> OrtStatusPtr,
1207 pub GetMapKeyType: unsafe extern "system" fn(map_type_info: *const OrtMapTypeInfo, out: *mut ONNXTensorElementDataType) -> OrtStatusPtr,
1208 pub GetMapValueType: unsafe extern "system" fn(map_type_info: *const OrtMapTypeInfo, type_info: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
1209 pub GetSequenceElementType: unsafe extern "system" fn(sequence_type_info: *const OrtSequenceTypeInfo, type_info: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
1210 pub ReleaseMapTypeInfo: unsafe extern "system" fn(input: *mut OrtMapTypeInfo),
1211 pub ReleaseSequenceTypeInfo: unsafe extern "system" fn(input: *mut OrtSequenceTypeInfo),
1212 pub SessionEndProfiling:
1213 unsafe extern "system" fn(session: *mut OrtSession, allocator: *mut OrtAllocator, out: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1214 pub SessionGetModelMetadata: unsafe extern "system" fn(session: *const OrtSession, out: *mut *mut OrtModelMetadata) -> OrtStatusPtr,
1215 pub ModelMetadataGetProducerName:
1216 unsafe extern "system" fn(model_metadata: *const OrtModelMetadata, allocator: *mut OrtAllocator, value: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1217 pub ModelMetadataGetGraphName:
1218 unsafe extern "system" fn(model_metadata: *const OrtModelMetadata, allocator: *mut OrtAllocator, value: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1219 pub ModelMetadataGetDomain:
1220 unsafe extern "system" fn(model_metadata: *const OrtModelMetadata, allocator: *mut OrtAllocator, value: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1221 pub ModelMetadataGetDescription:
1222 unsafe extern "system" fn(model_metadata: *const OrtModelMetadata, allocator: *mut OrtAllocator, value: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1223 pub ModelMetadataLookupCustomMetadataMap: unsafe extern "system" fn(
1224 model_metadata: *const OrtModelMetadata,
1225 allocator: *mut OrtAllocator,
1226 key: *const core::ffi::c_char,
1227 value: *mut *mut core::ffi::c_char
1228 ) -> OrtStatusPtr,
1229 pub ModelMetadataGetVersion: unsafe extern "system" fn(model_metadata: *const OrtModelMetadata, value: *mut i64) -> OrtStatusPtr,
1230 pub ReleaseModelMetadata: unsafe extern "system" fn(input: *mut OrtModelMetadata),
1231 pub CreateEnvWithGlobalThreadPools: unsafe extern "system" fn(
1232 log_severity_level: OrtLoggingLevel,
1233 logid: *const core::ffi::c_char,
1234 tp_options: *const OrtThreadingOptions,
1235 out: *mut *mut OrtEnv
1236 ) -> OrtStatusPtr,
1237 pub DisablePerSessionThreads: unsafe extern "system" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr,
1238 pub CreateThreadingOptions: unsafe extern "system" fn(out: *mut *mut OrtThreadingOptions) -> OrtStatusPtr,
1239 pub ReleaseThreadingOptions: unsafe extern "system" fn(input: *mut OrtThreadingOptions),
1240 pub ModelMetadataGetCustomMetadataMapKeys: unsafe extern "system" fn(
1241 model_metadata: *const OrtModelMetadata,
1242 allocator: *mut OrtAllocator,
1243 keys: *mut *mut *mut core::ffi::c_char,
1244 num_keys: *mut i64
1245 ) -> OrtStatusPtr,
1246 pub AddFreeDimensionOverrideByName:
1247 unsafe extern "system" fn(options: *mut OrtSessionOptions, dim_name: *const core::ffi::c_char, dim_value: i64) -> OrtStatusPtr,
1248 pub GetAvailableProviders: unsafe extern "system" fn(out_ptr: *mut *mut *mut core::ffi::c_char, provider_length: *mut core::ffi::c_int) -> OrtStatusPtr,
1249 pub ReleaseAvailableProviders: unsafe extern "system" fn(ptr: *mut *mut core::ffi::c_char, providers_length: core::ffi::c_int) -> OrtStatusPtr,
1250 pub GetStringTensorElementLength: unsafe extern "system" fn(value: *const OrtValue, index: usize, out: *mut usize) -> OrtStatusPtr,
1251 pub GetStringTensorElement: unsafe extern "system" fn(value: *const OrtValue, s_len: usize, index: usize, s: *mut core::ffi::c_void) -> OrtStatusPtr,
1252 pub FillStringTensorElement: unsafe extern "system" fn(value: *mut OrtValue, s: *const core::ffi::c_char, index: usize) -> OrtStatusPtr,
1253 pub AddSessionConfigEntry: unsafe extern "system" fn(
1254 options: *mut OrtSessionOptions,
1255 config_key: *const core::ffi::c_char,
1256 config_value: *const core::ffi::c_char
1257 ) -> OrtStatusPtr,
1258 pub CreateAllocator: unsafe extern "system" fn(session: *const OrtSession, mem_info: *const OrtMemoryInfo, out: *mut *mut OrtAllocator) -> OrtStatusPtr,
1259 pub ReleaseAllocator: unsafe extern "system" fn(input: *mut OrtAllocator),
1260 pub RunWithBinding:
1261 unsafe extern "system" fn(session: *mut OrtSession, run_options: *const OrtRunOptions, binding_ptr: *const OrtIoBinding) -> OrtStatusPtr,
1262 pub CreateIoBinding: unsafe extern "system" fn(session: *mut OrtSession, out: *mut *mut OrtIoBinding) -> OrtStatusPtr,
1263 pub ReleaseIoBinding: unsafe extern "system" fn(input: *mut OrtIoBinding),
1264 pub BindInput: unsafe extern "system" fn(binding_ptr: *mut OrtIoBinding, name: *const core::ffi::c_char, val_ptr: *const OrtValue) -> OrtStatusPtr,
1265 pub BindOutput: unsafe extern "system" fn(binding_ptr: *mut OrtIoBinding, name: *const core::ffi::c_char, val_ptr: *const OrtValue) -> OrtStatusPtr,
1266 pub BindOutputToDevice:
1267 unsafe extern "system" fn(binding_ptr: *mut OrtIoBinding, name: *const core::ffi::c_char, mem_info_ptr: *const OrtMemoryInfo) -> OrtStatusPtr,
1268 pub GetBoundOutputNames: unsafe extern "system" fn(
1269 binding_ptr: *const OrtIoBinding,
1270 allocator: *mut OrtAllocator,
1271 buffer: *mut *mut core::ffi::c_char,
1272 lengths: *mut *mut usize,
1273 count: *mut usize
1274 ) -> OrtStatusPtr,
1275 pub GetBoundOutputValues: unsafe extern "system" fn(
1276 binding_ptr: *const OrtIoBinding,
1277 allocator: *mut OrtAllocator,
1278 output: *mut *mut *mut OrtValue,
1279 output_count: *mut usize
1280 ) -> OrtStatusPtr,
1281 #[doc = " \\brief Clears any previously set Inputs for an ::OrtIoBinding"]
1282 pub ClearBoundInputs: unsafe extern "system" fn(binding_ptr: *mut OrtIoBinding),
1283 #[doc = " \\brief Clears any previously set Outputs for an ::OrtIoBinding"]
1284 pub ClearBoundOutputs: unsafe extern "system" fn(binding_ptr: *mut OrtIoBinding),
1285 pub TensorAt: unsafe extern "system" fn(
1286 value: *mut OrtValue,
1287 location_values: *const i64,
1288 location_values_count: usize,
1289 out: *mut *mut core::ffi::c_void
1290 ) -> OrtStatusPtr,
1291 pub CreateAndRegisterAllocator: unsafe extern "system" fn(env: *mut OrtEnv, mem_info: *const OrtMemoryInfo, arena_cfg: *const OrtArenaCfg) -> OrtStatusPtr,
1292 pub SetLanguageProjection: unsafe extern "system" fn(ort_env: *const OrtEnv, projection: OrtLanguageProjection) -> OrtStatusPtr,
1293 pub SessionGetProfilingStartTimeNs: unsafe extern "system" fn(session: *const OrtSession, out: *mut u64) -> OrtStatusPtr,
1294 pub SetGlobalIntraOpNumThreads: unsafe extern "system" fn(tp_options: *mut OrtThreadingOptions, intra_op_num_threads: core::ffi::c_int) -> OrtStatusPtr,
1295 pub SetGlobalInterOpNumThreads: unsafe extern "system" fn(tp_options: *mut OrtThreadingOptions, inter_op_num_threads: core::ffi::c_int) -> OrtStatusPtr,
1296 pub SetGlobalSpinControl: unsafe extern "system" fn(tp_options: *mut OrtThreadingOptions, allow_spinning: core::ffi::c_int) -> OrtStatusPtr,
1297 pub AddInitializer: unsafe extern "system" fn(options: *mut OrtSessionOptions, name: *const core::ffi::c_char, val: *const OrtValue) -> OrtStatusPtr,
1298 pub CreateEnvWithCustomLoggerAndGlobalThreadPools: unsafe extern "system" fn(
1299 logging_function: OrtLoggingFunction,
1300 logger_param: *mut core::ffi::c_void,
1301 log_severity_level: OrtLoggingLevel,
1302 logid: *const core::ffi::c_char,
1303 tp_options: *const OrtThreadingOptions,
1304 out: *mut *mut OrtEnv
1305 ) -> OrtStatusPtr,
1306 pub SessionOptionsAppendExecutionProvider_CUDA:
1307 unsafe extern "system" fn(options: *mut OrtSessionOptions, cuda_options: *const OrtCUDAProviderOptions) -> OrtStatusPtr,
1308 pub SessionOptionsAppendExecutionProvider_ROCM:
1309 unsafe extern "system" fn(options: *mut OrtSessionOptions, rocm_options: *const OrtROCMProviderOptions) -> OrtStatusPtr,
1310 pub SessionOptionsAppendExecutionProvider_OpenVINO:
1311 unsafe extern "system" fn(options: *mut OrtSessionOptions, provider_options: *const OrtOpenVINOProviderOptions) -> OrtStatusPtr,
1312 pub SetGlobalDenormalAsZero: unsafe extern "system" fn(tp_options: *mut OrtThreadingOptions) -> OrtStatusPtr,
1313 pub CreateArenaCfg: unsafe extern "system" fn(
1314 max_mem: usize,
1315 arena_extend_strategy: core::ffi::c_int,
1316 initial_chunk_size_bytes: core::ffi::c_int,
1317 max_dead_bytes_per_chunk: core::ffi::c_int,
1318 out: *mut *mut OrtArenaCfg
1319 ) -> OrtStatusPtr,
1320 pub ReleaseArenaCfg: unsafe extern "system" fn(input: *mut OrtArenaCfg),
1321 pub ModelMetadataGetGraphDescription:
1322 unsafe extern "system" fn(model_metadata: *const OrtModelMetadata, allocator: *mut OrtAllocator, value: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1323 pub SessionOptionsAppendExecutionProvider_TensorRT:
1324 unsafe extern "system" fn(options: *mut OrtSessionOptions, tensorrt_options: *const OrtTensorRTProviderOptions) -> OrtStatusPtr,
1325 pub SetCurrentGpuDeviceId: unsafe extern "system" fn(device_id: core::ffi::c_int) -> OrtStatusPtr,
1326 pub GetCurrentGpuDeviceId: unsafe extern "system" fn(device_id: *mut core::ffi::c_int) -> OrtStatusPtr,
1327 pub KernelInfoGetAttributeArray_float:
1328 unsafe extern "system" fn(info: *const OrtKernelInfo, name: *const core::ffi::c_char, out: *mut f32, size: *mut usize) -> OrtStatusPtr,
1329 pub KernelInfoGetAttributeArray_int64:
1330 unsafe extern "system" fn(info: *const OrtKernelInfo, name: *const core::ffi::c_char, out: *mut i64, size: *mut usize) -> OrtStatusPtr,
1331 pub CreateArenaCfgV2: unsafe extern "system" fn(
1332 arena_config_keys: *const *const core::ffi::c_char,
1333 arena_config_values: *const usize,
1334 num_keys: usize,
1335 out: *mut *mut OrtArenaCfg
1336 ) -> OrtStatusPtr,
1337 pub AddRunConfigEntry:
1338 unsafe extern "system" fn(options: *mut OrtRunOptions, config_key: *const core::ffi::c_char, config_value: *const core::ffi::c_char) -> OrtStatusPtr,
1339 pub CreatePrepackedWeightsContainer: unsafe extern "system" fn(out: *mut *mut OrtPrepackedWeightsContainer) -> OrtStatusPtr,
1340 pub ReleasePrepackedWeightsContainer: unsafe extern "system" fn(input: *mut OrtPrepackedWeightsContainer),
1341 pub CreateSessionWithPrepackedWeightsContainer: unsafe extern "system" fn(
1342 env: *const OrtEnv,
1343 model_path: *const os_char,
1344 options: *const OrtSessionOptions,
1345 prepacked_weights_container: *mut OrtPrepackedWeightsContainer,
1346 out: *mut *mut OrtSession
1347 ) -> OrtStatusPtr,
1348 pub CreateSessionFromArrayWithPrepackedWeightsContainer: unsafe extern "system" fn(
1349 env: *const OrtEnv,
1350 model_data: *const core::ffi::c_void,
1351 model_data_length: usize,
1352 options: *const OrtSessionOptions,
1353 prepacked_weights_container: *mut OrtPrepackedWeightsContainer,
1354 out: *mut *mut OrtSession
1355 ) -> OrtStatusPtr,
1356 pub SessionOptionsAppendExecutionProvider_TensorRT_V2:
1357 unsafe extern "system" fn(options: *mut OrtSessionOptions, tensorrt_options: *const OrtTensorRTProviderOptionsV2) -> OrtStatusPtr,
1358 pub CreateTensorRTProviderOptions: unsafe extern "system" fn(out: *mut *mut OrtTensorRTProviderOptionsV2) -> OrtStatusPtr,
1359 pub UpdateTensorRTProviderOptions: unsafe extern "system" fn(
1360 tensorrt_options: *mut OrtTensorRTProviderOptionsV2,
1361 provider_options_keys: *const *const core::ffi::c_char,
1362 provider_options_values: *const *const core::ffi::c_char,
1363 num_keys: usize
1364 ) -> OrtStatusPtr,
1365 pub GetTensorRTProviderOptionsAsString: unsafe extern "system" fn(
1366 tensorrt_options: *const OrtTensorRTProviderOptionsV2,
1367 allocator: *mut OrtAllocator,
1368 ptr: *mut *mut core::ffi::c_char
1369 ) -> OrtStatusPtr,
1370 #[doc = " \\brief Release an ::OrtTensorRTProviderOptionsV2\n\n \\note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does"]
1371 pub ReleaseTensorRTProviderOptions: unsafe extern "system" fn(input: *mut OrtTensorRTProviderOptionsV2),
1372 pub EnableOrtCustomOps: unsafe extern "system" fn(options: *mut OrtSessionOptions) -> OrtStatusPtr,
1373 pub RegisterAllocator: unsafe extern "system" fn(env: *mut OrtEnv, allocator: *mut OrtAllocator) -> OrtStatusPtr,
1374 pub UnregisterAllocator: unsafe extern "system" fn(env: *mut OrtEnv, mem_info: *const OrtMemoryInfo) -> OrtStatusPtr,
1375 pub IsSparseTensor: unsafe extern "system" fn(value: *const OrtValue, out: *mut core::ffi::c_int) -> OrtStatusPtr,
1376 pub CreateSparseTensorAsOrtValue: unsafe extern "system" fn(
1377 allocator: *mut OrtAllocator,
1378 dense_shape: *const i64,
1379 dense_shape_len: usize,
1380 type_: ONNXTensorElementDataType,
1381 out: *mut *mut OrtValue
1382 ) -> OrtStatusPtr,
1383 pub FillSparseTensorCoo: unsafe extern "system" fn(
1384 ort_value: *mut OrtValue,
1385 data_mem_info: *const OrtMemoryInfo,
1386 values_shape: *const i64,
1387 values_shape_len: usize,
1388 values: *const core::ffi::c_void,
1389 indices_data: *const i64,
1390 indices_num: usize
1391 ) -> OrtStatusPtr,
1392 pub FillSparseTensorCsr: unsafe extern "system" fn(
1393 ort_value: *mut OrtValue,
1394 data_mem_info: *const OrtMemoryInfo,
1395 values_shape: *const i64,
1396 values_shape_len: usize,
1397 values: *const core::ffi::c_void,
1398 inner_indices_data: *const i64,
1399 inner_indices_num: usize,
1400 outer_indices_data: *const i64,
1401 outer_indices_num: usize
1402 ) -> OrtStatusPtr,
1403 pub FillSparseTensorBlockSparse: unsafe extern "system" fn(
1404 ort_value: *mut OrtValue,
1405 data_mem_info: *const OrtMemoryInfo,
1406 values_shape: *const i64,
1407 values_shape_len: usize,
1408 values: *const core::ffi::c_void,
1409 indices_shape_data: *const i64,
1410 indices_shape_len: usize,
1411 indices_data: *const i32
1412 ) -> OrtStatusPtr,
1413 pub CreateSparseTensorWithValuesAsOrtValue: unsafe extern "system" fn(
1414 info: *const OrtMemoryInfo,
1415 p_data: *mut core::ffi::c_void,
1416 dense_shape: *const i64,
1417 dense_shape_len: usize,
1418 values_shape: *const i64,
1419 values_shape_len: usize,
1420 type_: ONNXTensorElementDataType,
1421 out: *mut *mut OrtValue
1422 ) -> OrtStatusPtr,
1423 pub UseCooIndices: unsafe extern "system" fn(ort_value: *mut OrtValue, indices_data: *mut i64, indices_num: usize) -> OrtStatusPtr,
1424 pub UseCsrIndices:
1425 unsafe extern "system" fn(ort_value: *mut OrtValue, inner_data: *mut i64, inner_num: usize, outer_data: *mut i64, outer_num: usize) -> OrtStatusPtr,
1426 pub UseBlockSparseIndices:
1427 unsafe extern "system" fn(ort_value: *mut OrtValue, indices_shape: *const i64, indices_shape_len: usize, indices_data: *mut i32) -> OrtStatusPtr,
1428 pub GetSparseTensorFormat: unsafe extern "system" fn(ort_value: *const OrtValue, out: *mut OrtSparseFormat) -> OrtStatusPtr,
1429 pub GetSparseTensorValuesTypeAndShape: unsafe extern "system" fn(ort_value: *const OrtValue, out: *mut *mut OrtTensorTypeAndShapeInfo) -> OrtStatusPtr,
1430 pub GetSparseTensorValues: unsafe extern "system" fn(ort_value: *const OrtValue, out: *mut *const core::ffi::c_void) -> OrtStatusPtr,
1431 pub GetSparseTensorIndicesTypeShape:
1432 unsafe extern "system" fn(ort_value: *const OrtValue, indices_format: OrtSparseIndicesFormat, out: *mut *mut OrtTensorTypeAndShapeInfo) -> OrtStatusPtr,
1433 pub GetSparseTensorIndices: unsafe extern "system" fn(
1434 ort_value: *const OrtValue,
1435 indices_format: OrtSparseIndicesFormat,
1436 num_indices: *mut usize,
1437 indices: *mut *const core::ffi::c_void
1438 ) -> OrtStatusPtr,
1439 pub HasValue: unsafe extern "system" fn(value: *const OrtValue, out: *mut core::ffi::c_int) -> OrtStatusPtr,
1440 pub KernelContext_GetGPUComputeStream: unsafe extern "system" fn(context: *const OrtKernelContext, out: *mut *mut core::ffi::c_void) -> OrtStatusPtr,
1441 pub GetTensorMemoryInfo: unsafe extern "system" fn(value: *const OrtValue, mem_info: *mut *const OrtMemoryInfo) -> OrtStatusPtr,
1442 pub GetExecutionProviderApi:
1443 unsafe extern "system" fn(provider_name: *const core::ffi::c_char, version: u32, provider_api: *mut *const core::ffi::c_void) -> OrtStatusPtr,
1444 pub SessionOptionsSetCustomCreateThreadFn:
1445 unsafe extern "system" fn(options: *mut OrtSessionOptions, ort_custom_create_thread_fn: OrtCustomCreateThreadFn) -> OrtStatusPtr,
1446 pub SessionOptionsSetCustomThreadCreationOptions:
1447 unsafe extern "system" fn(options: *mut OrtSessionOptions, ort_custom_thread_creation_options: *mut core::ffi::c_void) -> OrtStatusPtr,
1448 pub SessionOptionsSetCustomJoinThreadFn:
1449 unsafe extern "system" fn(options: *mut OrtSessionOptions, ort_custom_join_thread_fn: OrtCustomJoinThreadFn) -> OrtStatusPtr,
1450 pub SetGlobalCustomCreateThreadFn:
1451 unsafe extern "system" fn(tp_options: *mut OrtThreadingOptions, ort_custom_create_thread_fn: OrtCustomCreateThreadFn) -> OrtStatusPtr,
1452 pub SetGlobalCustomThreadCreationOptions:
1453 unsafe extern "system" fn(tp_options: *mut OrtThreadingOptions, ort_custom_thread_creation_options: *mut core::ffi::c_void) -> OrtStatusPtr,
1454 pub SetGlobalCustomJoinThreadFn:
1455 unsafe extern "system" fn(tp_options: *mut OrtThreadingOptions, ort_custom_join_thread_fn: OrtCustomJoinThreadFn) -> OrtStatusPtr,
1456 pub SynchronizeBoundInputs: unsafe extern "system" fn(binding_ptr: *mut OrtIoBinding) -> OrtStatusPtr,
1457 pub SynchronizeBoundOutputs: unsafe extern "system" fn(binding_ptr: *mut OrtIoBinding) -> OrtStatusPtr,
1458 pub SessionOptionsAppendExecutionProvider_CUDA_V2:
1459 unsafe extern "system" fn(options: *mut OrtSessionOptions, cuda_options: *const OrtCUDAProviderOptionsV2) -> OrtStatusPtr,
1460 pub CreateCUDAProviderOptions: unsafe extern "system" fn(out: *mut *mut OrtCUDAProviderOptionsV2) -> OrtStatusPtr,
1461 pub UpdateCUDAProviderOptions: unsafe extern "system" fn(
1462 cuda_options: *mut OrtCUDAProviderOptionsV2,
1463 provider_options_keys: *const *const core::ffi::c_char,
1464 provider_options_values: *const *const core::ffi::c_char,
1465 num_keys: usize
1466 ) -> OrtStatusPtr,
1467 pub GetCUDAProviderOptionsAsString: unsafe extern "system" fn(
1468 cuda_options: *const OrtCUDAProviderOptionsV2,
1469 allocator: *mut OrtAllocator,
1470 ptr: *mut *mut core::ffi::c_char
1471 ) -> OrtStatusPtr,
1472 #[doc = " \\brief Release an ::OrtCUDAProviderOptionsV2\n\n \\note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does\n\n \\since Version 1.11."]
1473 pub ReleaseCUDAProviderOptions: unsafe extern "system" fn(input: *mut OrtCUDAProviderOptionsV2),
1474 pub SessionOptionsAppendExecutionProvider_MIGraphX:
1475 unsafe extern "system" fn(options: *mut OrtSessionOptions, migraphx_options: *const OrtMIGraphXProviderOptions) -> OrtStatusPtr,
1476 pub AddExternalInitializers: unsafe extern "system" fn(
1477 options: *mut OrtSessionOptions,
1478 initializer_names: *const *const core::ffi::c_char,
1479 initializers: *const *const OrtValue,
1480 initializers_num: usize
1481 ) -> OrtStatusPtr,
1482 pub CreateOpAttr: unsafe extern "system" fn(
1483 name: *const core::ffi::c_char,
1484 data: *const core::ffi::c_void,
1485 len: core::ffi::c_int,
1486 type_: OrtOpAttrType,
1487 op_attr: *mut *mut OrtOpAttr
1488 ) -> OrtStatusPtr,
1489 pub ReleaseOpAttr: unsafe extern "system" fn(input: *mut OrtOpAttr),
1490 pub CreateOp: unsafe extern "system" fn(
1491 info: *const OrtKernelInfo,
1492 op_name: *const core::ffi::c_char,
1493 domain: *const core::ffi::c_char,
1494 version: core::ffi::c_int,
1495 type_constraint_names: *mut *const core::ffi::c_char,
1496 type_constraint_values: *const ONNXTensorElementDataType,
1497 type_constraint_count: core::ffi::c_int,
1498 attr_values: *const *const OrtOpAttr,
1499 attr_count: core::ffi::c_int,
1500 input_count: core::ffi::c_int,
1501 output_count: core::ffi::c_int,
1502 ort_op: *mut *mut OrtOp
1503 ) -> OrtStatusPtr,
1504 pub InvokeOp: unsafe extern "system" fn(
1505 context: *const OrtKernelContext,
1506 ort_op: *const OrtOp,
1507 input_values: *const *const OrtValue,
1508 input_count: core::ffi::c_int,
1509 output_values: *const *mut OrtValue,
1510 output_count: core::ffi::c_int
1511 ) -> OrtStatusPtr,
1512 pub ReleaseOp: unsafe extern "system" fn(input: *mut OrtOp),
1513 pub SessionOptionsAppendExecutionProvider: unsafe extern "system" fn(
1514 options: *mut OrtSessionOptions,
1515 provider_name: *const core::ffi::c_char,
1516 provider_options_keys: *const *const core::ffi::c_char,
1517 provider_options_values: *const *const core::ffi::c_char,
1518 num_keys: usize
1519 ) -> OrtStatusPtr,
1520 pub CopyKernelInfo: unsafe extern "system" fn(info: *const OrtKernelInfo, info_copy: *mut *mut OrtKernelInfo) -> OrtStatusPtr,
1521 pub ReleaseKernelInfo: unsafe extern "system" fn(input: *mut OrtKernelInfo),
1522 #[doc = " \\name Ort Training\n @{\n** \\brief Gets the Training C Api struct\n*\n* Call this function to access the ::OrtTrainingApi structure that holds pointers to functions that enable\n* training with onnxruntime.\n* \\note A NULL pointer will be returned and no error message will be printed if the training api\n* is not supported with this build. A NULL pointer will be returned and an error message will be\n* printed if the provided version is unsupported, for example when using a runtime older than the\n* version created with this header file.\n*\n* \\param[in] version Must be ::ORT_API_VERSION\n* \\return The ::OrtTrainingApi struct for the version requested.\n*\n* \\since Version 1.13\n*/"]
1523 pub GetTrainingApi: unsafe extern "system" fn(version: u32) -> *const OrtTrainingApi,
1524 pub SessionOptionsAppendExecutionProvider_CANN:
1525 unsafe extern "system" fn(options: *mut OrtSessionOptions, cann_options: *const OrtCANNProviderOptions) -> OrtStatusPtr,
1526 pub CreateCANNProviderOptions: unsafe extern "system" fn(out: *mut *mut OrtCANNProviderOptions) -> OrtStatusPtr,
1527 pub UpdateCANNProviderOptions: unsafe extern "system" fn(
1528 cann_options: *mut OrtCANNProviderOptions,
1529 provider_options_keys: *const *const core::ffi::c_char,
1530 provider_options_values: *const *const core::ffi::c_char,
1531 num_keys: usize
1532 ) -> OrtStatusPtr,
1533 pub GetCANNProviderOptionsAsString:
1534 unsafe extern "system" fn(cann_options: *const OrtCANNProviderOptions, allocator: *mut OrtAllocator, ptr: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1535 #[doc = " \\brief Release an OrtCANNProviderOptions\n\n \\param[in] the pointer of OrtCANNProviderOptions which will been deleted\n\n \\since Version 1.13."]
1536 pub ReleaseCANNProviderOptions: unsafe extern "system" fn(input: *mut OrtCANNProviderOptions),
1537 pub MemoryInfoGetDeviceType: unsafe extern "system" fn(ptr: *const OrtMemoryInfo, out: *mut OrtMemoryInfoDeviceType),
1538 pub UpdateEnvWithCustomLogLevel: unsafe extern "system" fn(ort_env: *mut OrtEnv, log_severity_level: OrtLoggingLevel) -> OrtStatusPtr,
1539 pub SetGlobalIntraOpThreadAffinity:
1540 unsafe extern "system" fn(tp_options: *mut OrtThreadingOptions, affinity_string: *const core::ffi::c_char) -> OrtStatusPtr,
1541 pub RegisterCustomOpsLibrary_V2: unsafe extern "system" fn(options: *mut OrtSessionOptions, library_name: *const os_char) -> OrtStatusPtr,
1542 pub RegisterCustomOpsUsingFunction:
1543 unsafe extern "system" fn(options: *mut OrtSessionOptions, registration_func_name: *const core::ffi::c_char) -> OrtStatusPtr,
1544 pub KernelInfo_GetInputCount: unsafe extern "system" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr,
1545 pub KernelInfo_GetOutputCount: unsafe extern "system" fn(info: *const OrtKernelInfo, out: *mut usize) -> OrtStatusPtr,
1546 pub KernelInfo_GetInputName:
1547 unsafe extern "system" fn(info: *const OrtKernelInfo, index: usize, out: *mut core::ffi::c_char, size: *mut usize) -> OrtStatusPtr,
1548 pub KernelInfo_GetOutputName:
1549 unsafe extern "system" fn(info: *const OrtKernelInfo, index: usize, out: *mut core::ffi::c_char, size: *mut usize) -> OrtStatusPtr,
1550 pub KernelInfo_GetInputTypeInfo: unsafe extern "system" fn(info: *const OrtKernelInfo, index: usize, type_info: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
1551 pub KernelInfo_GetOutputTypeInfo: unsafe extern "system" fn(info: *const OrtKernelInfo, index: usize, type_info: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
1552 pub KernelInfoGetAttribute_tensor: unsafe extern "system" fn(
1553 info: *const OrtKernelInfo,
1554 name: *const core::ffi::c_char,
1555 allocator: *mut OrtAllocator,
1556 out: *mut *mut OrtValue
1557 ) -> OrtStatusPtr,
1558 pub HasSessionConfigEntry:
1559 unsafe extern "system" fn(options: *const OrtSessionOptions, config_key: *const core::ffi::c_char, out: *mut core::ffi::c_int) -> OrtStatusPtr,
1560 pub GetSessionConfigEntry: unsafe extern "system" fn(
1561 options: *const OrtSessionOptions,
1562 config_key: *const core::ffi::c_char,
1563 config_value: *mut core::ffi::c_char,
1564 size: *mut usize
1565 ) -> OrtStatusPtr,
1566 pub SessionOptionsAppendExecutionProvider_Dnnl:
1567 unsafe extern "system" fn(options: *mut OrtSessionOptions, dnnl_options: *const OrtDnnlProviderOptions) -> OrtStatusPtr,
1568 pub CreateDnnlProviderOptions: unsafe extern "system" fn(out: *mut *mut OrtDnnlProviderOptions) -> OrtStatusPtr,
1569 pub UpdateDnnlProviderOptions: unsafe extern "system" fn(
1570 dnnl_options: *mut OrtDnnlProviderOptions,
1571 provider_options_keys: *const *const core::ffi::c_char,
1572 provider_options_values: *const *const core::ffi::c_char,
1573 num_keys: usize
1574 ) -> OrtStatusPtr,
1575 pub GetDnnlProviderOptionsAsString:
1576 unsafe extern "system" fn(dnnl_options: *const OrtDnnlProviderOptions, allocator: *mut OrtAllocator, ptr: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1577 #[doc = " \\brief Release an ::OrtDnnlProviderOptions\n\n \\since Version 1.15."]
1578 pub ReleaseDnnlProviderOptions: unsafe extern "system" fn(input: *mut OrtDnnlProviderOptions),
1579 pub KernelInfo_GetNodeName: unsafe extern "system" fn(info: *const OrtKernelInfo, out: *mut core::ffi::c_char, size: *mut usize) -> OrtStatusPtr,
1580 pub KernelInfo_GetLogger: unsafe extern "system" fn(info: *const OrtKernelInfo, logger: *mut *const OrtLogger) -> OrtStatusPtr,
1581 pub KernelContext_GetLogger: unsafe extern "system" fn(context: *const OrtKernelContext, logger: *mut *const OrtLogger) -> OrtStatusPtr,
1582 pub Logger_LogMessage: unsafe extern "system" fn(
1583 logger: *const OrtLogger,
1584 log_severity_level: OrtLoggingLevel,
1585 message: *const core::ffi::c_char,
1586 file_path: *const os_char,
1587 line_number: core::ffi::c_int,
1588 func_name: *const core::ffi::c_char
1589 ) -> OrtStatusPtr,
1590 pub Logger_GetLoggingSeverityLevel: unsafe extern "system" fn(logger: *const OrtLogger, out: *mut OrtLoggingLevel) -> OrtStatusPtr,
1591 pub KernelInfoGetConstantInput_tensor:
1592 unsafe extern "system" fn(info: *const OrtKernelInfo, index: usize, is_constant: *mut core::ffi::c_int, out: *mut *const OrtValue) -> OrtStatusPtr,
1593 pub CastTypeInfoToOptionalTypeInfo: unsafe extern "system" fn(type_info: *const OrtTypeInfo, out: *mut *const OrtOptionalTypeInfo) -> OrtStatusPtr,
1594 pub GetOptionalContainedTypeInfo: unsafe extern "system" fn(optional_type_info: *const OrtOptionalTypeInfo, out: *mut *mut OrtTypeInfo) -> OrtStatusPtr,
1595 pub GetResizedStringTensorElementBuffer:
1596 unsafe extern "system" fn(value: *mut OrtValue, index: usize, length_in_bytes: usize, buffer: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1597 pub KernelContext_GetAllocator:
1598 unsafe extern "system" fn(context: *const OrtKernelContext, mem_info: *const OrtMemoryInfo, out: *mut *mut OrtAllocator) -> OrtStatusPtr,
1599 #[doc = " \\brief Returns a null terminated string of the build info including git info and cxx flags\n\n \\return UTF-8 encoded version string. Do not deallocate the returned buffer.\n\n \\since Version 1.15."]
1600 pub GetBuildInfoString: unsafe extern "system" fn() -> *const core::ffi::c_char,
1601 pub CreateROCMProviderOptions: unsafe extern "system" fn(out: *mut *mut OrtROCMProviderOptions) -> OrtStatusPtr,
1602 pub UpdateROCMProviderOptions: unsafe extern "system" fn(
1603 rocm_options: *mut OrtROCMProviderOptions,
1604 provider_options_keys: *const *const core::ffi::c_char,
1605 provider_options_values: *const *const core::ffi::c_char,
1606 num_keys: usize
1607 ) -> OrtStatusPtr,
1608 pub GetROCMProviderOptionsAsString:
1609 unsafe extern "system" fn(rocm_options: *const OrtROCMProviderOptions, allocator: *mut OrtAllocator, ptr: *mut *mut core::ffi::c_char) -> OrtStatusPtr,
1610 #[doc = " \\brief Release an ::OrtROCMProviderOptions\n\n \\note This is an exception in the naming convention of other Release* functions, as the name of the method does not have the V2 suffix, but the type does\n\n \\since Version 1.16."]
1611 pub ReleaseROCMProviderOptions: unsafe extern "system" fn(input: *mut OrtROCMProviderOptions),
1612 pub CreateAndRegisterAllocatorV2: unsafe extern "system" fn(
1613 env: *mut OrtEnv,
1614 provider_type: *const core::ffi::c_char,
1615 mem_info: *const OrtMemoryInfo,
1616 arena_cfg: *const OrtArenaCfg,
1617 provider_options_keys: *const *const core::ffi::c_char,
1618 provider_options_values: *const *const core::ffi::c_char,
1619 num_keys: usize
1620 ) -> OrtStatusPtr,
1621 #[cfg(not(all(target_family = "wasm", target_os = "unknown")))]
1622 pub RunAsync: unsafe extern "system" fn(
1623 session: *mut OrtSession,
1624 run_options: *const OrtRunOptions,
1625 input_names: *const *const core::ffi::c_char,
1626 input: *const *const OrtValue,
1627 input_len: usize,
1628 output_names: *const *const core::ffi::c_char,
1629 output_names_len: usize,
1630 output: *mut *mut OrtValue,
1631 run_async_callback: RunAsyncCallbackFn,
1632 user_data: *mut core::ffi::c_void
1633 ) -> OrtStatusPtr,
1634 #[cfg(all(target_family = "wasm", target_os = "unknown"))]
1635 pub RunAsync: unsafe fn(
1636 session: *mut OrtSession,
1637 run_options: *const OrtRunOptions,
1638 input_names: &[&str],
1639 inputs: &[*const OrtValue],
1640 output_names: &[&str],
1641 outputs: &mut [*mut OrtValue]
1642 ) -> core::pin::Pin<alloc::boxed::Box<dyn core::future::Future<Output = OrtStatusPtr>>>,
1643 pub UpdateTensorRTProviderOptionsWithValue: unsafe extern "system" fn(
1644 tensorrt_options: *mut OrtTensorRTProviderOptionsV2,
1645 key: *const core::ffi::c_char,
1646 value: *mut core::ffi::c_void
1647 ) -> OrtStatusPtr,
1648 pub GetTensorRTProviderOptionsByName: unsafe extern "system" fn(
1649 tensorrt_options: *const OrtTensorRTProviderOptionsV2,
1650 key: *const core::ffi::c_char,
1651 ptr: *mut *mut core::ffi::c_void
1652 ) -> OrtStatusPtr,
1653 pub UpdateCUDAProviderOptionsWithValue:
1654 unsafe extern "system" fn(cuda_options: *mut OrtCUDAProviderOptionsV2, key: *const core::ffi::c_char, value: *mut core::ffi::c_void) -> OrtStatusPtr,
1655 pub GetCUDAProviderOptionsByName: unsafe extern "system" fn(
1656 cuda_options: *const OrtCUDAProviderOptionsV2,
1657 key: *const core::ffi::c_char,
1658 ptr: *mut *mut core::ffi::c_void
1659 ) -> OrtStatusPtr,
1660 pub KernelContext_GetResource: unsafe extern "system" fn(
1661 context: *const OrtKernelContext,
1662 resouce_version: core::ffi::c_int,
1663 resource_id: core::ffi::c_int,
1664 resource: *mut *mut core::ffi::c_void
1665 ) -> OrtStatusPtr,
1666 pub SetUserLoggingFunction: unsafe extern "system" fn(
1667 options: *mut OrtSessionOptions,
1668 user_logging_function: OrtLoggingFunction,
1669 user_logging_param: *mut core::ffi::c_void
1670 ) -> OrtStatusPtr,
1671 pub ShapeInferContext_GetInputCount: unsafe extern "system" fn(context: *const OrtShapeInferContext, out: *mut usize) -> OrtStatusPtr,
1672 pub ShapeInferContext_GetInputTypeShape:
1673 unsafe extern "system" fn(context: *const OrtShapeInferContext, index: usize, info: *mut *mut OrtTensorTypeAndShapeInfo) -> OrtStatusPtr,
1674 pub ShapeInferContext_GetAttribute:
1675 unsafe extern "system" fn(context: *const OrtShapeInferContext, attr_name: *const core::ffi::c_char, attr: *mut *const OrtOpAttr) -> OrtStatusPtr,
1676 pub ShapeInferContext_SetOutputTypeShape:
1677 unsafe extern "system" fn(context: *const OrtShapeInferContext, index: usize, info: *const OrtTensorTypeAndShapeInfo) -> OrtStatusPtr,
1678 pub SetSymbolicDimensions:
1679 unsafe extern "system" fn(info: *mut OrtTensorTypeAndShapeInfo, dim_params: *mut *const core::ffi::c_char, dim_params_length: usize) -> OrtStatusPtr,
1680 pub ReadOpAttr:
1681 unsafe extern "system" fn(op_attr: *const OrtOpAttr, type_: OrtOpAttrType, data: *mut core::ffi::c_void, len: usize, out: *mut usize) -> OrtStatusPtr,
1682 pub SetDeterministicCompute: unsafe extern "system" fn(options: *mut OrtSessionOptions, value: bool) -> OrtStatusPtr,
1683 pub KernelContext_ParallelFor: unsafe extern "system" fn(
1684 context: *const OrtKernelContext,
1685 fn_: unsafe extern "C" fn(arg1: *mut core::ffi::c_void, arg2: usize),
1686 total: usize,
1687 num_batch: usize,
1688 usr_data: *mut core::ffi::c_void
1689 ) -> OrtStatusPtr,
1690 pub SessionOptionsAppendExecutionProvider_OpenVINO_V2: unsafe extern "system" fn(
1691 options: *mut OrtSessionOptions,
1692 provider_options_keys: *const *const core::ffi::c_char,
1693 provider_options_values: *const *const core::ffi::c_char,
1694 num_keys: usize
1695 ) -> OrtStatusPtr,
1696 #[cfg(feature = "api-18")]
1697 pub SessionOptionsAppendExecutionProvider_VitisAI: unsafe extern "system" fn(
1698 options: *mut OrtSessionOptions,
1699 provider_options_keys: *const *const core::ffi::c_char,
1700 provider_options_values: *const *const core::ffi::c_char,
1701 num_keys: usize
1702 ) -> OrtStatusPtr,
1703 #[cfg(feature = "api-18")]
1704 pub KernelContext_GetScratchBuffer: unsafe extern "system" fn(
1705 context: *const OrtKernelContext,
1706 mem_info: *const OrtMemoryInfo,
1707 count_or_bytes: usize,
1708 out: *mut *mut core::ffi::c_void
1709 ) -> OrtStatusPtr,
1710 #[cfg(feature = "api-18")]
1711 pub KernelInfoGetAllocator: unsafe extern "system" fn(info: *const OrtKernelInfo, mem_type: OrtMemType, out: *mut *mut OrtAllocator) -> OrtStatusPtr,
1712 #[cfg(feature = "api-18")]
1713 pub AddExternalInitializersFromMemory: unsafe extern "system" fn(
1714 options: *mut OrtSessionOptions,
1715 external_initializer_file_names: *const *const os_char,
1716 external_initializer_file_buffer_array: *const *mut core::ffi::c_char,
1717 external_initializer_file_lengths: *const usize,
1718 num_external_initializer_files: usize
1719 ) -> OrtStatusPtr,
1720 #[cfg(feature = "api-20")]
1721 pub CreateLoraAdapter:
1722 unsafe extern "system" fn(adapter_file_path: *const os_char, allocator: *mut OrtAllocator, out: *mut *mut OrtLoraAdapter) -> OrtStatusPtr,
1723 #[cfg(feature = "api-20")]
1724 pub CreateLoraAdapterFromArray: unsafe extern "system" fn(
1725 bytes: *const core::ffi::c_void,
1726 num_bytes: usize,
1727 allocator: *mut OrtAllocator,
1728 out: *mut *mut OrtLoraAdapter
1729 ) -> OrtStatusPtr,
1730 #[cfg(feature = "api-20")]
1731 pub ReleaseLoraAdapter: unsafe extern "system" fn(input: *mut OrtLoraAdapter),
1732 #[cfg(feature = "api-20")]
1733 pub RunOptionsAddActiveLoraAdapter: unsafe extern "system" fn(options: *mut OrtRunOptions, adapter: *const OrtLoraAdapter) -> OrtStatusPtr,
1734 #[cfg(feature = "api-20")]
1735 pub SetEpDynamicOptions: unsafe extern "system" fn(
1736 sess: *mut OrtSession,
1737 keys: *const *const core::ffi::c_char,
1738 values: *const *const core::ffi::c_char,
1739 kv_len: usize
1740 ) -> OrtStatusPtr,
1741 #[cfg(feature = "api-22")]
1742 pub ReleaseValueInfo: unsafe extern "system" fn(input: *mut OrtValueInfo),
1743 #[cfg(feature = "api-22")]
1744 pub ReleaseNode: unsafe extern "system" fn(input: *mut OrtNode),
1745 #[cfg(feature = "api-22")]
1746 pub ReleaseGraph: unsafe extern "system" fn(input: *mut OrtGraph),
1747 #[cfg(feature = "api-22")]
1748 pub ReleaseModel: unsafe extern "system" fn(input: *mut OrtModel),
1749 #[cfg(feature = "api-22")]
1750 pub GetValueInfoName: unsafe extern "system" fn(value_info: *const OrtValueInfo, name: *mut *const c_char) -> OrtStatusPtr,
1751 #[cfg(feature = "api-22")]
1752 pub GetValueInfoTypeInfo: unsafe extern "system" fn(value_info: *const OrtValueInfo, type_info: *mut *const OrtTypeInfo) -> OrtStatusPtr,
1753 #[cfg(feature = "api-22")]
1754 pub GetModelEditorApi: unsafe extern "system" fn() -> *const OrtModelEditorApi,
1755 #[cfg(feature = "api-22")]
1756 pub CreateTensorWithDataAndDeleterAsOrtValue: unsafe extern "system" fn(
1757 deleter: *mut OrtAllocator,
1758 p_data: *mut c_void,
1759 p_data_len: usize,
1760 shape: *const i64,
1761 shape_len: usize,
1762 r#type: ONNXTensorElementDataType,
1763 out: *mut *mut OrtValue
1764 ) -> OrtStatusPtr,
1765 #[cfg(feature = "api-22")]
1766 pub SessionOptionsSetLoadCancellationFlag: unsafe extern "system" fn(options: *mut OrtSessionOptions, cancel: bool) -> OrtStatusPtr,
1767 #[cfg(feature = "api-22")]
1768 pub GetCompileApi: unsafe extern "system" fn() -> *const OrtCompileApi,
1769 #[cfg(feature = "api-22")]
1770 pub CreateKeyValuePairs: unsafe extern "system" fn(out: *mut *mut OrtKeyValuePairs),
1771 #[cfg(feature = "api-22")]
1772 pub AddKeyValuePair: unsafe extern "system" fn(kvps: *mut OrtKeyValuePairs, key: *const c_char, value: *const c_char),
1773 #[cfg(feature = "api-22")]
1774 pub GetKeyValue: unsafe extern "system" fn(kvps: *const OrtKeyValuePairs, key: *const c_char) -> *const c_char,
1775 #[cfg(feature = "api-22")]
1776 pub GetKeyValuePairs:
1777 unsafe extern "system" fn(kvps: *const OrtKeyValuePairs, keys: *mut *const *const c_char, values: *mut *const *const c_char, num_entries: *mut usize),
1778 #[cfg(feature = "api-22")]
1779 pub RemoveKeyValuePair: unsafe extern "system" fn(kvps: *mut OrtKeyValuePairs, key: *const c_char),
1780 #[cfg(feature = "api-22")]
1781 pub ReleaseKeyValuePairs: unsafe extern "system" fn(input: *mut OrtKeyValuePairs),
1782 #[cfg(feature = "api-22")]
1783 pub RegisterExecutionProviderLibrary: unsafe extern "system" fn(env: *mut OrtEnv, registration_name: *const c_char, path: *const os_char) -> OrtStatusPtr,
1784 #[cfg(feature = "api-22")]
1785 pub UnregisterExecutionProviderLibrary: unsafe extern "system" fn(env: *mut OrtEnv, registration_name: *const c_char) -> OrtStatusPtr,
1786 #[cfg(feature = "api-22")]
1787 pub GetEpDevices: unsafe extern "system" fn(env: *const OrtEnv, ep_devices: *mut *const *const OrtEpDevice, num_ep_devices: *mut usize) -> OrtStatusPtr,
1788 #[cfg(feature = "api-22")]
1789 pub SessionOptionsAppendExecutionProvider_V2: unsafe extern "system" fn(
1790 session_options: *mut OrtSessionOptions,
1791 env: *mut OrtEnv,
1792 ep_devices: *const *const OrtEpDevice,
1793 num_ep_devices: usize,
1794 ep_option_keys: *const *const c_char,
1795 ep_option_vals: *const *const c_char,
1796 num_ep_options: usize
1797 ) -> OrtStatusPtr,
1798 #[cfg(feature = "api-22")]
1799 pub SessionOptionsSetEpSelectionPolicy:
1800 unsafe extern "system" fn(session_options: *mut OrtSessionOptions, policy: OrtExecutionProviderDevicePolicy) -> OrtStatusPtr,
1801 #[cfg(feature = "api-22")]
1802 pub SessionOptionsSetEpSelectionPolicyDelegate:
1803 unsafe extern "system" fn(session_options: *mut OrtSessionOptions, delegate: EpSelectionDelegate, delegate_state: *mut c_void) -> OrtStatusPtr,
1804 #[cfg(feature = "api-22")]
1805 pub HardwareDevice_Type: unsafe extern "system" fn(device: *const OrtHardwareDevice) -> OrtHardwareDeviceType,
1806 #[cfg(feature = "api-22")]
1807 pub HardwareDevice_VendorId: unsafe extern "system" fn(device: *const OrtHardwareDevice) -> u32,
1808 #[cfg(feature = "api-22")]
1809 pub HardwareDevice_Vendor: unsafe extern "system" fn(device: *const OrtHardwareDevice) -> *const c_char,
1810 #[cfg(feature = "api-22")]
1811 pub HardwareDevice_DeviceId: unsafe extern "system" fn(device: *const OrtHardwareDevice) -> u32,
1812 #[cfg(feature = "api-22")]
1813 pub HardwareDevice_Metadata: unsafe extern "system" fn(device: *const OrtHardwareDevice) -> *const OrtKeyValuePairs,
1814 #[cfg(feature = "api-22")]
1815 pub EpDevice_EpName: unsafe extern "system" fn(ep_device: *const OrtEpDevice) -> *const c_char,
1816 #[cfg(feature = "api-22")]
1817 pub EpDevice_EpVendor: unsafe extern "system" fn(ep_device: *const OrtEpDevice) -> *const c_char,
1818 #[cfg(feature = "api-22")]
1819 pub EpDevice_EpMetadata: unsafe extern "system" fn(ep_device: *const OrtEpDevice) -> *const OrtKeyValuePairs,
1820 #[cfg(feature = "api-22")]
1821 pub EpDevice_EpOptions: unsafe extern "system" fn(ep_device: *const OrtEpDevice) -> *const OrtKeyValuePairs,
1822 #[cfg(feature = "api-22")]
1823 pub EpDevice_Device: unsafe extern "system" fn(ep_device: *const OrtEpDevice) -> *const OrtHardwareDevice,
1824 #[cfg(feature = "api-22")]
1825 pub GetEpApi: unsafe extern "system" fn() -> *const OrtEpApi,
1826 #[cfg(feature = "api-23")]
1827 pub GetTensorSizeInBytes: unsafe extern "system" fn(ort_value: *const OrtValue, size: *mut usize) -> OrtStatusPtr,
1828 #[cfg(feature = "api-23")]
1829 pub AllocatorGetStats: unsafe extern "system" fn(ort_allocator: *const OrtAllocator, out: *mut *mut OrtKeyValuePairs) -> OrtStatusPtr,
1830 #[cfg(feature = "api-23")]
1831 pub CreateMemoryInfo_V2: unsafe extern "system" fn(
1832 name: *const c_char,
1833 device_type: OrtMemoryInfoDeviceType,
1834 vendor_id: u32,
1835 device_id: i32,
1836 mem_type: OrtDeviceMemoryType,
1837 alignment: usize,
1838 allocator_type: OrtAllocatorType,
1839 out: *mut *mut OrtMemoryInfo
1840 ) -> OrtStatusPtr,
1841 #[cfg(feature = "api-23")]
1842 pub MemoryInfoGetDeviceMemType: unsafe extern "system" fn(ptr: *const OrtMemoryInfo) -> OrtDeviceMemoryType,
1843 #[cfg(feature = "api-23")]
1844 pub MemoryInfoGetVendorId: unsafe extern "system" fn(ptr: *const OrtMemoryInfo) -> u32,
1845 #[cfg(feature = "api-23")]
1846 pub ValueInfo_GetValueProducer:
1847 unsafe extern "system" fn(value_info: *const OrtValueInfo, producer_node: *mut *const OrtNode, producer_output_index: *mut usize) -> OrtStatusPtr,
1848 #[cfg(feature = "api-23")]
1849 pub ValueInfo_GetValueNumConsumers: unsafe extern "system" fn(value_info: *const OrtValueInfo, num_consumers: *mut usize) -> OrtStatusPtr,
1850 #[cfg(feature = "api-23")]
1851 pub ValueInfo_GetValueConsumers:
1852 unsafe extern "system" fn(value_info: *const OrtValueInfo, nodes: *mut *const OrtNode, input_indices: *mut i64, num_consumers: usize) -> OrtStatusPtr,
1853 #[cfg(feature = "api-23")]
1854 pub ValueInfo_GetInitializerValue: unsafe extern "system" fn(value_info: *const OrtValueInfo, initializer_value: *mut *const OrtValue) -> OrtStatusPtr,
1855 #[cfg(feature = "api-23")]
1856 pub ValueInfo_GetExternalInitializerInfo:
1857 unsafe extern "system" fn(value_info: *const OrtValueInfo, info: *mut *mut OrtExternalInitializerInfo) -> OrtStatusPtr,
1858 #[cfg(feature = "api-23")]
1859 pub ValueInfo_IsRequiredGraphInput: unsafe extern "system" fn(value_info: *const OrtValueInfo, is_required_graph_input: *mut bool) -> OrtStatusPtr,
1860 #[cfg(feature = "api-23")]
1861 pub ValueInfo_IsOptionalGraphInput: unsafe extern "system" fn(value_info: *const OrtValueInfo, is_optional_graph_input: *mut bool) -> OrtStatusPtr,
1862 #[cfg(feature = "api-23")]
1863 pub ValueInfo_IsGraphOutput: unsafe extern "system" fn(value_info: *const OrtValueInfo, is_graph_output: *mut bool) -> OrtStatusPtr,
1864 #[cfg(feature = "api-23")]
1865 pub ValueInfo_IsConstantInitializer: unsafe extern "system" fn(value_info: *const OrtValueInfo, is_constant_initializer: *mut bool) -> OrtStatusPtr,
1866 #[cfg(feature = "api-23")]
1867 pub ValueInfo_IsFromOuterScope: unsafe extern "system" fn(value_info: *const OrtValueInfo, is_from_outer_scope: *mut bool) -> OrtStatusPtr,
1868 #[cfg(feature = "api-23")]
1869 pub Graph_GetName: unsafe extern "system" fn(graph: *const OrtGraph, graph_name: *mut *const c_char) -> OrtStatusPtr,
1870 #[cfg(feature = "api-23")]
1871 pub Graph_GetModelPath: unsafe extern "system" fn(graph: *const OrtGraph, model_path: *mut *const os_char) -> OrtStatusPtr,
1872 #[cfg(feature = "api-23")]
1873 pub Graph_GetOnnxIRVersion: unsafe extern "system" fn(graph: *const OrtGraph, onnx_ir_version: *mut i64) -> OrtStatusPtr,
1874 #[cfg(feature = "api-23")]
1875 pub Graph_GetNumOperatorSets: unsafe extern "system" fn(graph: *const OrtGraph, num_operator_sets: *mut usize) -> OrtStatusPtr,
1876 #[cfg(feature = "api-23")]
1877 pub Graph_GetOperatorSets:
1878 unsafe extern "system" fn(graph: *const OrtGraph, domains: *mut *const c_char, opset_versions: *mut i64, num_operator_sets: usize) -> OrtStatusPtr,
1879 #[cfg(feature = "api-23")]
1880 pub Graph_GetNumInputs: unsafe extern "system" fn(graph: *const OrtGraph, num_inputs: *mut usize) -> OrtStatusPtr,
1881 #[cfg(feature = "api-23")]
1882 pub Graph_GetInputs: unsafe extern "system" fn(graph: *const OrtGraph, inputs: *mut *const OrtValueInfo, num_inputs: usize) -> OrtStatusPtr,
1883 #[cfg(feature = "api-23")]
1884 pub Graph_GetNumOutputs: unsafe extern "system" fn(graph: *const OrtGraph, num_outputs: *mut usize) -> OrtStatusPtr,
1885 #[cfg(feature = "api-23")]
1886 pub Graph_GetOutputs: unsafe extern "system" fn(graph: *const OrtGraph, outputs: *mut *const OrtValueInfo, num_outputs: usize) -> OrtStatusPtr,
1887 #[cfg(feature = "api-23")]
1888 pub Graph_GetNumInitializers: unsafe extern "system" fn(graph: *const OrtGraph, num_initializers: *mut usize) -> OrtStatusPtr,
1889 #[cfg(feature = "api-23")]
1890 pub Graph_GetInitializers:
1891 unsafe extern "system" fn(graph: *const OrtGraph, initializers: *mut *const OrtValueInfo, num_initializers: usize) -> OrtStatusPtr,
1892 #[cfg(feature = "api-23")]
1893 pub Graph_GetNumNodes: unsafe extern "system" fn(graph: *const OrtGraph, num_nodes: *mut usize) -> OrtStatusPtr,
1894 #[cfg(feature = "api-23")]
1895 pub Graph_GetNodes: unsafe extern "system" fn(graph: *const OrtGraph, nodes: *mut *const OrtNode, num_nodes: usize) -> OrtStatusPtr,
1896 #[cfg(feature = "api-23")]
1897 pub Graph_GetParentNode: unsafe extern "system" fn(graph: *const OrtGraph, node: *mut *const OrtNode) -> OrtStatusPtr,
1898 #[cfg(feature = "api-23")]
1899 pub Graph_GetGraphView:
1900 unsafe extern "system" fn(src_graph: *const OrtGraph, nodes: *mut *const OrtNode, num_nodes: usize, dst_graph: *mut *mut OrtGraph) -> OrtStatusPtr,
1901 #[cfg(feature = "api-23")]
1902 pub Node_GetId: unsafe extern "system" fn(node: *const OrtNode, node_id: *mut usize) -> OrtStatusPtr,
1903 #[cfg(feature = "api-23")]
1904 pub Node_GetName: unsafe extern "system" fn(node: *const OrtNode, node_name: *mut *const c_char) -> OrtStatusPtr,
1905 #[cfg(feature = "api-23")]
1906 pub Node_GetOperatorType: unsafe extern "system" fn(node: *const OrtNode, operator_type: *mut *const c_char) -> OrtStatusPtr,
1907 #[cfg(feature = "api-23")]
1908 pub Node_GetDomain: unsafe extern "system" fn(node: *const OrtNode, domain_name: *mut *const c_char) -> OrtStatusPtr,
1909 #[cfg(feature = "api-23")]
1910 pub Node_GetSinceVersion: unsafe extern "system" fn(node: *const OrtNode, since_version: *mut i32) -> OrtStatusPtr,
1911 #[cfg(feature = "api-23")]
1912 pub Node_GetNumInputs: unsafe extern "system" fn(node: *const OrtNode, num_inputs: *mut usize) -> OrtStatusPtr,
1913 #[cfg(feature = "api-23")]
1914 pub Node_GetInputs: unsafe extern "system" fn(node: *const OrtNode, inputs: *mut *const OrtValueInfo, num_inputs: usize) -> OrtStatusPtr,
1915 #[cfg(feature = "api-23")]
1916 pub Node_GetNumOutputs: unsafe extern "system" fn(node: *const OrtNode, num_outputs: *mut usize) -> OrtStatusPtr,
1917 #[cfg(feature = "api-23")]
1918 pub Node_GetOutputs: unsafe extern "system" fn(node: *const OrtNode, outputs: *mut *const OrtValueInfo, num_outputs: usize) -> OrtStatusPtr,
1919 #[cfg(feature = "api-23")]
1920 pub Node_GetNumImplicitInputs: unsafe extern "system" fn(node: *const OrtNode, num_implicit_inputs: *mut usize) -> OrtStatusPtr,
1921 #[cfg(feature = "api-23")]
1922 pub Node_GetImplicitInputs:
1923 unsafe extern "system" fn(node: *const OrtNode, implicit_inputs: *mut *const OrtValueInfo, num_implicit_inputs: usize) -> OrtStatusPtr,
1924 #[cfg(feature = "api-23")]
1925 pub Node_GetNumAttributes: unsafe extern "system" fn(node: *const OrtNode, num_attributes: *mut usize) -> OrtStatusPtr,
1926 #[cfg(feature = "api-23")]
1927 pub Node_GetAttributes: unsafe extern "system" fn(node: *const OrtNode, attributes: *mut *const OrtOpAttr, num_attributes: usize) -> OrtStatusPtr,
1928 #[cfg(feature = "api-23")]
1929 pub Node_GetAttributeByName:
1930 unsafe extern "system" fn(node: *const OrtNode, attribute_name: *const c_char, attribute: *mut *const OrtOpAttr) -> OrtStatusPtr,
1931 #[cfg(feature = "api-23")]
1932 pub OpAttr_GetTensorAttributeAsOrtValue: unsafe extern "system" fn(attribute: *const OrtOpAttr, attr_tensor: *mut *mut OrtValue) -> OrtStatusPtr,
1933 #[cfg(feature = "api-23")]
1934 pub OpAttr_GetType: unsafe extern "system" fn(attribute: *const OrtOpAttr, r#type: *mut OrtOpAttrType) -> OrtStatusPtr,
1935 #[cfg(feature = "api-23")]
1936 pub OpAttr_GetName: unsafe extern "system" fn(attribute: *const OrtOpAttr, name: *mut *const c_char) -> OrtStatusPtr,
1937 #[cfg(feature = "api-23")]
1938 pub Node_GetNumSubgraphs: unsafe extern "system" fn(node: *const OrtNode, num_subgraphs: *mut usize) -> OrtStatusPtr,
1939 #[cfg(feature = "api-23")]
1940 pub Node_GetSubgraphs: unsafe extern "system" fn(
1941 node: *const OrtNode,
1942 subgraphs: *mut *const OrtGraph,
1943 num_subgraphs: usize,
1944 attribute_names: *mut *const c_char
1945 ) -> OrtStatusPtr,
1946 #[cfg(feature = "api-23")]
1947 pub Node_GetGraph: unsafe extern "system" fn(node: *const OrtNode, graph: *mut *const OrtGraph) -> OrtStatusPtr,
1948 #[cfg(feature = "api-23")]
1949 pub Node_GetEpName: unsafe extern "system" fn(node: *const OrtNode, out: *mut *const c_char) -> OrtStatusPtr,
1950 #[cfg(feature = "api-23")]
1951 pub ReleaseExternalInitializerInfo: unsafe extern "system" fn(value: *mut OrtExternalInitializerInfo),
1952 #[cfg(feature = "api-23")]
1953 pub ExternalInitializerInfo_GetFilePath: unsafe extern "system" fn(info: *const OrtExternalInitializerInfo) -> *const os_char,
1954 #[cfg(feature = "api-23")]
1955 pub ExternalInitializerInfo_GetFileOffset: unsafe extern "system" fn(info: *const OrtExternalInitializerInfo) -> i64,
1956 #[cfg(feature = "api-23")]
1957 pub ExternalInitializerInfo_GetByteSize: unsafe extern "system" fn(info: *const OrtExternalInitializerInfo) -> usize,
1958 #[cfg(feature = "api-23")]
1959 pub GetRunConfigEntry: unsafe extern "system" fn(options: *const OrtRunOptions, config_key: *const c_char) -> *const c_char,
1960 #[cfg(feature = "api-23")]
1961 pub EpDevice_MemoryInfo: unsafe extern "system" fn(ep_device: *const OrtEpDevice, memory_type: OrtDeviceMemoryType) -> *const OrtMemoryInfo,
1962 #[cfg(feature = "api-23")]
1963 pub CreateSharedAllocator: unsafe extern "system" fn(
1964 env: *mut OrtEnv,
1965 ep_device: *const OrtEpDevice,
1966 mem_type: OrtDeviceMemoryType,
1967 allocator_type: OrtAllocatorType,
1968 allocator_options: *const OrtKeyValuePairs,
1969 allocator: *mut *mut OrtAllocator
1970 ) -> OrtStatusPtr,
1971 #[cfg(feature = "api-23")]
1972 pub GetSharedAllocator: unsafe extern "system" fn(env: *mut OrtEnv, mem_info: *const OrtMemoryInfo, allocator: *mut *mut OrtAllocator) -> OrtStatusPtr,
1973 #[cfg(feature = "api-23")]
1974 pub ReleaseSharedAllocator: unsafe extern "system" fn(env: *mut OrtEnv, ep_device: *const OrtEpDevice, mem_type: OrtDeviceMemoryType) -> OrtStatusPtr,
1975 #[cfg(feature = "api-23")]
1976 pub GetTensorData: unsafe extern "system" fn(value: *const OrtValue, out: *mut *const c_void) -> OrtStatusPtr,
1977 #[cfg(feature = "api-23")]
1978 pub GetSessionOptionsConfigEntries: unsafe extern "system" fn(options: *const OrtSessionOptions, out: *mut *mut OrtKeyValuePairs) -> OrtStatusPtr,
1979 #[cfg(feature = "api-23")]
1980 pub SessionGetMemoryInfoForInputs:
1981 unsafe extern "system" fn(session: *const OrtSession, inputs_memory_info: *mut *const OrtMemoryInfo, num_inputs: usize) -> OrtStatusPtr,
1982 #[cfg(feature = "api-23")]
1983 pub SessionGetMemoryInfoForOutputs:
1984 unsafe extern "system" fn(session: *const OrtSession, outputs_memory_info: *mut *const OrtMemoryInfo, num_outputs: usize) -> OrtStatusPtr,
1985 #[cfg(feature = "api-23")]
1986 pub SessionGetEpDeviceForInputs:
1987 unsafe extern "system" fn(session: *const OrtSession, inputs_ep_devices: *mut *const OrtEpDevice, num_inputs: usize) -> OrtStatusPtr,
1988 #[cfg(feature = "api-23")]
1989 pub CreateSyncStreamForEpDevice:
1990 unsafe extern "system" fn(ep_device: *const OrtEpDevice, stream_options: *const OrtKeyValuePairs, stream: *mut *mut OrtSyncStream) -> OrtStatusPtr,
1991 #[cfg(feature = "api-23")]
1992 pub SyncStream_GetHandle: unsafe extern "system" fn(stream: *mut OrtSyncStream) -> *mut c_void,
1993 #[cfg(feature = "api-23")]
1994 pub ReleaseSyncStream: unsafe extern "system" fn(value: *mut OrtSyncStream),
1995 #[cfg(feature = "api-23")]
1996 pub CopyTensors: unsafe extern "system" fn(
1997 env: *mut OrtEnv,
1998 src_tensors: *const *const OrtValue,
1999 dst_tensors: *mut *const OrtValue,
2000 stream: *mut OrtSyncStream,
2001 num_tensors: usize
2002 ) -> OrtStatusPtr,
2003 #[cfg(feature = "api-23")]
2004 pub Graph_GetModelMetadata: unsafe extern "system" fn(graph: *mut OrtGraph, out: *mut *mut OrtModelMetadata) -> OrtStatusPtr,
2005 #[cfg(feature = "api-23")]
2006 pub GetModelCompatibilityForEpDevices: unsafe extern "system" fn(
2007 ep_devices: *const *const OrtEpDevice,
2008 num_ep_devices: usize,
2009 compatibility_info: *const c_char,
2010 out_status: *mut OrtCompiledModelCompatibility
2011 ) -> OrtStatusPtr,
2012 #[cfg(feature = "api-23")]
2013 pub CreateExternalInitializerInfo:
2014 unsafe extern "system" fn(filepath: *const os_char, file_offset: i64, byte_size: usize, out: *mut *mut OrtExternalInitializerInfo) -> OrtStatusPtr,
2015 #[cfg(feature = "api-24")]
2016 pub TensorTypeAndShape_HasShape: unsafe extern "system" fn(info: *const OrtTensorTypeAndShapeInfo) -> bool,
2017 #[cfg(feature = "api-24")]
2018 pub KernelInfo_GetConfigEntries: unsafe extern "system" fn(info: *const OrtKernelInfo, out: *mut *mut OrtKeyValuePairs) -> OrtStatusPtr,
2019 #[cfg(feature = "api-24")]
2020 pub KernelInfo_GetOperatorDomain: unsafe extern "system" fn(info: *const OrtKernelInfo, out: *mut c_char, size: *mut usize) -> OrtStatusPtr,
2021 #[cfg(feature = "api-24")]
2022 pub KernelInfo_GetOperatorType: unsafe extern "system" fn(info: *const OrtKernelInfo, out: *mut c_char, size: *mut usize) -> OrtStatusPtr,
2023 #[cfg(feature = "api-24")]
2024 pub KernelInfo_GetOperatorSinceVersion: unsafe extern "system" fn(info: *const OrtKernelInfo, since_version: *mut i32) -> OrtStatusPtr,
2025 #[cfg(feature = "api-24")]
2026 pub GetInteropApi: unsafe extern "system" fn() -> *const OrtInteropApi,
2027 #[cfg(feature = "api-24")]
2028 pub SessionGetEpDeviceForOutputs:
2029 unsafe extern "system" fn(session: *const OrtSession, outputs_ep_devices: *mut *const OrtEpDevice, num_outputs: usize) -> OrtStatusPtr,
2030 #[cfg(feature = "api-24")]
2031 pub GetNumHardwareDevices: unsafe extern "system" fn(env: *const OrtEnv, num_devices: *mut usize) -> OrtStatusPtr,
2032 #[cfg(feature = "api-24")]
2033 pub GetHardwareDevices: unsafe extern "system" fn(env: *const OrtEnv, devices: *mut *const OrtHardwareDevice, num_devices: usize) -> OrtStatusPtr,
2034 #[cfg(feature = "api-24")]
2035 pub GetHardwareDeviceEpIncompatibilityDetails: unsafe extern "system" fn(
2036 env: *const OrtEnv,
2037 ep_name: *const c_char,
2038 hw: *const OrtHardwareDevice,
2039 details: *mut *mut OrtDeviceEpIncompatibilityDetails
2040 ) -> OrtStatusPtr,
2041 #[cfg(feature = "api-24")]
2042 pub DeviceEpIncompatibilityDetails_GetReasonsBitmask:
2043 unsafe extern "system" fn(details: *const OrtDeviceEpIncompatibilityDetails, reasons_bitmask: *mut u32) -> OrtStatusPtr,
2044 #[cfg(feature = "api-24")]
2045 pub DeviceEpIncompatibilityDetails_GetNotes:
2046 unsafe extern "system" fn(details: *const OrtDeviceEpIncompatibilityDetails, notes: *mut *const c_char) -> OrtStatusPtr,
2047 #[cfg(feature = "api-24")]
2048 pub DeviceEpIncompatibilityDetails_GetErrorCode:
2049 unsafe extern "system" fn(details: *const OrtDeviceEpIncompatibilityDetails, error_code: *mut i32) -> OrtStatusPtr,
2050 #[cfg(feature = "api-24")]
2051 pub ReleaseDeviceEpIncompatibilityDetails: unsafe extern "system" fn(value: *mut OrtDeviceEpIncompatibilityDetails),
2052 #[cfg(feature = "api-24")]
2053 pub GetCompatibilityInfoFromModel: unsafe extern "system" fn(
2054 model_path: *const os_char,
2055 ep_type: *const c_char,
2056 allocator: *mut OrtAllocator,
2057 compatibility_info: *mut *mut c_char
2058 ) -> OrtStatusPtr,
2059 #[cfg(feature = "api-24")]
2060 pub GetCompatibilityInfoFromModelBytes: unsafe extern "system" fn(
2061 model_data: *const c_void,
2062 model_data_length: usize,
2063 ep_type: *const c_char,
2064 allocator: *mut OrtAllocator,
2065 compatibility_info: *mut *mut c_char
2066 ) -> OrtStatusPtr,
2067 #[cfg(feature = "api-24")]
2068 pub CreateEnvWithOptions: unsafe extern "system" fn(options: *const OrtEnvCreationOptions, out: *mut *mut OrtEnv) -> OrtStatusPtr,
2069 #[cfg(feature = "api-24")]
2070 pub Session_GetEpGraphAssignmentInfo: unsafe extern "system" fn(
2071 session: *const OrtSession,
2072 ep_subgraphs: *mut *const *const OrtEpAssignedSubgraph,
2073 num_ep_subgraphs: *mut usize
2074 ) -> OrtStatusPtr,
2075 #[cfg(feature = "api-24")]
2076 pub EpAssignedSubgraph_GetEpName: unsafe extern "system" fn(ep_subgraph: *const OrtEpAssignedSubgraph, out: *mut *const c_char) -> OrtStatusPtr,
2077 #[cfg(feature = "api-24")]
2078 pub EpAssignedSubgraph_GetNodes: unsafe extern "system" fn(
2079 ep_subgraph: *const OrtEpAssignedSubgraph,
2080 ep_nodes: *mut *const *const OrtEpAssignedNode,
2081 num_ep_nodes: *mut usize
2082 ) -> OrtStatusPtr,
2083 #[cfg(feature = "api-24")]
2084 pub EpAssignedNode_GetName: unsafe extern "system" fn(ep_node: *const OrtEpAssignedNode, out: *mut *const c_char) -> OrtStatusPtr,
2085 #[cfg(feature = "api-24")]
2086 pub EpAssignedNode_GetDomain: unsafe extern "system" fn(ep_node: *const OrtEpAssignedNode, out: *mut *const c_char) -> OrtStatusPtr,
2087 #[cfg(feature = "api-24")]
2088 pub EpAssignedNode_GetOperatorType: unsafe extern "system" fn(ep_node: *const OrtEpAssignedNode, out: *mut *const c_char) -> OrtStatusPtr,
2089 #[cfg(feature = "api-24")]
2090 pub RunOptionsSetSyncStream: unsafe extern "system" fn(options: *mut OrtRunOptions, sync_stream: *mut OrtSyncStream),
2091 #[cfg(feature = "api-24")]
2092 pub GetTensorElementTypeAndShapeDataReference: unsafe extern "system" fn(
2093 value: *const OrtValue,
2094 elem_type: *mut ONNXTensorElementDataType,
2095 shape_data: *mut *const i64,
2096 shape_data_count: *mut usize
2097 ) -> OrtStatusPtr,
2098 #[cfg(feature = "api-25")]
2099 pub RunOptionsEnableProfiling: unsafe extern "system" fn(options: *mut OrtRunOptions, profile_file_prefix: *const os_char) -> OrtStatusPtr,
2100 #[cfg(feature = "api-25")]
2101 pub RunOptionsDisableProfiling: unsafe extern "system" fn(options: *mut OrtRunOptions) -> OrtStatusPtr,
2102 #[cfg(feature = "api-25")]
2103 pub KernelInfoGetAttributeArray_string: unsafe extern "system" fn(
2104 info: *const OrtKernelInfo,
2105 name: *const c_char,
2106 allocator: *mut OrtAllocator,
2107 out: *mut *mut *mut c_char,
2108 size: *mut usize
2109 ) -> OrtStatusPtr,
2110 #[cfg(feature = "api-25")]
2111 pub SetPerSessionThreadPoolCallbacks: unsafe extern "system" fn(env: *mut OrtEnv, config: *const OrtThreadPoolCallbacksConfig) -> OrtStatusPtr,
2112 #[cfg(feature = "api-27")]
2113 pub GetMemPatternEnabled: unsafe extern "system" fn(options: *const OrtSessionOptions, out: *mut core::ffi::c_int) -> OrtStatusPtr,
2114 #[cfg(feature = "api-27")]
2115 pub GetSessionExecutionMode: unsafe extern "system" fn(options: *const OrtSessionOptions, out: *mut ExecutionMode) -> OrtStatusPtr,
2116 #[cfg(feature = "api-27")]
2117 pub SessionReleaseCapturedGraph: unsafe extern "system" fn(session: *mut OrtSession, graph_annotation_id: core::ffi::c_int) -> OrtStatusPtr,
2118 #[cfg(feature = "api-28")]
2119 pub GetExperimentalFunction: unsafe extern "system" fn(name: *const c_char) -> *const c_void,
2120 #[cfg(feature = "api-28")]
2121 pub KernelContext_GetSyncStream: unsafe extern "system" fn(context: *const OrtKernelContext, out: *mut *mut OrtSyncStream) -> OrtStatusPtr,
2122 #[cfg(feature = "api-29")]
2123 pub SessionOptionsSetWeightlessSourceModelBuffer:
2124 unsafe extern "system" fn(options: *mut OrtSessionOptions, source_model_data: *const c_void, source_model_data_length: usize) -> OrtStatusPtr,
2125 #[cfg(feature = "api-30")]
2126 pub KernelContext_GetPreallocatedOutput:
2127 unsafe extern "system" fn(context: *const OrtKernelContext, output_index: usize, output: *mut *mut OrtValue) -> OrtStatusPtr,
2128 #[cfg(feature = "api-31")]
2129 pub SessionOptionsSetEpContextDataReadFunc:
2130 unsafe extern "system" fn(options: *mut OrtSessionOptions, read_func: OrtReadNamedBufferFunc, state: *mut c_void) -> OrtStatusPtr,
2131 #[cfg(feature = "api-31")]
2132 pub GetModelPackageApi: unsafe extern "system" fn() -> *const OrtModelPackageApi
2133}
2134#[repr(i32)]
2135#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2136pub enum OrtCustomOpInputOutputCharacteristic {
2137 INPUT_OUTPUT_REQUIRED = 0,
2138 INPUT_OUTPUT_OPTIONAL = 1,
2139 INPUT_OUTPUT_VARIADIC = 2
2140}
2141#[repr(C)]
2142#[derive(Debug, Copy, Clone)]
2143pub struct OrtCustomOp {
2144 pub version: u32,
2145 pub CreateKernel: Option<unsafe extern "system" fn(op: *const OrtCustomOp, api: *const OrtApi, info: *const OrtKernelInfo) -> *mut core::ffi::c_void>,
2146 pub GetName: Option<unsafe extern "system" fn(op: *const OrtCustomOp) -> *const core::ffi::c_char>,
2147 pub GetExecutionProviderType: Option<unsafe extern "system" fn(op: *const OrtCustomOp) -> *const core::ffi::c_char>,
2148 pub GetInputType: Option<unsafe extern "system" fn(op: *const OrtCustomOp, index: usize) -> ONNXTensorElementDataType>,
2149 pub GetInputTypeCount: Option<unsafe extern "system" fn(op: *const OrtCustomOp) -> usize>,
2150 pub GetOutputType: Option<unsafe extern "system" fn(op: *const OrtCustomOp, index: usize) -> ONNXTensorElementDataType>,
2151 pub GetOutputTypeCount: Option<unsafe extern "system" fn(op: *const OrtCustomOp) -> usize>,
2152 pub KernelCompute: Option<unsafe extern "system" fn(op_kernel: *mut core::ffi::c_void, context: *mut OrtKernelContext)>,
2153 pub KernelDestroy: Option<unsafe extern "system" fn(op_kernel: *mut core::ffi::c_void)>,
2154 pub GetInputCharacteristic: Option<unsafe extern "system" fn(op: *const OrtCustomOp, index: usize) -> OrtCustomOpInputOutputCharacteristic>,
2155 pub GetOutputCharacteristic: Option<unsafe extern "system" fn(op: *const OrtCustomOp, index: usize) -> OrtCustomOpInputOutputCharacteristic>,
2156 pub GetInputMemoryType: Option<unsafe extern "system" fn(op: *const OrtCustomOp, index: usize) -> OrtMemType>,
2157 pub GetVariadicInputMinArity: Option<unsafe extern "system" fn(op: *const OrtCustomOp) -> core::ffi::c_int>,
2158 pub GetVariadicInputHomogeneity: Option<unsafe extern "system" fn(op: *const OrtCustomOp) -> core::ffi::c_int>,
2159 pub GetVariadicOutputMinArity: Option<unsafe extern "system" fn(op: *const OrtCustomOp) -> core::ffi::c_int>,
2160 pub GetVariadicOutputHomogeneity: Option<unsafe extern "system" fn(op: *const OrtCustomOp) -> core::ffi::c_int>,
2161 pub CreateKernelV2: Option<
2162 unsafe extern "system" fn(op: *const OrtCustomOp, api: *const OrtApi, info: *const OrtKernelInfo, kernel: *mut *mut core::ffi::c_void) -> OrtStatusPtr
2163 >,
2164 pub KernelComputeV2: Option<unsafe extern "system" fn(op_kernel: *mut core::ffi::c_void, context: *mut OrtKernelContext) -> OrtStatusPtr>,
2165 pub InferOutputShapeFn: Option<unsafe extern "system" fn(op: *const OrtCustomOp, arg1: *mut OrtShapeInferContext) -> OrtStatusPtr>,
2166 pub GetStartVersion: Option<unsafe extern "system" fn(op: *const OrtCustomOp) -> core::ffi::c_int>,
2167 pub GetEndVersion: Option<unsafe extern "system" fn(op: *const OrtCustomOp) -> core::ffi::c_int>,
2168 #[cfg(feature = "api-18")]
2169 pub GetMayInplace: Option<unsafe extern "system" fn(input_index: *mut *mut core::ffi::c_int, output_index: *mut *mut core::ffi::c_int) -> usize>,
2170 #[cfg(feature = "api-18")]
2171 pub ReleaseMayInplace: Option<unsafe extern "system" fn(input_index: *mut core::ffi::c_int, output_index: *mut core::ffi::c_int)>,
2172 #[cfg(feature = "api-18")]
2173 pub GetAliasMap: Option<unsafe extern "system" fn(input_index: *mut *mut core::ffi::c_int, output_index: *mut *mut core::ffi::c_int) -> usize>,
2174 #[cfg(feature = "api-18")]
2175 pub ReleaseAliasMap: Option<unsafe extern "system" fn(input_index: *mut core::ffi::c_int, output_index: *mut core::ffi::c_int)>
2176}
2177#[repr(C)]
2178#[derive(Debug, Copy, Clone)]
2179pub struct OrtModelPackageApi {
2180 pub CreateModelPackageOptionsFromSessionOptions:
2181 unsafe extern "system" fn(env: *const OrtEnv, session_options: *const OrtSessionOptions, out: *mut *mut OrtModelPackageOptions) -> OrtStatusPtr,
2182 pub ReleaseModelPackageOptions: unsafe extern "system" fn(value: *mut OrtModelPackageOptions),
2183 pub CreateModelPackageContext: unsafe extern "system" fn(pacakge_root: *const os_char, out: *mut *mut OrtModelPackageContext) -> OrtStatusPtr,
2184 pub ReleaseModelPackageContext: unsafe extern "system" fn(value: *mut OrtModelPackageContext),
2185 pub ModelPackage_GetSchemaVersion: unsafe extern "system" fn(ctx: *const OrtModelPackageContext, out_version: *mut i64) -> OrtStatusPtr,
2186 pub ModelPackage_GetComponentCount: unsafe extern "system" fn(ctx: *const OrtModelPackageContext, out_version: *mut usize) -> OrtStatusPtr,
2187 pub ModelPackage_GetComponentNames:
2188 unsafe extern "system" fn(ctx: *const OrtModelPackageContext, out_names: *mut *const *const c_char, out_count: *mut usize) -> OrtStatusPtr,
2189 pub ModelPackage_GetVariantCount:
2190 unsafe extern "system" fn(ctx: *const OrtModelPackageContext, component_name: *const c_char, out_count: *mut usize) -> OrtStatusPtr,
2191 pub ModelPackage_GetVariantNames: unsafe extern "system" fn(
2192 ctx: *const OrtModelPackageContext,
2193 component_name: *const c_char,
2194 out_variant_names: *mut *const *const c_char,
2195 out_count: *mut usize
2196 ) -> OrtStatusPtr,
2197 pub ModelPackage_GetVariantEpName: unsafe extern "system" fn(
2198 ctx: *const OrtModelPackageContext,
2199 component_name: *const c_char,
2200 variant_name: *const c_char,
2201 out_ep: *mut *const c_char
2202 ) -> OrtStatusPtr,
2203 pub ModelPackage_ResolveStringRef: unsafe extern "system" fn(
2204 ctx: *const OrtModelPackageContext,
2205 base_dir: *const c_char,
2206 input: *const c_char,
2207 must_exist: c_int,
2208 out_path: *mut *const c_char
2209 ) -> OrtStatusPtr,
2210 pub SelectComponent: unsafe extern "system" fn(
2211 ctx: *const OrtModelPackageContext,
2212 component_name: *const c_char,
2213 options: *const OrtModelPackageOptions,
2214 out: *mut *mut OrtModelPackageComponentContext
2215 ) -> OrtStatusPtr,
2216 pub ReleaseModelPackageComponentContext: unsafe extern "system" fn(value: *mut OrtModelPackageComponentContext),
2217 pub ModelPackageComponent_GetSelectedVariantName:
2218 unsafe extern "system" fn(ctx: *const OrtModelPackageComponentContext, out_name: *mut *const c_char) -> OrtStatusPtr,
2219 pub ModelPackageComponent_GetSelectedVariantFolderPath:
2220 unsafe extern "system" fn(ctx: *const OrtModelPackageComponentContext, folder_path: *mut *const os_char) -> OrtStatusPtr,
2221 pub CreateSession: unsafe extern "system" fn(
2222 env: *const OrtEnv,
2223 ctx: *const OrtModelPackageComponentContext,
2224 session_options: *const OrtSessionOptions,
2225 session: *mut *mut OrtSession
2226 ) -> OrtStatusPtr
2227}
2228unsafe extern "system" {
2229 pub fn OrtSessionOptionsAppendExecutionProvider_CUDA(options: *mut OrtSessionOptions, device_id: core::ffi::c_int) -> OrtStatusPtr;
2230 pub fn OrtSessionOptionsAppendExecutionProvider_ROCM(options: *mut OrtSessionOptions, device_id: core::ffi::c_int) -> OrtStatusPtr;
2231 pub fn OrtSessionOptionsAppendExecutionProvider_MIGraphX(options: *mut OrtSessionOptions, device_id: core::ffi::c_int) -> OrtStatusPtr;
2232 pub fn OrtSessionOptionsAppendExecutionProvider_Dnnl(options: *mut OrtSessionOptions, use_arena: core::ffi::c_int) -> OrtStatusPtr;
2233 pub fn OrtSessionOptionsAppendExecutionProvider_Tensorrt(options: *mut OrtSessionOptions, device_id: core::ffi::c_int) -> OrtStatusPtr;
2234}