41#define ORT_API_VERSION 24
60#define _Frees_ptr_opt_
61#define _Ret_maybenull_
64#define _Outptr_result_maybenull_
65#define _Outptr_result_maybenull_z_
68#define _Inout_updates_(X)
69#define _Out_writes_(X)
70#define _Out_writes_opt_(X)
71#define _Inout_updates_all_(X)
72#define _Out_writes_bytes_all_(X)
73#define _Out_writes_all_(X)
75#define _Outptr_result_buffer_maybenull_(X)
76#define ORT_ALL_ARGS_NONNULL __attribute__((nonnull))
78#include <specstrings.h>
79#define ORT_ALL_ARGS_NONNULL
86#define ORT_EXPORT __declspec(dllimport)
90#define ORT_API_CALL __stdcall
91#define ORT_MUST_USE_RESULT
92#define ORTCHAR_T wchar_t
96#define ORT_EXPORT __attribute__((visibility("default")))
101#define ORT_MUST_USE_RESULT __attribute__((warn_unused_result))
102#define ORTCHAR_T char
109#define ORT_TSTR(X) L##X
111#define ORT_TSTR_ON_MACRO(X) L"" X
114#define ORT_TSTR_ON_MACRO(X) X
121#define ORT_FILE_INTERNAL(x) ORT_TSTR(x)
122#define ORT_FILE ORT_FILE_INTERNAL(__FILE__)
135#define __has_feature(x) 0
137#if ((__cplusplus >= 201103L) || (_MSC_VER >= 1900) || (defined(__has_feature) && __has_feature(cxx_noexcept)))
138#define NO_EXCEPTION noexcept
140#define NO_EXCEPTION throw()
147#define ORT_API(RETURN_TYPE, NAME, ...) RETURN_TYPE ORT_API_CALL NAME(__VA_ARGS__) NO_EXCEPTION
149#define ORT_API_T(RETURN_TYPE, NAME, ...) \
150 RETURN_TYPE(ORT_API_CALL* NAME)(__VA_ARGS__) NO_EXCEPTION
152#define ORT_API_STATUS(NAME, ...) \
153 _Success_(return == 0) _Check_return_ _Ret_maybenull_ OrtStatusPtr ORT_API_CALL NAME(__VA_ARGS__) \
154 NO_EXCEPTION ORT_MUST_USE_RESULT
157#define ORT_API2_STATUS(NAME, ...) \
158 _Check_return_ _Ret_maybenull_ OrtStatusPtr(ORT_API_CALL* NAME)(__VA_ARGS__) NO_EXCEPTION ORT_MUST_USE_RESULT
161#define ORT_API_STATUS_IMPL(NAME, ...) \
162 _Success_(return == 0) _Check_return_ _Ret_maybenull_ OrtStatusPtr ORT_API_CALL NAME(__VA_ARGS__) NO_EXCEPTION
164#define ORT_CLASS_RELEASE(X) void(ORT_API_CALL * Release##X)(_Frees_ptr_opt_ Ort##X * input)
168#define ORT_API_STATUS(NAME, ...) OrtStatus* NAME(__VA_ARGS__)
169#undef ORT_API2_STATUS
170#define ORT_API2_STATUS(NAME, ...) OrtStatus* NAME(__VA_ARGS__)
171#undef ORT_CLASS_RELEASE
172#define ORT_CLASS_RELEASE(X) void Release##X(Ort##X* input)
288#define ORT_RUNTIME_CLASS(X) \
290 typedef struct Ort##X Ort##X
297ORT_RUNTIME_CLASS(Env);
298ORT_RUNTIME_CLASS(Status);
299ORT_RUNTIME_CLASS(MemoryInfo);
300ORT_RUNTIME_CLASS(IoBinding);
301ORT_RUNTIME_CLASS(Session);
302ORT_RUNTIME_CLASS(Value);
303ORT_RUNTIME_CLASS(RunOptions);
304ORT_RUNTIME_CLASS(TypeInfo);
305ORT_RUNTIME_CLASS(TensorTypeAndShapeInfo);
306ORT_RUNTIME_CLASS(MapTypeInfo);
307ORT_RUNTIME_CLASS(SequenceTypeInfo);
308ORT_RUNTIME_CLASS(OptionalTypeInfo);
309ORT_RUNTIME_CLASS(SessionOptions);
310ORT_RUNTIME_CLASS(CustomOpDomain);
311ORT_RUNTIME_CLASS(ModelMetadata);
312ORT_RUNTIME_CLASS(ThreadPoolParams);
313ORT_RUNTIME_CLASS(ThreadingOptions);
314ORT_RUNTIME_CLASS(ArenaCfg);
315ORT_RUNTIME_CLASS(PrepackedWeightsContainer);
316ORT_RUNTIME_CLASS(TensorRTProviderOptionsV2);
317ORT_RUNTIME_CLASS(NvTensorRtRtxProviderOptions);
318ORT_RUNTIME_CLASS(CUDAProviderOptionsV2);
319ORT_RUNTIME_CLASS(CANNProviderOptions);
320ORT_RUNTIME_CLASS(DnnlProviderOptions);
321ORT_RUNTIME_CLASS(Op);
322ORT_RUNTIME_CLASS(OpAttr);
323ORT_RUNTIME_CLASS(Logger);
324ORT_RUNTIME_CLASS(ShapeInferContext);
325ORT_RUNTIME_CLASS(LoraAdapter);
326ORT_RUNTIME_CLASS(ValueInfo);
327ORT_RUNTIME_CLASS(Node);
328ORT_RUNTIME_CLASS(Graph);
329ORT_RUNTIME_CLASS(Model);
330ORT_RUNTIME_CLASS(ModelCompilationOptions);
331ORT_RUNTIME_CLASS(HardwareDevice);
332ORT_RUNTIME_CLASS(EpDevice);
333ORT_RUNTIME_CLASS(KeyValuePairs);
334ORT_RUNTIME_CLASS(SyncStream);
335ORT_RUNTIME_CLASS(ExternalInitializerInfo);
336ORT_RUNTIME_CLASS(ExternalResourceImporter);
337ORT_RUNTIME_CLASS(ExternalMemoryHandle);
338ORT_RUNTIME_CLASS(ExternalSemaphoreHandle);
339ORT_RUNTIME_CLASS(DeviceEpIncompatibilityDetails);
340ORT_RUNTIME_CLASS(EpAssignedSubgraph);
341ORT_RUNTIME_CLASS(EpAssignedNode);
424 void* param,
OrtLoggingLevel severity,
const char* category,
const char* logid,
const char* code_location,
425 const char* message);
549 _In_
size_t num_devices,
553 _In_
size_t max_selected,
554 _Out_
size_t* num_selected,
568 _In_
const void* buffer,
569 _In_
size_t buffer_num_bytes);
603 _In_
const char* initializer_name,
604 _In_
const OrtValue* initializer_value,
1254 _In_
const void* model_data,
size_t model_data_length,
1276 _In_reads_(input_len)
const char*
const* input_names,
1277 _In_reads_(input_len)
const OrtValue*
const* inputs,
size_t input_len,
1278 _In_reads_(output_names_len)
const char*
const* output_names,
size_t output_names_len,
1279 _Inout_updates_all_(output_names_len)
OrtValue** outputs);
1310 _In_
const ORTCHAR_T* optimized_model_filepath);
1679 _Out_
int* log_verbosity_level);
1825 size_t s_len, _Out_writes_all_(offsets_len)
size_t* offsets,
size_t offsets_len);
1914 size_t dim_values_length);
1925 _Out_writes_all_(dim_params_length)
const char* dim_params[],
size_t dim_params_length);
2076 _In_ int64_t dim_value);
2152 ORT_API2_STATUS(
CreateValue, _In_reads_(num_values)
const OrtValue*
const* in,
size_t num_values,
2177 ORT_API2_STATUS(
CreateOpaqueValue, _In_z_
const char* domain_name, _In_z_
const char* type_name,
2178 _In_
const void* data_container,
size_t data_container_size, _Outptr_
OrtValue** out);
2194 ORT_API2_STATUS(
GetOpaqueValue, _In_
const char* domain_name, _In_
const char* type_name, _In_
const OrtValue* in,
2195 _Out_
void* data_container,
size_t data_container_size);
2222 _Out_ int64_t* out);
2245 _Inout_
size_t* size);
2292 _In_
const int64_t* dim_values,
size_t dim_count, _Outptr_
OrtValue** out);
2297 ORT_CLASS_RELEASE(Env);
2301 ORT_CLASS_RELEASE(Status);
2305 ORT_CLASS_RELEASE(MemoryInfo);
2309 ORT_CLASS_RELEASE(Session);
2313 ORT_CLASS_RELEASE(Value);
2317 ORT_CLASS_RELEASE(RunOptions);
2321 ORT_CLASS_RELEASE(TypeInfo);
2325 ORT_CLASS_RELEASE(TensorTypeAndShapeInfo);
2329 ORT_CLASS_RELEASE(SessionOptions);
2333 ORT_CLASS_RELEASE(CustomOpDomain);
2433 ORT_CLASS_RELEASE(MapTypeInfo);
2437 ORT_CLASS_RELEASE(SequenceTypeInfo);
2499 _Outptr_
char** value);
2523 _Inout_
OrtAllocator* allocator, _In_
const char* key, _Outptr_result_maybenull_
char** value);
2534 ORT_CLASS_RELEASE(ModelMetadata);
2582 ORT_CLASS_RELEASE(ThreadingOptions);
2600 _Inout_
OrtAllocator* allocator, _Outptr_result_buffer_maybenull_(*num_keys)
char*** keys, _Out_ int64_t* num_keys);
2615 _In_ int64_t dim_value);
2643 _In_
int providers_length);
2697 _In_z_
const char* config_key, _In_z_
const char* config_value);
2718 ORT_CLASS_RELEASE(Allocator);
2755 ORT_CLASS_RELEASE(IoBinding);
2816 _Out_
char** buffer, _Out_writes_all_(count)
size_t** lengths, _Out_
size_t* count);
2836 _Out_writes_all_(output_count)
OrtValue*** output, _Out_
size_t* output_count);
2864 ORT_API2_STATUS(
TensorAt, _Inout_
OrtValue* value,
const int64_t* location_values,
size_t location_values_count, _Outptr_
void** out);
3075 ORT_API2_STATUS(
CreateArenaCfg, _In_
size_t max_mem,
int arena_extend_strategy,
int initial_chunk_size_bytes,
3078 ORT_CLASS_RELEASE(ArenaCfg);
3170 _Out_
float* out, _Inout_
size_t* size);
3194 _Out_ int64_t* out, _Inout_
size_t* size);
3231 ORT_API2_STATUS(
CreateArenaCfgV2, _In_reads_(num_keys)
const char*
const* arena_config_keys,
3232 _In_reads_(num_keys)
const size_t* arena_config_values, _In_
size_t num_keys,
3252 _In_z_
const char* config_key, _In_z_
const char* config_value);
3276 ORT_CLASS_RELEASE(PrepackedWeightsContainer);
3323 _In_
const void* model_data,
size_t model_data_length,
3380 _In_reads_(num_keys)
const char*
const* provider_options_keys,
3381 _In_reads_(num_keys)
const char*
const* provider_options_values,
3382 _In_
size_t num_keys);
3500 _In_
const int64_t* values_shape,
size_t values_shape_len, _In_
const void* values,
3501 _In_
const int64_t* indices_data,
size_t indices_num);
3523 _In_
const int64_t* values_shape,
size_t values_shape_len, _In_
const void* values,
3524 _In_
const int64_t* inner_indices_data,
size_t inner_indices_num,
3525 _In_
const int64_t* outer_indices_data,
size_t outer_indices_num);
3546 _In_
const int64_t* values_shape,
size_t values_shape_len, _In_
const void* values,
3547 _In_
const int64_t* indices_shape_data,
size_t indices_shape_len,
3548 _In_
const int32_t* indices_data);
3575 _In_
const int64_t* dense_shape,
size_t dense_shape_len,
3576 _In_
const int64_t* values_shape,
size_t values_shape_len,
3611 ORT_API2_STATUS(
UseCsrIndices, _Inout_
OrtValue* ort_value, _Inout_ int64_t* inner_data,
size_t inner_num,
3612 _Inout_ int64_t* outer_data,
size_t outer_num);
3737 ORT_API2_STATUS(
GetExecutionProviderApi, _In_
const char* provider_name, _In_ uint32_t version, _Outptr_
const void** provider_api);
3878 _In_reads_(num_keys)
const char*
const* provider_options_keys,
3879 _In_reads_(num_keys)
const char*
const* provider_options_values,
3880 _In_
size_t num_keys);
3944 _In_reads_(num_initializers)
const char*
const* initializer_names,
3945 _In_reads_(num_initializers)
const OrtValue*
const* initializers,
size_t num_initializers);
3959 _In_
const char* name,
3960 _In_
const void* data,
3971 ORT_CLASS_RELEASE(OpAttr);
3992 _In_z_
const char* op_name,
3993 _In_z_
const char* domain,
3995 _In_reads_(type_constraint_count)
const char** type_constraint_names,
3997 int type_constraint_count,
3998 _In_reads_(attr_count)
const OrtOpAttr*
const* attr_values,
4018 _In_
const OrtOp* ort_op,
4019 _In_
const OrtValue*
const* input_values,
4020 _In_
int input_count,
4021 _Inout_
OrtValue*
const* output_values,
4022 _In_
int output_count);
4030 ORT_CLASS_RELEASE(Op);
4155 _In_
const char* provider_name,
4156 _In_reads_(num_keys)
const char*
const* provider_options_keys,
4157 _In_reads_(num_keys)
const char*
const* provider_options_values,
4158 _In_
size_t num_keys);
4177 ORT_CLASS_RELEASE(KernelInfo);
4235 _In_reads_(num_keys)
const char*
const* provider_options_keys,
4236 _In_reads_(num_keys)
const char*
const* provider_options_values,
4237 _In_
size_t num_keys);
4344 _In_
const char* registration_func_name);
4401 _Inout_
size_t* size);
4429 _Inout_
size_t* size);
4497 _In_z_
const char* config_key, _Out_
int* out);
4528 _In_z_
const char* config_key, _Out_
char* config_value, _Inout_
size_t* size);
4573 _In_reads_(num_keys)
const char*
const* provider_options_keys,
4574 _In_reads_(num_keys)
const char*
const* provider_options_values,
4575 _In_
size_t num_keys);
4682 _In_z_
const char* message, _In_z_
const ORTCHAR_T* file_path,
int line_number,
4683 _In_z_
const char* func_name);
4820 _In_reads_(num_keys)
const char*
const* provider_options_keys,
4821 _In_reads_(num_keys)
const char*
const* provider_options_values,
4822 _In_
size_t num_keys);
4863 _In_reads_(num_keys)
const char*
const* provider_options_keys, _In_reads_(num_keys)
const char*
const* provider_options_values, _In_
size_t num_keys);
4884 _In_reads_(input_len)
const char*
const* input_names,
4885 _In_reads_(input_len)
const OrtValue*
const* input,
size_t input_len,
4886 _In_reads_(output_names_len)
const char*
const* output_names,
size_t output_names_len,
4887 _Inout_updates_all_(output_names_len)
OrtValue** output,
4954 _In_
int resource_id, _Outptr_
void** resource);
5085 _In_reads_(num_keys)
const char*
const* provider_options_keys,
5086 _In_reads_(num_keys)
const char*
const* provider_options_values,
5087 _In_
size_t num_keys);
5104 _In_reads_(num_keys)
const char*
const* provider_options_keys,
5105 _In_reads_(num_keys)
const char*
const* provider_options_values,
5106 _In_
size_t num_keys);
5155 _In_reads_(num_external_initializer_files)
const ORTCHAR_T*
const* external_initializer_file_names,
5156 _In_reads_(num_external_initializer_files)
char*
const* external_initializer_file_buffer_array,
5157 _In_reads_(num_external_initializer_files)
const size_t* external_initializer_file_lengths,
5158 size_t num_external_initializer_files);
5203 ORT_CLASS_RELEASE(LoraAdapter);
5242 _In_reads_(kv_len)
const char*
const* values, _In_
size_t kv_len);
5249 ORT_CLASS_RELEASE(ValueInfo);
5254 ORT_CLASS_RELEASE(Node);
5260 ORT_CLASS_RELEASE(Graph);
5266 ORT_CLASS_RELEASE(Model);
5313 _In_
void* p_data,
size_t p_data_len,
5314 _In_
const int64_t* shape,
size_t shape_len,
5402 _Outptr_
const char*
const** keys, _Outptr_
const char*
const** values,
5403 _Out_
size_t* num_entries);
5420 ORT_CLASS_RELEASE(KeyValuePairs);
5436 _In_
const ORTCHAR_T* path);
5467 _Outptr_
const OrtEpDevice*
const** ep_devices, _Out_
size_t* num_ep_devices);
5490 _In_reads_(num_ep_devices)
const OrtEpDevice*
const* ep_devices, _In_
size_t num_ep_devices,
5491 _In_reads_(num_op_options)
const char*
const* ep_option_keys,
5492 _In_reads_(num_op_options)
const char*
const* ep_option_vals,
5493 size_t num_ep_options);
5520 _In_opt_
void* delegate_state);
5708 _Outptr_
const OrtNode** producer_node, _Out_opt_
size_t* producer_output_index);
5754 _Out_writes_all_(num_consumers)
const OrtNode** nodes,
5755 _Out_writes_all_(num_consumers) int64_t* input_indices,
5756 _In_
size_t num_consumers);
5813 _Out_
bool* is_required_graph_input);
5829 _Out_
bool* is_optional_graph_input);
5857 _Out_
bool* is_constant_initializer);
5873 _Out_
bool* is_from_outer_scope);
5953 _Out_writes_(num_operator_sets)
const char** domains,
5954 _Out_writes_(num_operator_sets) int64_t* opset_versions, _In_
size_t num_operator_sets);
5984 _Out_writes_(num_inputs)
const OrtValueInfo** inputs, _In_
size_t num_inputs);
6010 _Out_writes_(num_outputs)
const OrtValueInfo** outputs, _In_
size_t num_outputs);
6047 _Out_writes_(num_initializers)
const OrtValueInfo** initializers,
6048 _In_
size_t num_initializers);
6077 _Out_writes_(num_nodes)
const OrtNode** nodes, _In_
size_t num_nodes);
6199 _Out_writes_(num_inputs)
const OrtValueInfo** inputs, _In_
size_t num_inputs);
6225 _Out_writes_(num_outputs)
const OrtValueInfo** outputs, _In_
size_t num_outputs);
6260 _Out_writes_(num_implicit_inputs)
const OrtValueInfo** implicit_inputs,
6261 _In_
size_t num_implicit_inputs);
6292 _Out_writes_(num_attributes)
const OrtOpAttr** attributes, _In_
size_t num_attributes);
6381 _Out_writes_(num_subgraphs)
const OrtGraph** subgraphs, _In_
size_t num_subgraphs,
6382 _Out_writes_opt_(num_subgraphs)
const char** attribute_names);
6425 ORT_CLASS_RELEASE(ExternalInitializerInfo);
6478 _In_z_
const char* config_key);
6603 _Out_writes_(num_inputs)
const OrtMemoryInfo** inputs_memory_info,
6604 _In_
size_t num_inputs);
6626 _Out_writes_(num_outputs)
const OrtMemoryInfo** outputs_memory_info,
6627 _In_
size_t num_outputs);
6654 _Out_writes_(num_inputs)
const OrtEpDevice** inputs_ep_devices,
6655 _In_
size_t num_inputs);
6688 ORT_CLASS_RELEASE(SyncStream);
6715 _In_reads_(num_tensors)
const OrtValue*
const* src_tensors,
6716 _In_reads_(num_tensors)
OrtValue*
const* dst_tensors,
6718 _In_
size_t num_tensors);
6744 _In_reads_(num_ep_devices)
const OrtEpDevice*
const* ep_devices,
6745 _In_
size_t num_ep_devices,
6746 _In_
const char* compatibility_info,
6815 _Inout_
size_t* size);
6839 _Inout_
size_t* size);
6850 _Out_
int* since_version);
6886 _Out_writes_(num_outputs)
const OrtEpDevice** outputs_ep_devices,
6887 _In_
size_t num_outputs);
6923 _In_
size_t num_devices);
6947 _In_
const char* ep_name,
6966 _Out_ uint32_t* reasons_bitmask);
6980 _Outptr_result_maybenull_
const char** notes);
6996 _Out_ int32_t* error_code);
7002 ORT_CLASS_RELEASE(DeviceEpIncompatibilityDetails);
7041 _In_
const ORTCHAR_T* model_path,
7042 _In_
const char* ep_type,
7044 _Outptr_result_maybenull_
char** compatibility_info);
7069 _In_reads_(model_data_length)
const void* model_data,
7070 _In_
size_t model_data_length,
7071 _In_
const char* ep_type,
7073 _Outptr_result_maybenull_
char** compatibility_info);
7122 _Out_
size_t* num_ep_subgraphs);
7135 _Outptr_
const char** out);
7285 _Out_
void** kernel);
7301 size_t(ORT_API_CALL*
GetMayInplace)(_Out_
int** input_index, _Out_
int** output_index);
7305 void(ORT_API_CALL*
ReleaseMayInplace)(_Frees_ptr_opt_
int* input_index, _Frees_ptr_opt_
int* output_index);
7308 size_t(ORT_API_CALL*
GetAliasMap)(_Out_
int** input_index, _Out_
int** output_index);
7309 void(ORT_API_CALL*
ReleaseAliasMap)(_Frees_ptr_opt_
int* input_index, _Frees_ptr_opt_
int* output_index);
7327#if defined(ORT_MINIMAL_BUILD)
7328 const bool not_defined_in_this_build;
7443 ORT_API2_STATUS(
CreateNode, _In_
const char* operator_name, _In_
const char* domain_name, _In_
const char* node_name,
7444 _In_reads_(input_names_len)
const char*
const* input_names,
size_t input_names_len,
7445 _In_reads_(output_names_len)
const char*
const* output_names,
size_t output_names_len,
7446 _In_reads_(attribs_len) _In_opt_
OrtOpAttr** attributes, _In_
size_t attribs_len,
7469 _In_reads_(inputs_len) _In_
OrtValueInfo** inputs, _In_
size_t inputs_len);
7485 _In_reads_(outputs_len) _In_
OrtValueInfo** outputs, _In_
size_t outputs_len);
7526 bool data_is_external);
7560 _In_reads_(opset_entries_len)
const char*
const* domain_names,
7561 _In_reads_(opset_entries_len)
const int* opset_versions,
7562 size_t opset_entries_len,
7652 _In_
const void* model_data,
size_t model_data_length,
7755 ORT_CLASS_RELEASE(ModelCompilationOptions);
7791 _In_
const ORTCHAR_T* input_model_path);
7808 _In_
const void* input_model_data,
7809 size_t input_model_data_size);
7829 _In_
const ORTCHAR_T* output_model_path);
7848 _In_
const ORTCHAR_T* external_initializers_file_path,
7849 size_t external_initializers_size_threshold);
7875 _Outptr_
void** output_model_buffer_ptr,
7876 _Out_
size_t* output_model_buffer_size_ptr);
7901 bool embed_ep_context_in_model);
7941 _In_
const ORTCHAR_T* output_directory,
7942 _In_
const ORTCHAR_T* model_name);
8057 ORT_CLASS_RELEASE(ExternalResourceImporter);
8076 _Out_
bool* out_supported);
8100 ORT_CLASS_RELEASE(ExternalMemoryHandle);
8140 _Out_
bool* out_supported);
8166 ORT_CLASS_RELEASE(ExternalSemaphoreHandle);
8187 _In_ uint64_t value);
8208 _In_ uint64_t value);
8264#include "onnxruntime_ep_c_api.h"
OrtStatus * OrtSessionOptionsAppendExecutionProvider_MIGraphX(OrtSessionOptions *options, int device_id)
struct OrtMemoryInfo OrtMemoryInfo
Definition onnxruntime_c_api.h:299
struct OrtLoraAdapter OrtLoraAdapter
Definition onnxruntime_c_api.h:325
struct OrtHardwareDevice OrtHardwareDevice
Definition onnxruntime_c_api.h:331
struct OrtKernelInfo OrtKernelInfo
Definition onnxruntime_c_api.h:459
struct OrtNode OrtNode
Definition onnxruntime_c_api.h:327
OrtStatus * OrtSessionOptionsAppendExecutionProvider_Tensorrt(OrtSessionOptions *options, int device_id)
struct OrtEpAssignedNode OrtEpAssignedNode
Definition onnxruntime_c_api.h:341
OrtLoggingLevel
Logging severity levels.
Definition onnxruntime_c_api.h:249
const struct OrtCustomHandleType * OrtCustomThreadHandle
OrtMemoryInfoDeviceType
This mimics OrtDevice type constants so they can be returned in the API.
Definition onnxruntime_c_api.h:494
struct OrtModelCompilationOptions OrtModelCompilationOptions
Definition onnxruntime_c_api.h:330
struct OrtShapeInferContext OrtShapeInferContext
Definition onnxruntime_c_api.h:324
void(* OrtLoggingFunction)(void *param, OrtLoggingLevel severity, const char *category, const char *logid, const char *code_location, const char *message)
Definition onnxruntime_c_api.h:423
void(* OrtCustomJoinThreadFn)(OrtCustomThreadHandle ort_custom_thread_handle)
Custom thread join function.
Definition onnxruntime_c_api.h:960
OrtStatus *(* RegisterCustomOpsFn)(OrtSessionOptions *options, const OrtApiBase *api)
Definition onnxruntime_c_api.h:962
OrtCustomOpInputOutputCharacteristic
Definition onnxruntime_c_api.h:7215
struct OrtTensorRTProviderOptionsV2 OrtTensorRTProviderOptionsV2
Definition onnxruntime_c_api.h:316
struct OrtOpAttr OrtOpAttr
Definition onnxruntime_c_api.h:322
struct OrtThreadingOptions OrtThreadingOptions
Definition onnxruntime_c_api.h:313
struct OrtSequenceTypeInfo OrtSequenceTypeInfo
Definition onnxruntime_c_api.h:307
OrtLanguageProjection
Language projection identifiers /see OrtApi::SetLanguageProjection.
Definition onnxruntime_c_api.h:448
struct OrtValueInfo OrtValueInfo
Definition onnxruntime_c_api.h:326
struct OrtDnnlProviderOptions OrtDnnlProviderOptions
Definition onnxruntime_c_api.h:320
OrtSparseIndicesFormat
Definition onnxruntime_c_api.h:238
struct OrtPrepackedWeightsContainer OrtPrepackedWeightsContainer
Definition onnxruntime_c_api.h:315
OrtExternalMemoryHandleType
External memory handle type for importing GPU resources.
Definition onnxruntime_c_api.h:981
struct OrtSession OrtSession
Definition onnxruntime_c_api.h:301
OrtCompiledModelCompatibility
Definition onnxruntime_c_api.h:1043
OrtStatus *(* EpSelectionDelegate)(const OrtEpDevice **ep_devices, size_t num_devices, const OrtKeyValuePairs *model_metadata, const OrtKeyValuePairs *runtime_metadata, const OrtEpDevice **selected, size_t max_selected, size_t *num_selected, void *state)
Delegate to allow providing custom OrtEpDevice selection logic.
Definition onnxruntime_c_api.h:548
struct OrtCustomOpDomain OrtCustomOpDomain
Definition onnxruntime_c_api.h:310
OrtExternalSemaphoreType
External semaphore type for GPU synchronization.
Definition onnxruntime_c_api.h:1006
struct OrtIoBinding OrtIoBinding
Definition onnxruntime_c_api.h:300
struct OrtExternalInitializerInfo OrtExternalInitializerInfo
Definition onnxruntime_c_api.h:335
OrtAllocatorType
Definition onnxruntime_c_api.h:465
struct OrtOp OrtOp
Definition onnxruntime_c_api.h:321
struct OrtModelMetadata OrtModelMetadata
Definition onnxruntime_c_api.h:311
OrtDeviceEpIncompatibilityReason
Reasons why an execution provider might not be compatible with a device.
Definition onnxruntime_c_api.h:521
struct OrtTypeInfo OrtTypeInfo
Definition onnxruntime_c_api.h:304
struct OrtTensorTypeAndShapeInfo OrtTensorTypeAndShapeInfo
Definition onnxruntime_c_api.h:305
struct OrtCUDAProviderOptionsV2 OrtCUDAProviderOptionsV2
Definition onnxruntime_c_api.h:318
struct OrtKernelContext OrtKernelContext
Definition onnxruntime_c_api.h:461
OrtStatus * OrtSessionOptionsAppendExecutionProvider_Dnnl(OrtSessionOptions *options, int use_arena)
OrtCudnnConvAlgoSearch
Algorithm to use for cuDNN Convolution Op.
Definition onnxruntime_c_api.h:610
struct OrtCANNProviderOptions OrtCANNProviderOptions
Definition onnxruntime_c_api.h:319
struct OrtEpDevice OrtEpDevice
Definition onnxruntime_c_api.h:332
struct OrtExternalResourceImporter OrtExternalResourceImporter
Definition onnxruntime_c_api.h:336
void(* RunAsyncCallbackFn)(void *user_data, OrtValue **outputs, size_t num_outputs, OrtStatusPtr status)
Callback function for RunAsync.
Definition onnxruntime_c_api.h:971
struct OrtRunOptions OrtRunOptions
Definition onnxruntime_c_api.h:303
OrtHardwareDeviceType
Definition onnxruntime_c_api.h:501
struct OrtModel OrtModel
Definition onnxruntime_c_api.h:329
struct OrtGraph OrtGraph
Definition onnxruntime_c_api.h:328
struct OrtSyncStream OrtSyncStream
Definition onnxruntime_c_api.h:334
void(* OrtThreadWorkerFn)(void *ort_worker_fn_param)
Thread work loop function.
Definition onnxruntime_c_api.h:942
struct OrtEpAssignedSubgraph OrtEpAssignedSubgraph
Definition onnxruntime_c_api.h:340
OrtStatus * OrtSessionOptionsAppendExecutionProvider_ROCM(OrtSessionOptions *options, int device_id)
struct OrtOptionalTypeInfo OrtOptionalTypeInfo
Definition onnxruntime_c_api.h:308
struct OrtSessionOptions OrtSessionOptions
Definition onnxruntime_c_api.h:309
OrtDeviceMemoryType
This matches OrtDevice::MemoryType values.
Definition onnxruntime_c_api.h:487
struct OrtValue OrtValue
Definition onnxruntime_c_api.h:302
OrtStatus *(* OrtWriteBufferFunc)(void *state, const void *buffer, size_t buffer_num_bytes)
Function called by ORT to write a buffer to a custom destination (e.g., file, stream,...
Definition onnxruntime_c_api.h:567
GraphOptimizationLevel
Graph optimization level.
Definition onnxruntime_c_api.h:432
struct OrtKeyValuePairs OrtKeyValuePairs
Definition onnxruntime_c_api.h:333
OrtStatus * OrtStatusPtr
Definition onnxruntime_c_api.h:346
OrtMemType
Memory types for allocated memory, execution provider specific types should be extended in each provi...
Definition onnxruntime_c_api.h:475
OrtSparseFormat
Definition onnxruntime_c_api.h:230
ONNXType
Definition onnxruntime_c_api.h:218
struct OrtEnv OrtEnv
Definition onnxruntime_c_api.h:297
OrtErrorCode
Definition onnxruntime_c_api.h:257
struct OrtStatus OrtStatus
Definition onnxruntime_c_api.h:298
struct OrtDeviceEpIncompatibilityDetails OrtDeviceEpIncompatibilityDetails
Definition onnxruntime_c_api.h:339
OrtStatus *(* OrtGetInitializerLocationFunc)(void *state, const char *initializer_name, const OrtValue *initializer_value, const OrtExternalInitializerInfo *external_info, OrtExternalInitializerInfo **new_external_info)
Function called by ORT to allow user to specify how an initializer should be saved,...
Definition onnxruntime_c_api.h:601
struct OrtLogger OrtLogger
Definition onnxruntime_c_api.h:323
struct OrtMapTypeInfo OrtMapTypeInfo
Definition onnxruntime_c_api.h:306
struct OrtArenaCfg OrtArenaCfg
Definition onnxruntime_c_api.h:314
ExecutionMode
Definition onnxruntime_c_api.h:440
OrtStatus * OrtSessionOptionsAppendExecutionProvider_CUDA(OrtSessionOptions *options, int device_id)
OrtOpAttrType
Definition onnxruntime_c_api.h:275
OrtCustomThreadHandle(* OrtCustomCreateThreadFn)(void *ort_custom_thread_creation_options, OrtThreadWorkerFn ort_thread_worker_fn, void *ort_worker_fn_param)
Ort custom thread creation function.
Definition onnxruntime_c_api.h:953
ONNXTensorElementDataType
Definition onnxruntime_c_api.h:184
OrtCompileApiFlags
Flags representing options to enable when compiling a model.
Definition onnxruntime_c_api.h:7716
OrtExecutionProviderDevicePolicy
These are the default EP selection policies used by ORT when doing automatic EP selection.
Definition onnxruntime_c_api.h:509
const OrtApiBase * OrtGetApiBase(void)
The Onnxruntime library's entry point to access the C API.
@ ORT_LOGGING_LEVEL_VERBOSE
Verbose informational messages (least severe).
Definition onnxruntime_c_api.h:250
@ ORT_LOGGING_LEVEL_INFO
Informational messages.
Definition onnxruntime_c_api.h:251
@ ORT_LOGGING_LEVEL_ERROR
Error messages.
Definition onnxruntime_c_api.h:253
@ ORT_LOGGING_LEVEL_WARNING
Warning messages.
Definition onnxruntime_c_api.h:252
@ ORT_LOGGING_LEVEL_FATAL
Fatal error messages (most severe).
Definition onnxruntime_c_api.h:254
@ OrtMemoryInfoDeviceType_GPU
Definition onnxruntime_c_api.h:496
@ OrtMemoryInfoDeviceType_FPGA
Definition onnxruntime_c_api.h:497
@ OrtMemoryInfoDeviceType_CPU
Definition onnxruntime_c_api.h:495
@ OrtMemoryInfoDeviceType_NPU
Definition onnxruntime_c_api.h:498
@ INPUT_OUTPUT_VARIADIC
Definition onnxruntime_c_api.h:7218
@ INPUT_OUTPUT_REQUIRED
Definition onnxruntime_c_api.h:7216
@ INPUT_OUTPUT_OPTIONAL
Definition onnxruntime_c_api.h:7217
@ ORT_PROJECTION_C
Definition onnxruntime_c_api.h:449
@ ORT_PROJECTION_PYTHON
Definition onnxruntime_c_api.h:452
@ ORT_PROJECTION_CPLUSPLUS
Definition onnxruntime_c_api.h:450
@ ORT_PROJECTION_WINML
Definition onnxruntime_c_api.h:454
@ ORT_PROJECTION_CSHARP
Definition onnxruntime_c_api.h:451
@ ORT_PROJECTION_JAVA
Definition onnxruntime_c_api.h:453
@ ORT_PROJECTION_NODEJS
Definition onnxruntime_c_api.h:455
@ ORT_SPARSE_COO_INDICES
Definition onnxruntime_c_api.h:239
@ ORT_SPARSE_BLOCK_SPARSE_INDICES
Definition onnxruntime_c_api.h:242
@ ORT_SPARSE_CSR_OUTER_INDICES
Definition onnxruntime_c_api.h:241
@ ORT_SPARSE_CSR_INNER_INDICES
Definition onnxruntime_c_api.h:240
@ ORT_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE
Definition onnxruntime_c_api.h:982
@ ORT_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP
Definition onnxruntime_c_api.h:983
@ OrtCompiledModelCompatibility_EP_SUPPORTED_PREFER_RECOMPILATION
Definition onnxruntime_c_api.h:1046
@ OrtCompiledModelCompatibility_EP_NOT_APPLICABLE
Definition onnxruntime_c_api.h:1044
@ OrtCompiledModelCompatibility_EP_SUPPORTED_OPTIMAL
Definition onnxruntime_c_api.h:1045
@ OrtCompiledModelCompatibility_EP_UNSUPPORTED
Definition onnxruntime_c_api.h:1047
@ ORT_EXTERNAL_SEMAPHORE_D3D12_FENCE
Definition onnxruntime_c_api.h:1007
@ OrtDeviceAllocator
Definition onnxruntime_c_api.h:467
@ OrtArenaAllocator
Definition onnxruntime_c_api.h:468
@ OrtReadOnlyAllocator
Definition onnxruntime_c_api.h:469
@ OrtInvalidAllocator
Definition onnxruntime_c_api.h:466
@ OrtDeviceEpIncompatibility_DEVICE_INCOMPATIBLE
Definition onnxruntime_c_api.h:524
@ OrtDeviceEpIncompatibility_MISSING_DEPENDENCY
Definition onnxruntime_c_api.h:525
@ OrtDeviceEpIncompatibility_DRIVER_INCOMPATIBLE
Definition onnxruntime_c_api.h:523
@ OrtDeviceEpIncompatibility_NONE
Definition onnxruntime_c_api.h:522
@ OrtDeviceEpIncompatibility_UNKNOWN
Definition onnxruntime_c_api.h:526
@ OrtCudnnConvAlgoSearchDefault
Definition onnxruntime_c_api.h:613
@ OrtCudnnConvAlgoSearchExhaustive
Definition onnxruntime_c_api.h:611
@ OrtCudnnConvAlgoSearchHeuristic
Definition onnxruntime_c_api.h:612
@ OrtHardwareDeviceType_CPU
Definition onnxruntime_c_api.h:502
@ OrtHardwareDeviceType_NPU
Definition onnxruntime_c_api.h:504
@ OrtHardwareDeviceType_GPU
Definition onnxruntime_c_api.h:503
@ OrtDeviceMemoryType_HOST_ACCESSIBLE
Shared/pinned memory for transferring between CPU and the device.
Definition onnxruntime_c_api.h:489
@ OrtDeviceMemoryType_DEFAULT
Device memory.
Definition onnxruntime_c_api.h:488
@ ORT_ENABLE_BASIC
Definition onnxruntime_c_api.h:434
@ ORT_ENABLE_ALL
Definition onnxruntime_c_api.h:437
@ ORT_ENABLE_LAYOUT
Definition onnxruntime_c_api.h:436
@ ORT_DISABLE_ALL
Definition onnxruntime_c_api.h:433
@ ORT_ENABLE_EXTENDED
Definition onnxruntime_c_api.h:435
@ OrtMemTypeCPUInput
Any CPU memory used by non-CPU execution provider.
Definition onnxruntime_c_api.h:477
@ OrtMemTypeCPU
CPU accessible memory allocated by non-CPU execution provider, i.e. HOST_ACCESSIBLE.
Definition onnxruntime_c_api.h:481
@ OrtMemTypeDefault
The default allocator for execution provider.
Definition onnxruntime_c_api.h:483
@ OrtMemTypeCPUOutput
CPU accessible memory outputted by non-CPU execution provider, i.e. HOST_ACCESSIBLE.
Definition onnxruntime_c_api.h:479
@ ORT_SPARSE_CSRC
Definition onnxruntime_c_api.h:233
@ ORT_SPARSE_COO
Definition onnxruntime_c_api.h:232
@ ORT_SPARSE_BLOCK_SPARSE
Definition onnxruntime_c_api.h:234
@ ORT_SPARSE_UNDEFINED
Definition onnxruntime_c_api.h:231
@ ONNX_TYPE_SEQUENCE
Definition onnxruntime_c_api.h:221
@ ONNX_TYPE_MAP
Definition onnxruntime_c_api.h:222
@ ONNX_TYPE_OPAQUE
Definition onnxruntime_c_api.h:223
@ ONNX_TYPE_UNKNOWN
Definition onnxruntime_c_api.h:219
@ ONNX_TYPE_TENSOR
Definition onnxruntime_c_api.h:220
@ ONNX_TYPE_SPARSETENSOR
Definition onnxruntime_c_api.h:224
@ ONNX_TYPE_OPTIONAL
Definition onnxruntime_c_api.h:225
@ ORT_MODEL_LOAD_CANCELED
Definition onnxruntime_c_api.h:270
@ ORT_NO_SUCHFILE
Definition onnxruntime_c_api.h:261
@ ORT_OK
Definition onnxruntime_c_api.h:258
@ ORT_INVALID_ARGUMENT
Definition onnxruntime_c_api.h:260
@ ORT_EP_FAIL
Definition onnxruntime_c_api.h:269
@ ORT_NOT_IMPLEMENTED
Definition onnxruntime_c_api.h:267
@ ORT_RUNTIME_EXCEPTION
Definition onnxruntime_c_api.h:264
@ ORT_ENGINE_ERROR
Definition onnxruntime_c_api.h:263
@ ORT_FAIL
Definition onnxruntime_c_api.h:259
@ ORT_NOT_FOUND
Definition onnxruntime_c_api.h:272
@ ORT_MODEL_REQUIRES_COMPILATION
Definition onnxruntime_c_api.h:271
@ ORT_INVALID_PROTOBUF
Definition onnxruntime_c_api.h:265
@ ORT_NO_MODEL
Definition onnxruntime_c_api.h:262
@ ORT_INVALID_GRAPH
Definition onnxruntime_c_api.h:268
@ ORT_MODEL_LOADED
Definition onnxruntime_c_api.h:266
@ ORT_PARALLEL
Definition onnxruntime_c_api.h:442
@ ORT_SEQUENTIAL
Definition onnxruntime_c_api.h:441
@ ORT_OP_ATTR_INT
Definition onnxruntime_c_api.h:277
@ ORT_OP_ATTR_FLOATS
Definition onnxruntime_c_api.h:280
@ ORT_OP_ATTR_STRINGS
Definition onnxruntime_c_api.h:282
@ ORT_OP_ATTR_UNDEFINED
Definition onnxruntime_c_api.h:276
@ ORT_OP_ATTR_GRAPH
Definition onnxruntime_c_api.h:283
@ ORT_OP_ATTR_TENSOR
Definition onnxruntime_c_api.h:284
@ ORT_OP_ATTR_INTS
Definition onnxruntime_c_api.h:278
@ ORT_OP_ATTR_STRING
Definition onnxruntime_c_api.h:281
@ ORT_OP_ATTR_FLOAT
Definition onnxruntime_c_api.h:279
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING
Definition onnxruntime_c_api.h:193
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32
Definition onnxruntime_c_api.h:191
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32
Definition onnxruntime_c_api.h:197
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT2
Definition onnxruntime_c_api.h:213
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16
Definition onnxruntime_c_api.h:189
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED
Definition onnxruntime_c_api.h:185
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128
Definition onnxruntime_c_api.h:200
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2FNUZ
Definition onnxruntime_c_api.h:206
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64
Definition onnxruntime_c_api.h:198
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT4
Definition onnxruntime_c_api.h:208
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64
Definition onnxruntime_c_api.h:192
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT4E2M1
Definition onnxruntime_c_api.h:211
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2
Definition onnxruntime_c_api.h:205
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL
Definition onnxruntime_c_api.h:194
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16
Definition onnxruntime_c_api.h:195
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8
Definition onnxruntime_c_api.h:187
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16
Definition onnxruntime_c_api.h:190
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE
Definition onnxruntime_c_api.h:196
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8
Definition onnxruntime_c_api.h:188
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT
Definition onnxruntime_c_api.h:186
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FN
Definition onnxruntime_c_api.h:203
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16
Definition onnxruntime_c_api.h:201
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_INT4
Definition onnxruntime_c_api.h:209
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64
Definition onnxruntime_c_api.h:199
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FNUZ
Definition onnxruntime_c_api.h:204
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_INT2
Definition onnxruntime_c_api.h:214
@ OrtCompileApiFlags_NONE
Definition onnxruntime_c_api.h:7718
@ OrtCompileApiFlags_ERROR_IF_NO_NODES_COMPILED
Definition onnxruntime_c_api.h:7722
@ OrtCompileApiFlags_ERROR_IF_OUTPUT_FILE_EXISTS
Definition onnxruntime_c_api.h:7726
@ OrtExecutionProviderDevicePolicy_DEFAULT
Definition onnxruntime_c_api.h:510
@ OrtExecutionProviderDevicePolicy_PREFER_CPU
Definition onnxruntime_c_api.h:511
@ OrtExecutionProviderDevicePolicy_MAX_PERFORMANCE
Definition onnxruntime_c_api.h:514
@ OrtExecutionProviderDevicePolicy_PREFER_NPU
Definition onnxruntime_c_api.h:512
@ OrtExecutionProviderDevicePolicy_MAX_EFFICIENCY
Definition onnxruntime_c_api.h:515
@ OrtExecutionProviderDevicePolicy_PREFER_GPU
Definition onnxruntime_c_api.h:513
@ OrtExecutionProviderDevicePolicy_MIN_OVERALL_POWER
Definition onnxruntime_c_api.h:516
Memory allocation interface.
Definition onnxruntime_c_api.h:355
void(* Free)(struct OrtAllocator *this_, void *p)
Free a block of memory previously allocated with OrtAllocator::Alloc.
Definition onnxruntime_c_api.h:362
const struct OrtMemoryInfo *(* Info)(const struct OrtAllocator *this_)
Return a pointer to an OrtMemoryInfo that describes this allocator.
Definition onnxruntime_c_api.h:365
uint32_t version
Must be initialized to ORT_API_VERSION.
Definition onnxruntime_c_api.h:356
void *(* Alloc)(struct OrtAllocator *this_, size_t size)
Returns a pointer to an allocated block of size bytes.
Definition onnxruntime_c_api.h:359
void *(* AllocOnStream)(struct OrtAllocator *this_, size_t size, OrtSyncStream *stream)
Allocate using a stream.
Definition onnxruntime_c_api.h:420
void *(* Reserve)(struct OrtAllocator *this_, size_t size)
Optional allocation function to use for memory allocations made during session initialization....
Definition onnxruntime_c_api.h:376
OrtStatus * GetStats(const struct OrtAllocator *this_, OrtKeyValuePairs **out)
Function used to get the statistics of the allocator.
The helper interface to get the right version of OrtApi.
Definition onnxruntime_c_api.h:910
const char *(* GetVersionString)(void)
Returns a null terminated string of the version of the Onnxruntime library (eg: "1....
Definition onnxruntime_c_api.h:926
const OrtApi *(* GetApi)(uint32_t version)
Get a pointer to the requested version of the OrtApi.
Definition onnxruntime_c_api.h:920
The C API.
Definition onnxruntime_c_api.h:1145
OrtStatus * SetGlobalIntraOpThreadAffinity(OrtThreadingOptions *tp_options, const char *affinity_string)
OrtStatus * ShapeInferContext_SetOutputTypeShape(const OrtShapeInferContext *context, size_t index, const OrtTensorTypeAndShapeInfo *info)
OrtStatus * SessionGetOverridableInitializerTypeInfo(const OrtSession *session, size_t index, OrtTypeInfo **type_info)
Get overridable initializer type information.
OrtStatus * SessionOptionsSetCustomJoinThreadFn(OrtSessionOptions *options, OrtCustomJoinThreadFn ort_custom_join_thread_fn)
Set custom thread join function.
OrtStatus * KernelInfoGetAttributeArray_int64(const OrtKernelInfo *info, const char *name, int64_t *out, size_t *size)
Fetch an array of int64_t values stored as an attribute in the graph node.
OrtStatus * Graph_GetNumInputs(const OrtGraph *graph, size_t *num_inputs)
Returns the number of graph inputs.
OrtStatus * Node_GetOperatorType(const OrtNode *node, const char **operator_type)
Returns a node's operator type (e.g., "Conv").
OrtStatus * CreateSessionOptions(OrtSessionOptions **options)
Create an OrtSessionOptions object.
OrtHardwareDeviceType(* HardwareDevice_Type)(const OrtHardwareDevice *device)
Get the hardware device type.
Definition onnxruntime_c_api.h:5529
void(* ReleaseDnnlProviderOptions)(OrtDnnlProviderOptions *input)
Release an OrtDnnlProviderOptions.
Definition onnxruntime_c_api.h:4597
OrtStatus * GetTensorData(const OrtValue *value, const void **out)
Get a const pointer to the raw data inside a tensor.
OrtStatus * TensorAt(OrtValue *value, const int64_t *location_values, size_t location_values_count, void **out)
Direct memory access to a specified tensor element.
OrtStatus * KernelInfoGetAttribute_float(const OrtKernelInfo *info, const char *name, float *out)
Get a float stored as an attribute in the graph node.
OrtStatus * GetCANNProviderOptionsAsString(const OrtCANNProviderOptions *cann_options, OrtAllocator *allocator, char **ptr)
Get serialized CANN provider options string.
OrtStatus * InvokeOp(const OrtKernelContext *context, const OrtOp *ort_op, const OrtValue *const *input_values, int input_count, OrtValue *const *output_values, int output_count)
: Invoke the operator created by OrtApi::CreateOp The inputs must follow the order as specified in on...
OrtStatus * HasSessionConfigEntry(const OrtSessionOptions *options, const char *config_key, int *out)
Checks if the given session configuration entry exists.
const char *(* GetBuildInfoString)(void)
Returns a null terminated string of the build info including git info and cxx flags.
Definition onnxruntime_c_api.h:4787
OrtStatus * AddExternalInitializersFromFilesInMemory(OrtSessionOptions *options, const char *const *external_initializer_file_names, char *const *external_initializer_file_buffer_array, const size_t *external_initializer_file_lengths, size_t num_external_initializer_files)
Replace initialized Tensors with external data with the provided files in memory.
OrtStatus * ValueInfo_IsFromOuterScope(const OrtValueInfo *value_info, bool *is_from_outer_scope)
Returns a boolean indicating if the given value is defined in an outer scope.
OrtStatus * GetTensorMemoryInfo(const OrtValue *value, const OrtMemoryInfo **mem_info)
Returns a pointer to the OrtMemoryInfo of a Tensor.
OrtStatus * EnableCpuMemArena(OrtSessionOptions *options)
Enable the memory arena on CPU.
OrtStatus * CreateSparseTensorWithValuesAsOrtValue(const OrtMemoryInfo *info, void *p_data, const int64_t *dense_shape, size_t dense_shape_len, const int64_t *values_shape, size_t values_shape_len, ONNXTensorElementDataType type, OrtValue **out)
OrtStatus * GetValueCount(const OrtValue *value, size_t *out)
Get non tensor value count from an OrtValue.
OrtStatus * SetGlobalCustomJoinThreadFn(OrtThreadingOptions *tp_options, OrtCustomJoinThreadFn ort_custom_join_thread_fn)
Set custom thread join function for global thread pools.
OrtStatus * CreateCUDAProviderOptions(OrtCUDAProviderOptionsV2 **out)
Create an OrtCUDAProviderOptionsV2.
OrtStatus * DisableProfiling(OrtSessionOptions *options)
Disable profiling for a session.
OrtStatus * KernelInfoGetAttributeArray_float(const OrtKernelInfo *info, const char *name, float *out, size_t *size)
Fetch an array of int64_t values stored as an attribute in the graph node.
OrtStatus * CreatePrepackedWeightsContainer(OrtPrepackedWeightsContainer **out)
Create an OrtPrepackedWeightsContainer.
OrtStatus * SetDeterministicCompute(OrtSessionOptions *options, bool value)
Set whether to use deterministic compute.
OrtStatus * UpdateTensorRTProviderOptionsWithValue(OrtTensorRTProviderOptionsV2 *tensorrt_options, const char *key, void *value)
OrtStatus * CreateSessionFromArrayWithPrepackedWeightsContainer(const OrtEnv *env, const void *model_data, size_t model_data_length, const OrtSessionOptions *options, OrtPrepackedWeightsContainer *prepacked_weights_container, OrtSession **out)
Create session from memory with prepacked weights container.
OrtStatus * AddFreeDimensionOverrideByName(OrtSessionOptions *options, const char *dim_name, int64_t dim_value)
OrtStatus * GetSharedAllocator(OrtEnv *env, const OrtMemoryInfo *mem_info, OrtAllocator **allocator)
Get a shared allocator from the OrtEnv.
OrtStatus * KernelInfo_GetInputCount(const OrtKernelInfo *info, size_t *out)
Get the number of inputs from OrtKernelInfo.
OrtStatus * Graph_GetOperatorSets(const OrtGraph *graph, const char **domains, int64_t *opset_versions, size_t num_operator_sets)
Returns the operator sets that the graph's model uses.
OrtStatus * GetSparseTensorFormat(const OrtValue *ort_value, enum OrtSparseFormat *out)
Returns sparse tensor format enum iff a given ort value contains an instance of sparse tensor.
OrtStatus * KernelContext_GetGPUComputeStream(const OrtKernelContext *context, void **out)
Used for custom operators, gets the GPU compute stream to use to launch the custom a GPU kernel.
OrtStatus * UpdateCANNProviderOptions(OrtCANNProviderOptions *cann_options, const char *const *provider_options_keys, const char *const *provider_options_values, size_t num_keys)
Set options in a CANN Execution Provider.
OrtStatus * GetTensorSizeInBytes(const OrtValue *ort_value, size_t *size)
Compute total size in bytes of the tensor data contained in an OrtValue.
const OrtEpApi *(* GetEpApi)(void)
Get the OrtEpApi instance for implementing an execution provider.
Definition onnxruntime_c_api.h:5618
OrtStatus * GetCompatibilityInfoFromModel(const char *model_path, const char *ep_type, OrtAllocator *allocator, char **compatibility_info)
Extract EP compatibility info from a precompiled model file.
OrtStatus * CreateAndRegisterAllocatorV2(OrtEnv *env, const char *provider_type, const OrtMemoryInfo *mem_info, const OrtArenaCfg *arena_cfg, const char *const *provider_options_keys, const char *const *provider_options_values, size_t num_keys)
Create an allocator with specific type and register it with the OrtEnv This API enhance CreateAndRegi...
OrtStatus * SessionGetOutputName(const OrtSession *session, size_t index, OrtAllocator *allocator, char **value)
Get output name.
OrtStatus * SessionOptionsAppendExecutionProvider_TensorRT(OrtSessionOptions *options, const OrtTensorRTProviderOptions *tensorrt_options)
Append TensorRT provider to session options.
const char *(* HardwareDevice_Vendor)(const OrtHardwareDevice *device)
Get the hardware device's vendor name.
Definition onnxruntime_c_api.h:5547
OrtStatus * Node_GetAttributeByName(const OrtNode *node, const char *attribute_name, const OrtOpAttr **attribute)
Gets the OrtNode's attribute as OrtOpAttr by name.
const OrtTrainingApi *(* GetTrainingApi)(uint32_t version)
Gets the Training C Api struct.
Definition onnxruntime_c_api.h:4195
OrtStatus * SetIntraOpNumThreads(OrtSessionOptions *options, int intra_op_num_threads)
Sets the number of threads used to parallelize the execution within nodes.
OrtStatus * GetTypeInfo(const OrtValue *value, OrtTypeInfo **out)
Get type information of an OrtValue.
OrtStatus * AllocatorGetStats(const OrtAllocator *ort_allocator, OrtKeyValuePairs **out)
Calls OrtAllocator::GetStats function.
OrtStatus * CastTypeInfoToMapTypeInfo(const OrtTypeInfo *type_info, const OrtMapTypeInfo **out)
Get detailed map information from an OrtTypeInfo.
OrtStatus * KernelContext_GetLogger(const OrtKernelContext *context, const OrtLogger **logger)
Get the runtime logger from OrtKernelContext.
OrtStatus * SetGlobalCustomThreadCreationOptions(OrtThreadingOptions *tp_options, void *ort_custom_thread_creation_options)
Set custom thread creation options for global thread pools.
OrtStatus * AddSessionConfigEntry(OrtSessionOptions *options, const char *config_key, const char *config_value)
Set a session configuration entry as a pair of strings.
OrtStatus * SetGlobalDenormalAsZero(OrtThreadingOptions *tp_options)
Set threading flush-to-zero and denormal-as-zero.
void(* ClearBoundInputs)(OrtIoBinding *binding_ptr) __attribute__((nonnull))
Clears any previously set Inputs for an OrtIoBinding.
Definition onnxruntime_c_api.h:2840
const char *(* GetRunConfigEntry)(const OrtRunOptions *options, const char *config_key)
Get a run configuration entry.
Definition onnxruntime_c_api.h:6478
OrtStatus * KernelInfo_GetInputTypeInfo(const OrtKernelInfo *info, size_t index, OrtTypeInfo **type_info)
Get the type information for a OrtKernelInfo's input.
OrtStatus * Graph_GetOnnxIRVersion(const OrtGraph *graph, int64_t *onnx_ir_version)
Returns the ONNX IR version.
OrtStatus * KernelInfoGetAttribute_string(const OrtKernelInfo *info, const char *name, char *out, size_t *size)
Fetch a string stored as an attribute in the graph node.
OrtStatus * Graph_GetName(const OrtGraph *graph, const char **graph_name)
Returns a graph's name.
OrtStatus * GetSparseTensorIndicesTypeShape(const OrtValue *ort_value, enum OrtSparseIndicesFormat indices_format, OrtTensorTypeAndShapeInfo **out)
Returns data type, shape for the type of indices specified by indices_format.
OrtStatus * SessionOptionsAppendExecutionProvider_MIGraphX(OrtSessionOptions *options, const OrtMIGraphXProviderOptions *migraphx_options)
Append MIGraphX provider to session options.
OrtStatus * RunOptionsSetRunLogVerbosityLevel(OrtRunOptions *options, int log_verbosity_level)
Set per-run log verbosity level.
OrtStatus * AddInitializer(OrtSessionOptions *options, const char *name, const OrtValue *val)
Add a pre-allocated initializer to a session.
OrtStatus * CreateEnv(OrtLoggingLevel log_severity_level, const char *logid, OrtEnv **out)
Create an OrtEnv.
OrtStatus * UseCooIndices(OrtValue *ort_value, int64_t *indices_data, size_t indices_num)
OrtStatus * GetTensorMutableData(OrtValue *value, void **out)
Get a pointer to the raw data inside a tensor.
OrtStatus * CreateExternalInitializerInfo(const char *filepath, int64_t file_offset, size_t byte_size, OrtExternalInitializerInfo **out)
Creates an OrtExternalInitializerInfo instance.
OrtStatus * KernelInfoGetAllocator(const OrtKernelInfo *info, OrtMemType mem_type, OrtAllocator **out)
Get allocator from KernelInfo for a specific memory type. Please use C API ReleaseAllocator to releas...
OrtStatus * SessionOptionsAppendExecutionProvider_OpenVINO(OrtSessionOptions *options, const OrtOpenVINOProviderOptions *provider_options)
Append OpenVINO execution provider to the session options.
OrtStatus * IsSparseTensor(const OrtValue *value, int *out)
Sets *out to 1 iff an OrtValue is a SparseTensor, and 0 otherwise.
OrtStatus * SessionOptionsAppendExecutionProvider_V2(OrtSessionOptions *session_options, OrtEnv *env, const OrtEpDevice *const *ep_devices, size_t num_ep_devices, const char *const *ep_option_keys, const char *const *ep_option_vals, size_t num_ep_options)
Append the execution provider that is responsible for the selected OrtEpDevice instances to the sessi...
void(* GetKeyValuePairs)(const OrtKeyValuePairs *kvps, const char *const **keys, const char *const **values, size_t *num_entries)
Get all the key-value pairs from the OrtKeyValuePairs instance.
Definition onnxruntime_c_api.h:5401
OrtStatus * GetTensorElementType(const OrtTensorTypeAndShapeInfo *info, enum ONNXTensorElementDataType *out)
Get element type in OrtTensorTypeAndShapeInfo.
OrtStatus * SessionOptionsSetEpSelectionPolicyDelegate(OrtSessionOptions *session_options, EpSelectionDelegate delegate, void *delegate_state)
Set the execution provider selection policy delegate for the session.
OrtStatus * CreateSparseTensorAsOrtValue(OrtAllocator *allocator, const int64_t *dense_shape, size_t dense_shape_len, ONNXTensorElementDataType type, OrtValue **out)
Create an OrtValue with a sparse tensor that is empty.
OrtStatus * FillStringTensorElement(OrtValue *value, const char *s, size_t index)
Set a single string in a string tensor.
OrtStatus * CreateTensorWithDataAsOrtValue(const OrtMemoryInfo *info, void *p_data, size_t p_data_len, const int64_t *shape, size_t shape_len, ONNXTensorElementDataType type, OrtValue **out)
Create a tensor backed by a user supplied buffer.
OrtStatus * AddExternalInitializers(OrtSessionOptions *options, const char *const *initializer_names, const OrtValue *const *initializers, size_t num_initializers)
Replace initialized Tensors with external data with the data provided in initializers.
OrtStatus * SessionOptionsSetEpSelectionPolicy(OrtSessionOptions *session_options, OrtExecutionProviderDevicePolicy policy)
Set the execution provider selection policy for the session.
const OrtHardwareDevice *(* EpDevice_Device)(const OrtEpDevice *ep_device)
Get the OrtHardwareDevice instance for the OrtEpDevice.
Definition onnxruntime_c_api.h:5612
OrtStatus * ModelMetadataGetGraphDescription(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char **value)
OrtStatus * UpdateDnnlProviderOptions(OrtDnnlProviderOptions *dnnl_options, const char *const *provider_options_keys, const char *const *provider_options_values, size_t num_keys)
Set options in a oneDNN Execution Provider.
OrtStatus * GetStringTensorElementLength(const OrtValue *value, size_t index, size_t *out)
Get the length of a single string in a string tensor.
uint32_t(* MemoryInfoGetVendorId)(const OrtMemoryInfo *ptr)
Get the vendor id from OrtMemoryInfo.
Definition onnxruntime_c_api.h:5692
OrtStatus * Node_GetNumOutputs(const OrtNode *node, size_t *num_outputs)
Returns the number of node outputs.
void(* MemoryInfoGetDeviceType)(const OrtMemoryInfo *ptr, OrtMemoryInfoDeviceType *out)
Definition onnxruntime_c_api.h:4267
OrtStatus * AddRunConfigEntry(OrtRunOptions *options, const char *config_key, const char *config_value)
Set a single run configuration entry as a pair of strings.
OrtStatus * GetBoundOutputValues(const OrtIoBinding *binding_ptr, OrtAllocator *allocator, OrtValue ***output, size_t *output_count)
Get the output OrtValue objects from an OrtIoBinding.
OrtStatus * ModelMetadataGetDomain(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char **value)
Get domain from an OrtModelMetadata.
OrtStatus * SetLanguageProjection(const OrtEnv *ort_env, OrtLanguageProjection projection)
Set language projection.
OrtStatus * GetSessionOptionsConfigEntries(const OrtSessionOptions *options, OrtKeyValuePairs **out)
Get Session configuration entries.
OrtStatus * FillStringTensor(OrtValue *value, const char *const *s, size_t s_len)
Set all strings at once in a string tensor.
OrtStatus * Node_GetInputs(const OrtNode *node, const OrtValueInfo **inputs, size_t num_inputs)
Returns the node's inputs as OrtValueInfo instances.
OrtStatus * SetSessionLogId(OrtSessionOptions *options, const char *logid)
Set session log id.
OrtStatus * GetValueInfoTypeInfo(const OrtValueInfo *value_info, const OrtTypeInfo **type_info)
Get the type information from an OrtValueInfo instance.
OrtStatus * SessionOptionsAppendExecutionProvider_CUDA(OrtSessionOptions *options, const OrtCUDAProviderOptions *cuda_options)
Append CUDA provider to session options.
OrtStatus * SessionGetMemoryInfoForOutputs(const OrtSession *session, const OrtMemoryInfo **outputs_memory_info, size_t num_outputs)
Get the OrtMemoryInfo for each output of the session.
OrtStatus * RegisterAllocator(OrtEnv *env, OrtAllocator *allocator)
Register a custom allocator.
OrtStatus * SetGlobalSpinControl(OrtThreadingOptions *tp_options, int allow_spinning)
Set global spin control options.
OrtStatus * MemoryInfoGetId(const OrtMemoryInfo *ptr, int *out)
Get the device id from OrtMemoryInfo.
const OrtMemoryInfo *(* EpDevice_MemoryInfo)(const OrtEpDevice *ep_device, OrtDeviceMemoryType memory_type)
Get the OrtMemoryInfo for the device.
Definition onnxruntime_c_api.h:6492
OrtStatus * KernelInfo_GetOutputName(const OrtKernelInfo *info, size_t index, char *out, size_t *size)
Get the name of a OrtKernelInfo's output.
OrtStatus * Node_GetAttributes(const OrtNode *node, const OrtOpAttr **attributes, size_t num_attributes)
Returns a node's attributes as OrtOpAttr instances.
OrtStatus * Logger_LogMessage(const OrtLogger *logger, OrtLoggingLevel log_severity_level, const char *message, const char *file_path, int line_number, const char *func_name)
Logs a message at the given severity level using the provided OrtLogger.
OrtStatus * Graph_GetInputs(const OrtGraph *graph, const OrtValueInfo **inputs, size_t num_inputs)
Returns the graph's inputs as OrtValueInfo instances.
OrtStatus * CreateEnvWithCustomLogger(OrtLoggingFunction logging_function, void *logger_param, OrtLoggingLevel log_severity_level, const char *logid, OrtEnv **out)
Create an OrtEnv.
OrtStatus * UpdateCUDAProviderOptionsWithValue(OrtCUDAProviderOptionsV2 *cuda_options, const char *key, void *value)
OrtStatus * MemoryInfoGetName(const OrtMemoryInfo *ptr, const char **out)
Get name from OrtMemoryInfo.
OrtStatus * Logger_GetLoggingSeverityLevel(const OrtLogger *logger, OrtLoggingLevel *out)
Get the logging severity level of the OrtLogger.
OrtStatus * GetExecutionProviderApi(const char *provider_name, uint32_t version, const void **provider_api)
Get a pointer to the requested version of the Execution Provider specific API extensions to the OrtAp...
OrtStatus * KernelContext_GetOutputCount(const OrtKernelContext *context, size_t *out)
Used for custom operators, get the output count of a kernel.
void(* RunOptionsSetSyncStream)(OrtRunOptions *options, OrtSyncStream *sync_stream)
Sets OrtSyncStream for the run options.
Definition onnxruntime_c_api.h:7197
OrtStatus * GetTensorShapeElementCount(const OrtTensorTypeAndShapeInfo *info, size_t *out)
Get total number of elements in a tensor shape from an OrtTensorTypeAndShapeInfo.
OrtStatus * GetModelCompatibilityForEpDevices(const OrtEpDevice *const *ep_devices, size_t num_ep_devices, const char *compatibility_info, OrtCompiledModelCompatibility *out_status)
Validate a compiled model's compatibility information for one or more EP devices.
OrtStatus * CastTypeInfoToTensorInfo(const OrtTypeInfo *type_info, const OrtTensorTypeAndShapeInfo **out)
Get OrtTensorTypeAndShapeInfo from an OrtTypeInfo.
OrtStatus * GetOptionalContainedTypeInfo(const OrtOptionalTypeInfo *optional_type_info, OrtTypeInfo **out)
Get OrtTypeInfo for the allowed contained type from an OrtOptionalTypeInfo.
OrtStatus * CreateOp(const OrtKernelInfo *info, const char *op_name, const char *domain, int version, const char **type_constraint_names, const ONNXTensorElementDataType *type_constraint_values, int type_constraint_count, const OrtOpAttr *const *attr_values, int attr_count, int input_count, int output_count, OrtOp **ort_op)
: Create onnxruntime native operator
OrtStatus * MemoryInfoGetType(const OrtMemoryInfo *ptr, OrtAllocatorType *out)
Get the OrtAllocatorType from OrtMemoryInfo.
OrtStatus * HasValue(const OrtValue *value, int *out)
Sets out to 1 iff an optional type OrtValue has an element, 0 otherwise (OrtValue is None) Use this A...
OrtStatus * CreateEnvWithGlobalThreadPools(OrtLoggingLevel log_severity_level, const char *logid, const OrtThreadingOptions *tp_options, OrtEnv **out)
Create an OrtEnv.
OrtStatus * ValueInfo_GetValueNumConsumers(const OrtValueInfo *value_info, size_t *num_consumers)
Get the number of consumers of a value as a node input.
OrtStatus * KernelContext_GetAllocator(const OrtKernelContext *context, const OrtMemoryInfo *mem_info, OrtAllocator **out)
Get Allocator from KernelContext for a specific memoryInfo. Please use C API ReleaseAllocator to rele...
OrtStatus * KernelInfoGetConstantInput_tensor(const OrtKernelInfo *info, size_t index, int *is_constant, const OrtValue **out)
Get a OrtValue tensor stored as a constant initializer in the graph node.
OrtStatus * GetCUDAProviderOptionsAsString(const OrtCUDAProviderOptionsV2 *cuda_options, OrtAllocator *allocator, char **ptr)
OrtStatus * ValueInfo_IsConstantInitializer(const OrtValueInfo *value_info, bool *is_constant_initializer)
Returns a boolean indicating if the given value is a constant initializer.
OrtStatus * UpdateCUDAProviderOptions(OrtCUDAProviderOptionsV2 *cuda_options, const char *const *provider_options_keys, const char *const *provider_options_values, size_t num_keys)
Set options in a CUDA Execution Provider.
OrtStatus * CopyKernelInfo(const OrtKernelInfo *info, OrtKernelInfo **info_copy)
OrtStatus * Graph_GetModelMetadata(const OrtGraph *graph, OrtModelMetadata **out)
Get OrtModelMetadata from an OrtGraph.
OrtStatus * GetTensorRTProviderOptionsAsString(const OrtTensorRTProviderOptionsV2 *tensorrt_options, OrtAllocator *allocator, char **ptr)
Get serialized TensorRT provider options string.
int64_t(* ExternalInitializerInfo_GetFileOffset)(const OrtExternalInitializerInfo *info)
Get the byte offset within the file where the initializer's data is stored.
Definition onnxruntime_c_api.h:6447
OrtStatus * SessionOptionsSetCustomThreadCreationOptions(OrtSessionOptions *options, void *ort_custom_thread_creation_options)
Set creation options for custom thread.
OrtStatus * GetDimensionsCount(const OrtTensorTypeAndShapeInfo *info, size_t *out)
Get dimension count in OrtTensorTypeAndShapeInfo.
OrtStatus * KernelInfo_GetConfigEntries(const OrtKernelInfo *info, OrtKeyValuePairs **out)
Get all config entries from OrtKernelInfo.
OrtStatus * Session_GetEpGraphAssignmentInfo(const OrtSession *session, const OrtEpAssignedSubgraph *const **ep_subgraphs, size_t *num_ep_subgraphs)
Get information about the subgraphs assigned to each execution provider (EP) and the nodes within.
void(* ReleaseROCMProviderOptions)(OrtROCMProviderOptions *input)
Release an OrtROCMProviderOptions.
Definition onnxruntime_c_api.h:4846
OrtStatus * UpdateROCMProviderOptions(OrtROCMProviderOptions *rocm_options, const char *const *provider_options_keys, const char *const *provider_options_values, size_t num_keys)
Set options in a ROCm Execution Provider.
OrtStatus * KernelInfo_GetInputName(const OrtKernelInfo *info, size_t index, char *out, size_t *size)
Get the name of a OrtKernelInfo's input.
OrtStatus * KernelContext_GetResource(const OrtKernelContext *context, int resource_version, int resource_id, void **resource)
OrtStatus * RegisterCustomOpsLibrary(OrtSessionOptions *options, const char *library_path, void **library_handle)
OrtStatus * Node_GetNumAttributes(const OrtNode *node, size_t *num_attributes)
Returns the number of node attributes.
OrtStatus * SetCurrentGpuDeviceId(int device_id)
Set current GPU device ID.
OrtStatus * Node_GetNumInputs(const OrtNode *node, size_t *num_inputs)
Returns the number of node inputs.
OrtStatus * GetOnnxTypeFromTypeInfo(const OrtTypeInfo *type_info, enum ONNXType *out)
Get ONNXType from OrtTypeInfo.
OrtStatus * CreateMemoryInfo_V2(const char *name, enum OrtMemoryInfoDeviceType device_type, uint32_t vendor_id, int32_t device_id, enum OrtDeviceMemoryType mem_type, size_t alignment, enum OrtAllocatorType allocator_type, OrtMemoryInfo **out)
Create an OrtMemoryInfo.
OrtStatus * GetEpDevices(const OrtEnv *env, const OrtEpDevice *const **ep_devices, size_t *num_ep_devices)
Get the list of available OrtEpDevice instances.
OrtStatus * CreateLoraAdapterFromArray(const void *bytes, size_t num_bytes, OrtAllocator *allocator, OrtLoraAdapter **out)
Create an OrtLoraAdapter.
OrtStatus * DeviceEpIncompatibilityDetails_GetErrorCode(const OrtDeviceEpIncompatibilityDetails *details, int32_t *error_code)
Get the execution provider error code from OrtDeviceEpIncompatibilityDetails.
const OrtInteropApi *(* GetInteropApi)(void)
Get the EP Interop API instance.
Definition onnxruntime_c_api.h:6862
OrtStatus * GetDenotationFromTypeInfo(const OrtTypeInfo *type_info, const char **const denotation, size_t *len)
Get denotation from type information.
OrtStatus * KernelContext_ParallelFor(const OrtKernelContext *context, void(*fn)(void *, size_t), size_t total, size_t num_batch, void *usr_data)
void(* ReleaseCANNProviderOptions)(OrtCANNProviderOptions *input)
Release an OrtCANNProviderOptions.
Definition onnxruntime_c_api.h:4261
OrtStatus * SetGlobalInterOpNumThreads(OrtThreadingOptions *tp_options, int inter_op_num_threads)
Set global inter-op thread count.
OrtStatus * CloneSessionOptions(const OrtSessionOptions *in_options, OrtSessionOptions **out_options)
Create a copy of an existing OrtSessionOptions.
OrtStatus * GetSessionConfigEntry(const OrtSessionOptions *options, const char *config_key, char *config_value, size_t *size)
Get a session configuration value.
OrtStatus * SessionOptionsAppendExecutionProvider_TensorRT_V2(OrtSessionOptions *options, const OrtTensorRTProviderOptionsV2 *tensorrt_options)
Append TensorRT execution provider to the session options.
OrtStatus * AddFreeDimensionOverride(OrtSessionOptions *options, const char *dim_denotation, int64_t dim_value)
Override session symbolic dimensions.
OrtStatus * KernelContext_GetOutput(OrtKernelContext *context, size_t index, const int64_t *dim_values, size_t dim_count, OrtValue **out)
Used for custom operators, get an output of a kernel.
OrtStatus * ValueInfo_GetInitializerValue(const OrtValueInfo *value_info, const OrtValue **initializer_value)
Get the underlying initializer value, as an OrtValue, from the given OrtValueInfo.
OrtStatus * EnableTelemetryEvents(const OrtEnv *env)
Enable Telemetry.
OrtStatus * OpAttr_GetTensorAttributeAsOrtValue(const OrtOpAttr *attribute, OrtValue **attr_tensor)
Get the OrtNode's 'TENSOR' attribute as an OrtValue.
OrtStatus * EpAssignedNode_GetDomain(const OrtEpAssignedNode *ep_node, const char **out)
Get the domain of the node assigned to an execution provider.
OrtStatus * OpAttr_GetType(const OrtOpAttr *attribute, OrtOpAttrType *type)
Get the attribute type as OrtOpAttrType from an OrtOpAttr.
OrtStatus * CreateMemoryInfo(const char *name, enum OrtAllocatorType type, int id, enum OrtMemType mem_type, OrtMemoryInfo **out)
Create an OrtMemoryInfo.
OrtStatus * SessionOptionsAppendExecutionProvider_ROCM(OrtSessionOptions *options, const OrtROCMProviderOptions *rocm_options)
Append ROCM execution provider to the session options.
OrtStatus * SessionGetInputTypeInfo(const OrtSession *session, size_t index, OrtTypeInfo **type_info)
Get input type information.
OrtStatus * GetSymbolicDimensions(const OrtTensorTypeAndShapeInfo *info, const char *dim_params[], size_t dim_params_length)
Get symbolic dimension names in OrtTensorTypeAndShapeInfo.
OrtStatus * SessionOptionsAppendExecutionProvider_OpenVINO_V2(OrtSessionOptions *options, const char *const *provider_options_keys, const char *const *provider_options_values, size_t num_keys)
Append OpenVINO execution provider to the session options.
OrtStatus * GetStringTensorDataLength(const OrtValue *value, size_t *len)
Get total byte length for all strings in a string tensor.
OrtStatus * KernelContext_GetInputCount(const OrtKernelContext *context, size_t *out)
Used for custom operators, get the input count of a kernel.
OrtStatus * BindOutputToDevice(OrtIoBinding *binding_ptr, const char *name, const OrtMemoryInfo *mem_info_ptr)
Bind an OrtIoBinding output to a device.
OrtStatus * SessionGetEpDeviceForInputs(const OrtSession *session, const OrtEpDevice **inputs_ep_devices, size_t num_inputs)
Get the OrtEpDevice (if available) for each input of the session.
OrtStatus * SessionOptionsAppendExecutionProvider(OrtSessionOptions *options, const char *provider_name, const char *const *provider_options_keys, const char *const *provider_options_values, size_t num_keys)
: Append execution provider to the session options.
OrtStatus * SetSessionGraphOptimizationLevel(OrtSessionOptions *options, GraphOptimizationLevel graph_optimization_level)
Set the optimization level to apply when loading a graph.
OrtStatus * SessionGetEpDeviceForOutputs(const OrtSession *session, const OrtEpDevice **outputs_ep_devices, size_t num_outputs)
Get the EP device assigned to each session output.
OrtStatus * ModelMetadataGetDescription(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char **value)
Get description from an OrtModelMetadata.
OrtStatus * CreateCANNProviderOptions(OrtCANNProviderOptions **out)
Create an OrtCANNProviderOptions.
OrtStatus * ReadOpAttr(const OrtOpAttr *op_attr, OrtOpAttrType type, void *data, size_t len, size_t *out)
OrtStatus * DisablePerSessionThreads(OrtSessionOptions *options)
Use global thread pool on a session.
OrtStatus * SetDimensions(OrtTensorTypeAndShapeInfo *info, const int64_t *dim_values, size_t dim_count)
Set shape information in OrtTensorTypeAndShapeInfo.
OrtStatus * SetInterOpNumThreads(OrtSessionOptions *options, int inter_op_num_threads)
Sets the number of threads used to parallelize the execution of the graph.
OrtStatus * CustomOpDomain_Add(OrtCustomOpDomain *custom_op_domain, const OrtCustomOp *op)
Add a custom op to a custom op domain.
OrtStatus * GetSequenceElementType(const OrtSequenceTypeInfo *sequence_type_info, OrtTypeInfo **type_info)
Get element type from an OrtSequenceTypeInfo.
OrtStatus * RunOptionsGetRunLogVerbosityLevel(const OrtRunOptions *options, int *log_verbosity_level)
Get per-run log verbosity level.
OrtStatus * FillSparseTensorCsr(OrtValue *ort_value, const OrtMemoryInfo *data_mem_info, const int64_t *values_shape, size_t values_shape_len, const void *values, const int64_t *inner_indices_data, size_t inner_indices_num, const int64_t *outer_indices_data, size_t outer_indices_num)
OrtStatus * CreateAndRegisterAllocator(OrtEnv *env, const OrtMemoryInfo *mem_info, const OrtArenaCfg *arena_cfg)
Create an allocator and register it with the OrtEnv.
OrtStatus * CreateCpuMemoryInfo(enum OrtAllocatorType type, enum OrtMemType mem_type, OrtMemoryInfo **out)
Create an OrtMemoryInfo for CPU memory.
OrtStatus * Node_GetGraph(const OrtNode *node, const OrtGraph **graph)
Get the node's parent OrtGraph instance.
OrtStatus * ValueInfo_GetExternalInitializerInfo(const OrtValueInfo *value_info, OrtExternalInitializerInfo **info)
Get information about an external initializer (e.g., filepath, file offset, byte size).
OrtStatus * AddCustomOpDomain(OrtSessionOptions *options, OrtCustomOpDomain *custom_op_domain)
Add custom op domain to a session options.
OrtStatus * Graph_GetGraphView(const OrtGraph *src_graph, const OrtNode **nodes, size_t num_nodes, OrtGraph **dst_graph)
Returns an OrtGraph that contains a subset of nodes in the source OrtGraph.
OrtStatus * KernelInfo_GetOutputTypeInfo(const OrtKernelInfo *info, size_t index, OrtTypeInfo **type_info)
Get the type information for a OrtKernelInfo's output.
OrtStatus * GetHardwareDevices(const OrtEnv *env, const OrtHardwareDevice **devices, size_t num_devices)
Get the list of available hardware devices.
OrtStatus * KernelContext_GetInput(const OrtKernelContext *context, size_t index, const OrtValue **out)
Used for custom operators, get an input of a kernel.
OrtStatus * CreateEnvWithCustomLoggerAndGlobalThreadPools(OrtLoggingFunction logging_function, void *logger_param, OrtLoggingLevel log_severity_level, const char *logid, const struct OrtThreadingOptions *tp_options, OrtEnv **out)
uint32_t(* HardwareDevice_VendorId)(const OrtHardwareDevice *device)
Get the hardware device's vendor identifier.
Definition onnxruntime_c_api.h:5538
OrtStatus * KernelInfo_GetOperatorType(const OrtKernelInfo *info, char *out, size_t *size)
Get the graph node's operator type from OrtKernelInfo.
OrtStatus * DisableTelemetryEvents(const OrtEnv *env)
Disable Telemetry.
OrtStatus * KernelInfo_GetOutputCount(const OrtKernelInfo *info, size_t *out)
Get the number of outputs from OrtKernelInfo.
OrtStatus * CreateTensorWithDataAndDeleterAsOrtValue(OrtAllocator *deleter, void *p_data, size_t p_data_len, const int64_t *shape, size_t shape_len, ONNXTensorElementDataType type, OrtValue **out)
Create an OrtValue for a Tensor that uses pre-existing memory.
OrtStatus * ShapeInferContext_GetInputCount(const OrtShapeInferContext *context, size_t *out)
OrtStatus * Graph_GetInitializers(const OrtGraph *graph, const OrtValueInfo **initializers, size_t num_initializers)
Returns the graph's initializers as OrtValueInfo instances.
OrtStatus * GetHardwareDeviceEpIncompatibilityDetails(const OrtEnv *env, const char *ep_name, const OrtHardwareDevice *hw, OrtDeviceEpIncompatibilityDetails **details)
Check for known incompatibility issues between hardware device and a specific execution provider.
OrtStatus * ModelMetadataGetGraphName(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char **value)
Get graph name from an OrtModelMetadata.
OrtStatus * CreateROCMProviderOptions(OrtROCMProviderOptions **out)
Create an OrtROCMProviderOptions.
OrtStatus * ModelMetadataLookupCustomMetadataMap(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, const char *key, char **value)
Return data for a key in the custom metadata map in an OrtModelMetadata.
OrtStatus * EpAssignedNode_GetOperatorType(const OrtEpAssignedNode *ep_node, const char **out)
Get the operator type of the node assigned to an execution provider.
OrtStatus * CopyTensors(const OrtEnv *env, const OrtValue *const *src_tensors, OrtValue *const *dst_tensors, OrtSyncStream *stream, size_t num_tensors)
Copy OrtValue instances containing Tensors between devices.
OrtStatus * RegisterExecutionProviderLibrary(OrtEnv *env, const char *registration_name, const char *path)
Register an execution provider library with ORT.
OrtStatus * RunOptionsSetRunLogSeverityLevel(OrtRunOptions *options, int log_severity_level)
Set per-run log severity level.
OrtStatus * GetCUDAProviderOptionsByName(const OrtCUDAProviderOptionsV2 *cuda_options, const char *key, void **ptr)
OrtStatus * SessionOptionsSetLoadCancellationFlag(OrtSessionOptions *options, bool cancel)
sets load cancellation flag to abort session loading process.
OrtStatus * Node_GetDomain(const OrtNode *node, const char **domain_name)
Returns a node's domain name.
OrtStatus * SetSessionExecutionMode(OrtSessionOptions *options, ExecutionMode execution_mode)
Set execution mode.
OrtStatus * SessionGetInputName(const OrtSession *session, size_t index, OrtAllocator *allocator, char **value)
Get input name.
OrtStatus * Graph_GetNumOutputs(const OrtGraph *graph, size_t *num_outputs)
Returns the number of graph outputs.
OrtStatus * ValueInfo_IsOptionalGraphInput(const OrtValueInfo *value_info, bool *is_optional_graph_input)
Returns a boolean indicating if the given value is an optional graph input.
OrtStatus * CreateLoraAdapter(const char *adapter_file_path, OrtAllocator *allocator, OrtLoraAdapter **out)
Create an OrtLoraAdapter.
OrtStatus * GetDnnlProviderOptionsAsString(const OrtDnnlProviderOptions *dnnl_options, OrtAllocator *allocator, char **ptr)
void(* AddKeyValuePair)(OrtKeyValuePairs *kvps, const char *key, const char *value)
Add a key-value pair to the OrtKeyValuePairs instance.
Definition onnxruntime_c_api.h:5379
OrtStatus * CreateRunOptions(OrtRunOptions **out)
Create an OrtRunOptions.
OrtStatus * RunOptionsGetRunTag(const OrtRunOptions *options, const char **run_tag)
Get per-run tag.
size_t(* ExternalInitializerInfo_GetByteSize)(const OrtExternalInitializerInfo *info)
Get the size in bytes of the initializer's data within the file.
Definition onnxruntime_c_api.h:6456
OrtStatus * CreateCustomOpDomain(const char *domain, OrtCustomOpDomain **out)
Create a custom op domain.
OrtStatus * ModelMetadataGetCustomMetadataMapKeys(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char ***keys, int64_t *num_keys)
const char *(* GetErrorMessage)(const OrtStatus *status) __attribute__((nonnull))
Get error string from OrtStatus.
Definition onnxruntime_c_api.h:1170
OrtStatus * IsTensor(const OrtValue *value, int *out)
Return if an OrtValue is a tensor type.
OrtStatus * Graph_GetNumNodes(const OrtGraph *graph, size_t *num_nodes)
Returns the number of graph nodes.
OrtStatus * AllocatorFree(OrtAllocator *ort_allocator, void *p)
Calls OrtAllocator::Free function.
OrtStatus * GetMapValueType(const OrtMapTypeInfo *map_type_info, OrtTypeInfo **type_info)
Get the value type from an OrtMapTypeInfo.
OrtStatus * ValueInfo_GetValueConsumers(const OrtValueInfo *value_info, const OrtNode **nodes, int64_t *input_indices, size_t num_consumers)
Returns information (OrtNode and input index) for all consumer nodes that use the value as an input.
OrtStatus * CreateSessionFromArray(const OrtEnv *env, const void *model_data, size_t model_data_length, const OrtSessionOptions *options, OrtSession **out)
Create an OrtSession from memory.
OrtStatus * CreateArenaCfgV2(const char *const *arena_config_keys, const size_t *arena_config_values, size_t num_keys, OrtArenaCfg **out)
Create an OrtArenaCfg.
OrtStatus * GetAllocatorWithDefaultOptions(OrtAllocator **out)
Get the default allocator.
OrtStatus * CreateSession(const OrtEnv *env, const char *model_path, const OrtSessionOptions *options, OrtSession **out)
Create an OrtSession from a model file.
OrtStatus * SessionOptionsAppendExecutionProvider_Dnnl(OrtSessionOptions *options, const OrtDnnlProviderOptions *dnnl_options)
Append dnnl provider to session options.
OrtStatus * CreateArenaCfg(size_t max_mem, int arena_extend_strategy, int initial_chunk_size_bytes, int max_dead_bytes_per_chunk, OrtArenaCfg **out)
OrtStatus * SessionGetInputCount(const OrtSession *session, size_t *out)
Get input count for a session.
const char *(* GetKeyValue)(const OrtKeyValuePairs *kvps, const char *key)
Get the value associated with a key in the OrtKeyValuePairs instance.
Definition onnxruntime_c_api.h:5390
OrtStatus * EpAssignedSubgraph_GetEpName(const OrtEpAssignedSubgraph *ep_subgraph, const char **out)
Get the name of the execution provider to which the subgraph was assigned.
OrtStatus * GetValue(const OrtValue *value, int index, OrtAllocator *allocator, OrtValue **out)
Get non tensor data from an OrtValue.
OrtStatus * ShapeInferContext_GetAttribute(const OrtShapeInferContext *context, const char *attr_name, const OrtOpAttr **attr)
OrtStatus * GetSparseTensorIndices(const OrtValue *ort_value, enum OrtSparseIndicesFormat indices_format, size_t *num_indices, const void **indices)
Returns indices data for the type of the indices specified by indices_format.
const char *(* EpDevice_EpName)(const OrtEpDevice *ep_device)
Get the execution provider name.
Definition onnxruntime_c_api.h:5576
OrtStatus * EnableProfiling(OrtSessionOptions *options, const char *profile_file_prefix)
Enable profiling for a session.
OrtStatus * Node_GetName(const OrtNode *node, const char **node_name)
Returns a node's name. Can be an empty string.
uint32_t(* HardwareDevice_DeviceId)(const OrtHardwareDevice *device)
Get the hardware device's unique identifier.
Definition onnxruntime_c_api.h:5557
OrtStatus * Node_GetId(const OrtNode *node, size_t *node_id)
Returns a node's identifier.
OrtStatus * SetUserLoggingFunction(OrtSessionOptions *options, OrtLoggingFunction user_logging_function, void *user_logging_param)
Set user logging function.
OrtStatus * GetStringTensorElement(const OrtValue *value, size_t s_len, size_t index, void *s)
Get a single string from a string tensor.
OrtStatus * Graph_GetNumOperatorSets(const OrtGraph *graph, size_t *num_operator_sets)
Returns the number of operator sets that the graph's model uses.
OrtStatus * GetTensorTypeAndShape(const OrtValue *value, OrtTensorTypeAndShapeInfo **out)
Get type and shape information from a tensor OrtValue.
OrtStatus * BindInput(OrtIoBinding *binding_ptr, const char *name, const OrtValue *val_ptr)
Bind an OrtValue to an OrtIoBinding input.
const OrtKeyValuePairs *(* EpDevice_EpMetadata)(const OrtEpDevice *ep_device)
Get the metadata for the OrtEpDevice.
Definition onnxruntime_c_api.h:5594
OrtStatus * CreateEnvWithOptions(const OrtEnvCreationOptions *options, OrtEnv **out)
Create an OrtEnv instance with the given options.
OrtStatus * GetResizedStringTensorElementBuffer(OrtValue *value, size_t index, size_t length_in_bytes, char **buffer)
Set a single string in a string tensor Do not zero terminate the string data.
OrtStatus * DisableCpuMemArena(OrtSessionOptions *options)
Disable the memory arena on CPU.
OrtDeviceMemoryType(* MemoryInfoGetDeviceMemType)(const OrtMemoryInfo *ptr)
Get the device memory type from OrtMemoryInfo.
Definition onnxruntime_c_api.h:5683
void(* ClearBoundOutputs)(OrtIoBinding *binding_ptr) __attribute__((nonnull))
Clears any previously set Outputs for an OrtIoBinding.
Definition onnxruntime_c_api.h:2844
OrtStatus * KernelInfo_GetOperatorDomain(const OrtKernelInfo *info, char *out, size_t *size)
Get the graph node's operator domain from OrtKernelInfo.
OrtStatus * SetSymbolicDimensions(OrtTensorTypeAndShapeInfo *info, const char *dim_params[], size_t dim_params_length)
OrtStatus * SessionOptionsAppendExecutionProvider_CANN(OrtSessionOptions *options, const OrtCANNProviderOptions *cann_options)
Append CANN provider to session options.
OrtStatus * MemoryInfoGetMemType(const OrtMemoryInfo *ptr, OrtMemType *out)
Get the OrtMemType from OrtMemoryInfo.
OrtStatus * AllocatorGetInfo(const OrtAllocator *ort_allocator, const struct OrtMemoryInfo **out)
Calls OrtAllocator::Info function.
OrtStatus * CreateSharedAllocator(OrtEnv *env, const OrtEpDevice *ep_device, OrtDeviceMemoryType mem_type, OrtAllocatorType allocator_type, const OrtKeyValuePairs *allocator_options, OrtAllocator **allocator)
Create/replace a shared allocator for the OrtEpDevice in the OrtEnv.
OrtStatus * CompareMemoryInfo(const OrtMemoryInfo *info1, const OrtMemoryInfo *info2, int *out)
Compare OrtMemoryInfo objects for equality.
OrtStatus * GetAvailableProviders(char ***out_ptr, int *provider_length)
Get the names of all available providers.
OrtStatus * SynchronizeBoundInputs(OrtIoBinding *binding_ptr)
Synchronize bound inputs. The call may be necessary for some providers, such as cuda,...
OrtStatus * GetOpaqueValue(const char *domain_name, const char *type_name, const OrtValue *in, void *data_container, size_t data_container_size)
Get internal data from an opaque (custom user defined type) OrtValue.
OrtStatus * AllocatorAlloc(OrtAllocator *ort_allocator, size_t size, void **out)
Calls OrtAllocator::Alloc function.
OrtStatus * RunAsync(OrtSession *session, const OrtRunOptions *run_options, const char *const *input_names, const OrtValue *const *input, size_t input_len, const char *const *output_names, size_t output_names_len, OrtValue **output, RunAsyncCallbackFn run_async_callback, void *user_data)
Run the model asynchronously in a thread owned by intra op thread pool.
OrtStatus * GetTensorRTProviderOptionsByName(const OrtTensorRTProviderOptionsV2 *tensorrt_options, const char *key, void **ptr)
OrtStatus * RegisterCustomOpsLibrary_V2(OrtSessionOptions *options, const char *library_name)
Register custom ops from a shared library.
OrtStatus * SessionGetOverridableInitializerName(const OrtSession *session, size_t index, OrtAllocator *allocator, char **value)
Get overridable initializer name.
OrtStatus * GetROCMProviderOptionsAsString(const OrtROCMProviderOptions *rocm_options, OrtAllocator *allocator, char **ptr)
OrtStatus * UnregisterAllocator(OrtEnv *env, const OrtMemoryInfo *mem_info)
Unregister a custom allocator.
OrtStatus * Graph_GetParentNode(const OrtGraph *graph, const OrtNode **node)
Get the parent node for the given graph, if any exists.
OrtStatus * DisableMemPattern(OrtSessionOptions *options)
Disable the memory pattern optimization.
OrtStatus * UseBlockSparseIndices(OrtValue *ort_value, const int64_t *indices_shape, size_t indices_shape_len, int32_t *indices_data)
OrtStatus * SetEpDynamicOptions(OrtSession *sess, const char *const *keys, const char *const *values, size_t kv_len)
Set DynamicOptions for EPs (Execution Providers)
void(* CreateKeyValuePairs)(OrtKeyValuePairs **out)
Create an OrtKeyValuePairs instance.
Definition onnxruntime_c_api.h:5364
OrtStatus *(* CreateStatus)(OrtErrorCode code, const char *msg) __attribute__((nonnull))
Create an OrtStatus from a null terminated string.
Definition onnxruntime_c_api.h:1156
OrtStatus * RunWithBinding(OrtSession *session, const OrtRunOptions *run_options, const OrtIoBinding *binding_ptr)
Run a model using Io Bindings for the inputs & outputs.
OrtStatus * CreateDnnlProviderOptions(OrtDnnlProviderOptions **out)
Create an OrtDnnlProviderOptions.
OrtStatus * GetMapKeyType(const OrtMapTypeInfo *map_type_info, enum ONNXTensorElementDataType *out)
Get key type from an OrtMapTypeInfo.
OrtStatus * DeviceEpIncompatibilityDetails_GetReasonsBitmask(const OrtDeviceEpIncompatibilityDetails *details, uint32_t *reasons_bitmask)
Get the incompatibility reasons bitmask from OrtDeviceEpIncompatibilityDetails.
OrtStatus * RunOptionsGetRunLogSeverityLevel(const OrtRunOptions *options, int *log_severity_level)
Get per-run log severity level.
OrtStatus * CastTypeInfoToOptionalTypeInfo(const OrtTypeInfo *type_info, const OrtOptionalTypeInfo **out)
Get Optional Type information from an OrtTypeInfo.
const OrtCompileApi *(* GetCompileApi)(void)
Get the Compile API instance.
Definition onnxruntime_c_api.h:5350
OrtStatus * SessionGetModelMetadata(const OrtSession *session, OrtModelMetadata **out)
Get OrtModelMetadata from an OrtSession.
OrtStatus * Node_GetSinceVersion(const OrtNode *node, int *since_version)
Get the opset version in which the given node's operator type was first defined.
OrtStatus * Node_GetNumSubgraphs(const OrtNode *node, size_t *num_subgraphs)
Returns the number of subgraphs contained by the given node.
OrtStatus * GetCurrentGpuDeviceId(int *device_id)
Get current GPU device ID.
OrtStatus * SessionGetOutputTypeInfo(const OrtSession *session, size_t index, OrtTypeInfo **type_info)
Get output type information.
OrtStatus * KernelContext_GetScratchBuffer(const OrtKernelContext *context, const OrtMemoryInfo *mem_info, size_t count_or_bytes, void **out)
Get scratch buffer from the corresponding allocator under the specific OrtMemoryInfo object....
OrtStatus * Graph_GetOutputs(const OrtGraph *graph, const OrtValueInfo **outputs, size_t num_outputs)
Returns the graph's outputs as OrtValueInfo instances.
OrtStatus * EnableOrtCustomOps(OrtSessionOptions *options)
Enable custom operators.
OrtStatus * UpdateEnvWithCustomLogLevel(OrtEnv *ort_env, OrtLoggingLevel log_severity_level)
OrtStatus * Node_GetEpName(const OrtNode *node, const char **out)
Returns the execution provider name that this node is assigned to run on. Returns NULL if the node ha...
OrtStatus * SessionGetMemoryInfoForInputs(const OrtSession *session, const OrtMemoryInfo **inputs_memory_info, size_t num_inputs)
Get the OrtMemoryInfo for each input of the session.
OrtStatus * ReleaseSharedAllocator(OrtEnv *env, const OrtEpDevice *ep_device, OrtDeviceMemoryType mem_type)
Release a shared allocator from the OrtEnv for the OrtEpDevice and memory type.
OrtStatus * CreateValue(const OrtValue *const *in, size_t num_values, enum ONNXType value_type, OrtValue **out)
Create a map or sequence OrtValue.
OrtStatus * SessionOptionsAppendExecutionProvider_VitisAI(OrtSessionOptions *options, const char *const *provider_options_keys, const char *const *provider_options_values, size_t num_keys)
Append VitisAI provider to session options.
OrtStatus * RegisterCustomOpsUsingFunction(OrtSessionOptions *options, const char *registration_func_name)
Register custom ops by calling a RegisterCustomOpsFn function.
OrtStatus * RunOptionsSetTerminate(OrtRunOptions *options)
Set terminate flag.
OrtStatus * SetSessionLogVerbosityLevel(OrtSessionOptions *options, int session_log_verbosity_level)
Set session log verbosity level.
OrtStatus * SetSessionLogSeverityLevel(OrtSessionOptions *options, int session_log_severity_level)
Set session log severity level.
bool(* TensorTypeAndShape_HasShape)(const OrtTensorTypeAndShapeInfo *info)
Fetch whether the tensor has shape information.
Definition onnxruntime_c_api.h:6774
OrtStatus * GetNumHardwareDevices(const OrtEnv *env, size_t *num_devices)
Get the number of available hardware devices.
OrtStatus * CreateThreadingOptions(OrtThreadingOptions **out)
Create an OrtThreadingOptions.
OrtStatus * UseCsrIndices(OrtValue *ort_value, int64_t *inner_data, size_t inner_num, int64_t *outer_data, size_t outer_num)
OrtStatus * Graph_GetModelPath(const OrtGraph *graph, const char **model_path)
Get the filepath to the model from which an OrtGraph is constructed.
OrtStatus * KernelInfo_GetOperatorSinceVersion(const OrtKernelInfo *info, int *since_version)
Get the opset version in which the given node's operator type was first defined from OrtKernelInfo.
OrtStatus * SessionGetOverridableInitializerCount(const OrtSession *session, size_t *out)
Get overridable initializer count.
OrtStatus * GetValueInfoName(const OrtValueInfo *value_info, const char **name)
Get the value name from an OrtValueInfo instance.
OrtStatus * UnregisterExecutionProviderLibrary(OrtEnv *env, const char *registration_name)
Unregister an execution provider library with ORT.
OrtStatus * CreateSessionWithPrepackedWeightsContainer(const OrtEnv *env, const char *model_path, const OrtSessionOptions *options, OrtPrepackedWeightsContainer *prepacked_weights_container, OrtSession **out)
Create session with prepacked weights container.
OrtStatus * KernelInfo_GetLogger(const OrtKernelInfo *info, const OrtLogger **logger)
Get the session logger from OrtKernelInfo.
OrtStatus * UpdateTensorRTProviderOptions(OrtTensorRTProviderOptionsV2 *tensorrt_options, const char *const *provider_options_keys, const char *const *provider_options_values, size_t num_keys)
Set options in a TensorRT Execution Provider.
OrtStatus * KernelInfoGetAttribute_tensor(const OrtKernelInfo *info, const char *name, OrtAllocator *allocator, OrtValue **out)
Get a OrtValue tensor stored as an attribute in the graph node.
OrtStatus * EnableMemPattern(OrtSessionOptions *options)
Enable the memory pattern optimization.
OrtStatus * SetOptimizedModelFilePath(OrtSessionOptions *options, const char *optimized_model_filepath)
Set filepath to save optimized model after graph level transformations.
const OrtKeyValuePairs *(* EpDevice_EpOptions)(const OrtEpDevice *ep_device)
Get the execution provider options for the OrtEpDevice.
Definition onnxruntime_c_api.h:5603
OrtStatus * CreateAllocator(const OrtSession *session, const OrtMemoryInfo *mem_info, OrtAllocator **out)
Create an allocator for an OrtSession following an OrtMemoryInfo.
OrtStatus * SynchronizeBoundOutputs(OrtIoBinding *binding_ptr)
Synchronize bound outputs. The call may be necessary for some providers, such as cuda,...
OrtStatus * SessionGetOutputCount(const OrtSession *session, size_t *out)
Get output count for a session.
OrtStatus * EpAssignedNode_GetName(const OrtEpAssignedNode *ep_node, const char **out)
Get the name of the node assigned to an execution provider.
OrtStatus * CastTypeInfoToSequenceTypeInfo(const OrtTypeInfo *type_info, const OrtSequenceTypeInfo **out)
Cast OrtTypeInfo to an OrtSequenceTypeInfo.
OrtStatus * Run(OrtSession *session, const OrtRunOptions *run_options, const char *const *input_names, const OrtValue *const *inputs, size_t input_len, const char *const *output_names, size_t output_names_len, OrtValue **outputs)
Run the model in an OrtSession.
OrtStatus * ValueInfo_IsGraphOutput(const OrtValueInfo *value_info, bool *is_graph_output)
Returns a boolean indicating if the given value is a graph output.
OrtStatus * GetValueType(const OrtValue *value, enum ONNXType *out)
Get ONNXType of an OrtValue.
OrtStatus * Node_GetImplicitInputs(const OrtNode *node, const OrtValueInfo **implicit_inputs, size_t num_implicit_inputs)
Get the implicit inputs, as OrtValueInfo instances, that are used within the given node's subgraphs.
OrtStatus * Node_GetNumImplicitInputs(const OrtNode *node, size_t *num_implicit_inputs)
Returns the number of node implicit inputs.
OrtStatus * ShapeInferContext_GetInputTypeShape(const OrtShapeInferContext *context, size_t index, OrtTensorTypeAndShapeInfo **info)
OrtStatus * EpAssignedSubgraph_GetNodes(const OrtEpAssignedSubgraph *ep_subgraph, const OrtEpAssignedNode *const **ep_nodes, size_t *num_ep_nodes)
Get the nodes in a subgraph assigned to a specific execution provider.
OrtStatus * CreateSyncStreamForEpDevice(const OrtEpDevice *ep_device, const OrtKeyValuePairs *stream_options, OrtSyncStream **stream)
Create an OrtSyncStream for the given OrtEpDevice.
OrtStatus * KernelInfo_GetNodeName(const OrtKernelInfo *info, char *out, size_t *size)
Get the graph node name from OrtKernelInfo.
OrtStatus * CreateTensorRTProviderOptions(OrtTensorRTProviderOptionsV2 **out)
Create an OrtTensorRTProviderOptionsV2.
OrtStatus * GetDimensions(const OrtTensorTypeAndShapeInfo *info, int64_t *dim_values, size_t dim_values_length)
Get dimensions in OrtTensorTypeAndShapeInfo.
OrtStatus * SessionGetProfilingStartTimeNs(const OrtSession *session, uint64_t *out)
Return the time that profiling was started.
OrtStatus * RunOptionsUnsetTerminate(OrtRunOptions *options)
Clears the terminate flag.
OrtStatus * CreateOpaqueValue(const char *domain_name, const char *type_name, const void *data_container, size_t data_container_size, OrtValue **out)
Create an opaque (custom user defined type) OrtValue.
OrtStatus * GetSparseTensorValuesTypeAndShape(const OrtValue *ort_value, OrtTensorTypeAndShapeInfo **out)
Returns data type and shape of sparse tensor values (nnz) iff OrtValue contains a SparseTensor.
void(* ReleaseTensorRTProviderOptions)(OrtTensorRTProviderOptionsV2 *input)
Release an OrtTensorRTProviderOptionsV2.
Definition onnxruntime_c_api.h:3401
OrtStatus * Graph_GetNodes(const OrtGraph *graph, const OrtNode **nodes, size_t num_nodes)
Returns the graph's nodes as OrtNode instances.
OrtStatus * ReleaseAvailableProviders(char **ptr, int providers_length)
Release data from OrtApi::GetAvailableProviders. This API will never fail so you can rely on it in a ...
const char *(* ExternalInitializerInfo_GetFilePath)(const OrtExternalInitializerInfo *info)
Get the relative path to the file that stores the initializer's data.
Definition onnxruntime_c_api.h:6438
OrtStatus * RunOptionsSetRunTag(OrtRunOptions *options, const char *run_tag)
Set per-run tag.
OrtStatus * CreateIoBinding(OrtSession *session, OrtIoBinding **out)
Create an OrtIoBinding instance.
OrtStatus * SetGlobalIntraOpNumThreads(OrtThreadingOptions *tp_options, int intra_op_num_threads)
Set global intra-op thread count.
OrtStatus * CreateOpAttr(const char *name, const void *data, int len, OrtOpAttrType type, OrtOpAttr **op_attr)
: Create attribute of onnxruntime operator
const char *(* EpDevice_EpVendor)(const OrtEpDevice *ep_device)
Get the execution provider's vendor name.
Definition onnxruntime_c_api.h:5585
OrtStatus * FillSparseTensorBlockSparse(OrtValue *ort_value, const OrtMemoryInfo *data_mem_info, const int64_t *values_shape, size_t values_shape_len, const void *values, const int64_t *indices_shape_data, size_t indices_shape_len, const int32_t *indices_data)
const OrtKeyValuePairs *(* HardwareDevice_Metadata)(const OrtHardwareDevice *device)
Get hardware device metadata.
Definition onnxruntime_c_api.h:5567
const OrtModelEditorApi *(* GetModelEditorApi)(void)
Get the Model Editor API instance.
Definition onnxruntime_c_api.h:5292
OrtStatus * ValueInfo_GetValueProducer(const OrtValueInfo *value_info, const OrtNode **producer_node, size_t *producer_output_index)
Get the OrtNode that produces the value represented by the given OrtValueInfo. Optionally returns the...
OrtStatus * ModelMetadataGetVersion(const OrtModelMetadata *model_metadata, int64_t *value)
Get version number from an OrtModelMetadata.
OrtStatus * GetStringTensorContent(const OrtValue *value, void *s, size_t s_len, size_t *offsets, size_t offsets_len)
Get all strings from a string tensor.
OrtStatus * OpAttr_GetName(const OrtOpAttr *attribute, const char **name)
Get the attribute name from an OrtOpAttr.
OrtStatus * GetBoundOutputNames(const OrtIoBinding *binding_ptr, OrtAllocator *allocator, char **buffer, size_t **lengths, size_t *count)
Get the names of an OrtIoBinding's outputs.
OrtStatus * ValueInfo_IsRequiredGraphInput(const OrtValueInfo *value_info, bool *is_required_graph_input)
Returns a boolean indicating if the given value is a required graph input.
OrtStatus * Node_GetOutputs(const OrtNode *node, const OrtValueInfo **outputs, size_t num_outputs)
Returns the node's outputs as OrtValueInfo instances.
OrtStatus * CreateTensorTypeAndShapeInfo(OrtTensorTypeAndShapeInfo **out)
Create an OrtTensorTypeAndShapeInfo object.
OrtStatus * FillSparseTensorCoo(OrtValue *ort_value, const OrtMemoryInfo *data_mem_info, const int64_t *values_shape, size_t values_shape_len, const void *values, const int64_t *indices_data, size_t indices_num)
OrtStatus * SessionEndProfiling(OrtSession *session, OrtAllocator *allocator, char **out)
End profiling and return filename of the profile data.
OrtStatus * DeviceEpIncompatibilityDetails_GetNotes(const OrtDeviceEpIncompatibilityDetails *details, const char **notes)
Get the notes from OrtDeviceEpIncompatibilityDetails.
OrtStatus * ModelMetadataGetProducerName(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char **value)
Get producer name from an OrtModelMetadata.
OrtStatus * GetCompatibilityInfoFromModelBytes(const void *model_data, size_t model_data_length, const char *ep_type, OrtAllocator *allocator, char **compatibility_info)
Extract EP compatibility info from precompiled model bytes in memory.
OrtStatus * SessionOptionsSetCustomCreateThreadFn(OrtSessionOptions *options, OrtCustomCreateThreadFn ort_custom_create_thread_fn)
Set custom thread creation function.
OrtStatus * SetGlobalCustomCreateThreadFn(OrtThreadingOptions *tp_options, OrtCustomCreateThreadFn ort_custom_create_thread_fn)
Set custom thread creation function for global thread pools.
OrtStatus * Node_GetSubgraphs(const OrtNode *node, const OrtGraph **subgraphs, size_t num_subgraphs, const char **attribute_names)
Get the subgraphs, as OrtGraph instances, contained by the given node.
OrtStatus * SessionOptionsAppendExecutionProvider_CUDA_V2(OrtSessionOptions *options, const OrtCUDAProviderOptionsV2 *cuda_options)
Append CUDA execution provider to the session options.
OrtStatus * CreateTensorAsOrtValue(OrtAllocator *allocator, const int64_t *shape, size_t shape_len, ONNXTensorElementDataType type, OrtValue **out)
Create a tensor.
void(* RemoveKeyValuePair)(OrtKeyValuePairs *kvps, const char *key)
Remove a key-value pair from the OrtKeyValuePairs instance.
Definition onnxruntime_c_api.h:5412
void *(* SyncStream_GetHandle)(OrtSyncStream *stream)
Get the native handle of the sync stream.
Definition onnxruntime_c_api.h:6686
OrtStatus * Graph_GetNumInitializers(const OrtGraph *graph, size_t *num_initializers)
Returns the number of graph initializers.
void(* ReleaseCUDAProviderOptions)(OrtCUDAProviderOptionsV2 *input)
Release an OrtCUDAProviderOptionsV2.
Definition onnxruntime_c_api.h:3904
OrtStatus * RunOptionsAddActiveLoraAdapter(OrtRunOptions *options, const OrtLoraAdapter *adapter)
Add the Lora Adapter to the list of active adapters.
OrtStatus * KernelInfoGetAttribute_int64(const OrtKernelInfo *info, const char *name, int64_t *out)
Fetch a 64-bit int stored as an attribute in the graph node.
OrtErrorCode(* GetErrorCode)(const OrtStatus *status) __attribute__((nonnull))
Get OrtErrorCode from OrtStatus.
Definition onnxruntime_c_api.h:1163
OrtStatus * SetTensorElementType(OrtTensorTypeAndShapeInfo *info, enum ONNXTensorElementDataType type)
Set element type in OrtTensorTypeAndShapeInfo.
OrtStatus * BindOutput(OrtIoBinding *binding_ptr, const char *name, const OrtValue *val_ptr)
Bind an OrtValue to an OrtIoBinding output.
OrtStatus * GetSparseTensorValues(const OrtValue *ort_value, const void **out)
Returns numeric data for sparse tensor values (nnz). For string values use GetStringTensor*().
CUDA Provider Options.
Definition onnxruntime_c_api.h:620
int tunable_op_max_tuning_duration_ms
Max tuning duration time limit for each instance of TunableOp. Defaults to 0 to disable the limit.
Definition onnxruntime_c_api.h:699
int has_user_compute_stream
Flag indicating if there is a user provided compute stream Defaults to 0.
Definition onnxruntime_c_api.h:673
int do_copy_in_default_stream
Flag indicating if copying needs to take place on the same stream as the compute stream in the CUDA E...
Definition onnxruntime_c_api.h:668
void * user_compute_stream
User provided compute stream. If provided, please set has_user_compute_stream to 1.
Definition onnxruntime_c_api.h:678
int tunable_op_enable
Enable TunableOp for using. Set it to 1/0 to enable/disable TunableOp. Otherwise, it is disabled by d...
Definition onnxruntime_c_api.h:688
size_t gpu_mem_limit
CUDA memory limit (To use all possible memory pass in maximum size_t) Defaults to SIZE_MAX.
Definition onnxruntime_c_api.h:651
int arena_extend_strategy
Strategy used to grow the memory arena 0 = kNextPowerOfTwo 1 = kSameAsRequested Defaults to 0.
Definition onnxruntime_c_api.h:659
OrtCUDAProviderOptions()
Definition onnxruntime_c_api.h:622
OrtArenaCfg * default_memory_arena_cfg
CUDA memory arena configuration parameters.
Definition onnxruntime_c_api.h:682
int tunable_op_tuning_enable
Enable TunableOp for tuning. Set it to 1/0 to enable/disable TunableOp tuning. Otherwise,...
Definition onnxruntime_c_api.h:694
OrtCudnnConvAlgoSearch cudnn_conv_algo_search
CUDA Convolution algorithm search configuration. See enum OrtCudnnConvAlgoSearch for more details....
Definition onnxruntime_c_api.h:645
int device_id
CUDA device Id Defaults to 0.
Definition onnxruntime_c_api.h:639
The OrtCompileApi struct provides functions to compile ONNX models.
Definition onnxruntime_c_api.h:7752
OrtStatus * ModelCompilationOptions_SetFlags(OrtModelCompilationOptions *model_compile_options, uint32_t flags)
Sets flags from OrtCompileApiFlags that represent one or more boolean options to enable.
OrtStatus * ModelCompilationOptions_SetOutputModelWriteFunc(OrtModelCompilationOptions *model_compile_options, OrtWriteBufferFunc write_func, void *state)
Sets a OrtWriteBufferFunc function that is called by ORT to write out the output model's serialized O...
OrtStatus * ModelCompilationOptions_SetOutputModelBuffer(OrtModelCompilationOptions *model_compile_options, OrtAllocator *allocator, void **output_model_buffer_ptr, size_t *output_model_buffer_size_ptr)
Configures model compilation to store the output compiled ONNX model in a buffer.
OrtStatus * ModelCompilationOptions_SetInputModelFromBuffer(OrtModelCompilationOptions *model_compile_options, const void *input_model_data, size_t input_model_data_size)
Sets the buffer that stores the bytes of the loaded ONNX model to compile.
OrtStatus * ModelCompilationOptions_SetInputModelPath(OrtModelCompilationOptions *model_compile_options, const char *input_model_path)
Sets the file path to the input ONNX model to compile.
OrtStatus * ModelCompilationOptions_SetOutputModelExternalInitializersFile(OrtModelCompilationOptions *model_compile_options, const char *external_initializers_file_path, size_t external_initializers_size_threshold)
Optionally sets the file that should store external initializers for the compiled ONNX model....
OrtStatus * ModelCompilationOptions_SetGraphOptimizationLevel(OrtModelCompilationOptions *model_compile_options, GraphOptimizationLevel graph_optimization_level)
OrtStatus * CreateModelCompilationOptionsFromSessionOptions(const OrtEnv *env, const OrtSessionOptions *session_options, OrtModelCompilationOptions **out)
Creates an OrtModelCompilationOptions object from an existing OrtSessionOptions object.
OrtStatus * ModelCompilationOptions_SetEpContextEmbedMode(OrtModelCompilationOptions *model_compile_options, bool embed_ep_context_in_model)
Enables or disables the embedding of EPContext binary data into the ep_cache_context attribute of EPC...
OrtStatus * ModelCompilationOptions_SetOutputModelPath(OrtModelCompilationOptions *model_compile_options, const char *output_model_path)
Sets the file path for the output ONNX model generated by CompileModel.
OrtStatus * ModelCompilationOptions_SetOutputModelGetInitializerLocationFunc(OrtModelCompilationOptions *model_compile_options, OrtGetInitializerLocationFunc get_initializer_location_func, void *state)
Sets a OrtGetInitializerLocationFunc function that is called by ORT for every initializer in the gene...
OrtStatus * CompileModel(const OrtEnv *env, const OrtModelCompilationOptions *model_options)
Compiles an input ONNX model with the given compilation options.
OrtStatus * ModelCompilationOptions_SetEpContextBinaryInformation(OrtModelCompilationOptions *model_compile_options, const char *output_directory, const char *model_name)
Definition onnxruntime_c_api.h:944
char __place_holder
Definition onnxruntime_c_api.h:945
Definition onnxruntime_c_api.h:7225
int(* GetVariadicInputHomogeneity)(const struct OrtCustomOp *op)
Definition onnxruntime_c_api.h:7271
OrtCustomOpInputOutputCharacteristic(* GetOutputCharacteristic)(const struct OrtCustomOp *op, size_t index)
Definition onnxruntime_c_api.h:7255
size_t(* GetInputTypeCount)(const struct OrtCustomOp *op)
Definition onnxruntime_c_api.h:7243
int(* GetVariadicOutputMinArity)(const struct OrtCustomOp *op)
Definition onnxruntime_c_api.h:7275
size_t(* GetAliasMap)(int **input_index, int **output_index)
Definition onnxruntime_c_api.h:7308
int(* GetStartVersion)(const struct OrtCustomOp *op)
Definition onnxruntime_c_api.h:7293
void(* ReleaseMayInplace)(int *input_index, int *output_index)
Definition onnxruntime_c_api.h:7305
const char *(* GetName)(const struct OrtCustomOp *op)
Definition onnxruntime_c_api.h:7236
size_t(* GetOutputTypeCount)(const struct OrtCustomOp *op)
Definition onnxruntime_c_api.h:7245
void(* KernelDestroy)(void *op_kernel)
Definition onnxruntime_c_api.h:7251
int(* GetVariadicOutputHomogeneity)(const struct OrtCustomOp *op)
Definition onnxruntime_c_api.h:7280
OrtMemType(* GetInputMemoryType)(const struct OrtCustomOp *op, size_t index)
Definition onnxruntime_c_api.h:7262
void *(* CreateKernel)(const struct OrtCustomOp *op, const OrtApi *api, const OrtKernelInfo *info)
Definition onnxruntime_c_api.h:7232
uint32_t version
Definition onnxruntime_c_api.h:7226
ONNXTensorElementDataType(* GetInputType)(const struct OrtCustomOp *op, size_t index)
Definition onnxruntime_c_api.h:7242
void(* ReleaseAliasMap)(int *input_index, int *output_index)
Definition onnxruntime_c_api.h:7309
OrtCustomOpInputOutputCharacteristic(* GetInputCharacteristic)(const struct OrtCustomOp *op, size_t index)
Definition onnxruntime_c_api.h:7254
const char *(* GetExecutionProviderType)(const struct OrtCustomOp *op)
Definition onnxruntime_c_api.h:7239
ONNXTensorElementDataType(* GetOutputType)(const struct OrtCustomOp *op, size_t index)
Definition onnxruntime_c_api.h:7244
int(* GetVariadicInputMinArity)(const struct OrtCustomOp *op)
Definition onnxruntime_c_api.h:7266
OrtStatusPtr(* InferOutputShapeFn)(const struct OrtCustomOp *op, OrtShapeInferContext *)
Definition onnxruntime_c_api.h:7290
int(* GetEndVersion)(const struct OrtCustomOp *op)
Definition onnxruntime_c_api.h:7294
OrtStatusPtr(* CreateKernelV2)(const struct OrtCustomOp *op, const OrtApi *api, const OrtKernelInfo *info, void **kernel)
Definition onnxruntime_c_api.h:7283
size_t(* GetMayInplace)(int **input_index, int **output_index)
Definition onnxruntime_c_api.h:7301
OrtStatusPtr(* KernelComputeV2)(void *op_kernel, OrtKernelContext *context)
Definition onnxruntime_c_api.h:7288
void(* KernelCompute)(void *op_kernel, OrtKernelContext *context)
Definition onnxruntime_c_api.h:7250
Configuration options for creating an OrtEnv.
Definition onnxruntime_c_api.h:1057
uint32_t version
Must be set to ORT_API_VERSION.
Definition onnxruntime_c_api.h:1058
const OrtKeyValuePairs * config_entries
Optional environment configuration entries represented as string key-value pairs. May be set to NULL.
Definition onnxruntime_c_api.h:1130
const OrtThreadingOptions * threading_options
Optional threading options for creating an environment with global thread pools shared across session...
Definition onnxruntime_c_api.h:1110
OrtLoggingFunction custom_logging_function
Optional custom logging function. May be set to NULL.
Definition onnxruntime_c_api.h:1089
void * custom_logging_param
Optional state to pass as the first argument to OrtEnvCreationOptions::custom_logger_function....
Definition onnxruntime_c_api.h:1096
const char * log_id
The log identifier. Must be set to a valid UTF-8 null-terminated string.
Definition onnxruntime_c_api.h:1078
int32_t logging_severity_level
The logging severity level for the environment. Must be set to a value from OrtLoggingLevel.
Definition onnxruntime_c_api.h:1070
The OrtEpApi struct provides functions that are relevant to the implementation of an execution provid...
Definition onnxruntime_ep_c_api.h:751
Descriptor for importing external memory.
Definition onnxruntime_c_api.h:993
OrtExternalMemoryHandleType handle_type
Definition onnxruntime_c_api.h:995
size_t size_bytes
Definition onnxruntime_c_api.h:997
void * native_handle
Definition onnxruntime_c_api.h:996
uint32_t version
Definition onnxruntime_c_api.h:994
size_t offset_bytes
Definition onnxruntime_c_api.h:998
Base struct for imported external memory handles.
Definition onnxruntime_ep_c_api.h:45
Descriptor for importing external semaphores.
Definition onnxruntime_c_api.h:1017
void * native_handle
Definition onnxruntime_c_api.h:1020
OrtExternalSemaphoreType type
Definition onnxruntime_c_api.h:1019
uint32_t version
Definition onnxruntime_c_api.h:1018
Base struct for imported external semaphore handles.
Definition onnxruntime_ep_c_api.h:72
Descriptor for creating a tensor from imported external memory.
Definition onnxruntime_c_api.h:1030
ONNXTensorElementDataType element_type
Definition onnxruntime_c_api.h:1032
size_t offset_bytes
Definition onnxruntime_c_api.h:1035
uint32_t version
Definition onnxruntime_c_api.h:1031
size_t rank
Definition onnxruntime_c_api.h:1034
const int64_t * shape
Definition onnxruntime_c_api.h:1033
The OrtInteropApi struct provides functions for external resource interop with execution providers.
Definition onnxruntime_c_api.h:8025
OrtStatus * WaitSemaphore(OrtExternalResourceImporter *importer, OrtExternalSemaphoreHandle *semaphore_handle, OrtSyncStream *stream, uint64_t value)
Wait on an external semaphore on the EP's stream.
OrtStatus * CreateTensorFromMemory(OrtExternalResourceImporter *importer, const OrtExternalMemoryHandle *mem_handle, const OrtExternalTensorDescriptor *tensor_desc, OrtValue **out_tensor)
Create a tensor backed by imported external memory.
OrtStatus * ImportMemory(OrtExternalResourceImporter *importer, const OrtExternalMemoryDescriptor *desc, OrtExternalMemoryHandle **out_handle)
Import external memory into the execution provider.
OrtStatus * SignalSemaphore(OrtExternalResourceImporter *importer, OrtExternalSemaphoreHandle *semaphore_handle, OrtSyncStream *stream, uint64_t value)
Signal an external semaphore from the EP's stream.
OrtStatus * ImportSemaphore(OrtExternalResourceImporter *importer, const OrtExternalSemaphoreDescriptor *desc, OrtExternalSemaphoreHandle **out_handle)
Import an external semaphore into the execution provider.
OrtStatus * CanImportSemaphore(const OrtExternalResourceImporter *importer, OrtExternalSemaphoreType type, bool *out_supported)
Check if the external resource importer can import a specific semaphore type.
OrtStatus * CreateExternalResourceImporterForDevice(const OrtEpDevice *ep_device, OrtExternalResourceImporter **out_importer)
Create an external resource importer for a specific EP device.
OrtStatus * CanImportMemory(const OrtExternalResourceImporter *importer, OrtExternalMemoryHandleType handle_type, bool *out_supported)
Check if the external resource importer can import a specific memory handle type.
MIGraphX Provider Options.
Definition onnxruntime_c_api.h:824
bool migraphx_exhaustive_tune
Definition onnxruntime_c_api.h:835
int migraphx_save_compiled_model
Definition onnxruntime_c_api.h:831
int migraphx_fp8_enable
Definition onnxruntime_c_api.h:827
int migraphx_int8_enable
Definition onnxruntime_c_api.h:828
int migraphx_load_compiled_model
Definition onnxruntime_c_api.h:833
int migraphx_fp16_enable
Definition onnxruntime_c_api.h:826
int device_id
Definition onnxruntime_c_api.h:825
int migraphx_use_native_calibration_table
Definition onnxruntime_c_api.h:829
size_t migraphx_mem_limit
MIGraphX memory limit (To use all possible memory pass in maximum size_t) Defaults to SIZE_MAX.
Definition onnxruntime_c_api.h:841
const char * migraphx_load_model_path
Definition onnxruntime_c_api.h:834
const char * migraphx_save_model_path
Definition onnxruntime_c_api.h:832
int migraphx_arena_extend_strategy
Strategy used to grow the memory arena 0 = kNextPowerOfTwo 1 = kSameAsRequested Defaults to 0.
Definition onnxruntime_c_api.h:849
const char * migraphx_int8_calibration_table_name
Definition onnxruntime_c_api.h:830
The OrtModelEditorApi struct provides functions to create or edit an ONNX model.
Definition onnxruntime_c_api.h:7323
OrtStatus * CreateModel(const char *const *domain_names, const int *opset_versions, size_t opset_entries_len, OrtModel **model)
Create an OrtModel.
OrtStatus * CreateGraph(OrtGraph **graph)
Create an OrtGraph.
OrtStatus * ApplyModelToModelEditorSession(OrtSession *session, OrtModel *model)
Apply changes to augment the ONNX model in a session created using CreateModelEditorSession[FromArray...
OrtStatus * AddInitializerToGraph(OrtGraph *graph, const char *name, OrtValue *tensor, bool data_is_external)
Add an initializer to the OrtGraph.
OrtStatus * SessionGetOpsetForDomain(const OrtSession *session, const char *domain, int *opset)
Query the session for the opset version of a domain.
OrtStatus * CreateValueInfo(const char *name, const OrtTypeInfo *type_info, OrtValueInfo **value_info)
Create an OrtValueInfo for use as an OrtGraph input or output.
OrtStatus * CreateModelEditorSessionFromArray(const OrtEnv *env, const void *model_data, size_t model_data_length, const OrtSessionOptions *options, OrtSession **out)
Create an OrtSession to augment an existing model.
OrtStatus * CreateSequenceTypeInfo(const OrtTypeInfo *sequence_type, OrtTypeInfo **type_info)
Create an OrtTypeInfo instance for a Sequence.
OrtStatus * CreateOptionalTypeInfo(const OrtTypeInfo *contained_type, OrtTypeInfo **type_info)
Create an OrtTypeInfo instance for an Optional.
OrtStatus * AddGraphToModel(OrtModel *model, OrtGraph *graph)
Add an OrtGraph to an OrtModel.
OrtStatus * FinalizeModelEditorSession(OrtSession *session, const OrtSessionOptions *options, OrtPrepackedWeightsContainer *prepacked_weights_container)
Finalize the Model Editor session that was created using CreateModelEditorSession[FromArray].
OrtStatus * CreateMapTypeInfo(ONNXTensorElementDataType map_key_type, const OrtTypeInfo *map_value_type, OrtTypeInfo **type_info)
Create an OrtTypeInfo instance for a Map.
OrtStatus * CreateSparseTensorTypeInfo(const OrtTensorTypeAndShapeInfo *tensor_info, OrtTypeInfo **type_info)
Create an OrtTypeInfo instance for a SparseTensor.
OrtStatus * CreateNode(const char *operator_name, const char *domain_name, const char *node_name, const char *const *input_names, size_t input_names_len, const char *const *output_names, size_t output_names_len, OrtOpAttr **attributes, size_t attribs_len, OrtNode **node)
Create an OrtNode to add to an OrtGraph.
OrtStatus * CreateModelEditorSession(const OrtEnv *env, const char *model_path, const OrtSessionOptions *options, OrtSession **out)
Create an OrtSession to augment an existing model.
OrtStatus * CreateSessionFromModel(const OrtEnv *env, const OrtModel *model, const OrtSessionOptions *options, OrtSession **out)
Create an OrtSession using the OrtModel.
OrtStatus * SetGraphOutputs(OrtGraph *graph, OrtValueInfo **outputs, size_t outputs_len)
Set the outputs for the OrtGraph.
OrtStatus * CreateTensorTypeInfo(const OrtTensorTypeAndShapeInfo *tensor_info, OrtTypeInfo **type_info)
Create an OrtTypeInfo instance for a Tensor.
OrtStatus * AddNodeToGraph(OrtGraph *graph, OrtNode *node)
Add an OrtNode to an OrtGraph.
OrtStatus * SetGraphInputs(OrtGraph *graph, OrtValueInfo **inputs, size_t inputs_len)
Set the inputs for the OrtGraph.
OpenVINO Provider Options.
Definition onnxruntime_c_api.h:863
unsigned char enable_opencl_throttling
0 = disabled, nonzero = enabled
Definition onnxruntime_c_api.h:884
size_t num_of_threads
0 = Use default number of threads
Definition onnxruntime_c_api.h:881
void * context
Definition onnxruntime_c_api.h:883
const char * cache_dir
Definition onnxruntime_c_api.h:882
const char * device_type
Device type string.
Definition onnxruntime_c_api.h:878
const char * device_id
Definition onnxruntime_c_api.h:880
unsigned char enable_npu_fast_compile
0 = disabled, nonzero = enabled
Definition onnxruntime_c_api.h:879
OrtOpenVINOProviderOptions()
Definition onnxruntime_c_api.h:865
unsigned char enable_dynamic_shapes
0 = disabled, nonzero = enabled
Definition onnxruntime_c_api.h:885
ROCM Provider Options.
Definition onnxruntime_c_api.h:707
int device_id
ROCM device Id Defaults to 0.
Definition onnxruntime_c_api.h:727
int tunable_op_max_tuning_duration_ms
Max tuning duration time limit for each instance of TunableOp. Defaults to 0 to disable the limit.
Definition onnxruntime_c_api.h:788
int do_copy_in_default_stream
Flag indicating if copying needs to take place on the same stream as the compute stream in the ROCM E...
Definition onnxruntime_c_api.h:755
OrtArenaCfg * default_memory_arena_cfg
ROCM memory arena configuration parameters.
Definition onnxruntime_c_api.h:769
size_t gpu_mem_limit
ROCM memory limit (To use all possible memory pass in maximum size_t) Defaults to SIZE_MAX.
Definition onnxruntime_c_api.h:738
OrtROCMProviderOptions()
Definition onnxruntime_c_api.h:709
int enable_hip_graph
Definition onnxruntime_c_api.h:771
int tunable_op_enable
Enable TunableOp for using. Set it to 1/0 to enable/disable TunableOp. Otherwise, it is disabled by d...
Definition onnxruntime_c_api.h:777
void * user_compute_stream
User provided compute stream. If provided, please set has_user_compute_stream to 1.
Definition onnxruntime_c_api.h:765
int arena_extend_strategy
Strategy used to grow the memory arena 0 = kNextPowerOfTwo 1 = kSameAsRequested Defaults to 0.
Definition onnxruntime_c_api.h:746
int tunable_op_tuning_enable
Enable TunableOp for tuning. Set it to 1/0 to enable/disable TunableOp tuning. Otherwise,...
Definition onnxruntime_c_api.h:783
int has_user_compute_stream
Flag indicating if there is a user provided compute stream Defaults to 0.
Definition onnxruntime_c_api.h:760
int miopen_conv_exhaustive_search
ROCM MIOpen Convolution algorithm exhaustive search option. Defaults to 0 (false).
Definition onnxruntime_c_api.h:732
TensorRT Provider Options.
Definition onnxruntime_c_api.h:796
int trt_engine_cache_enable
Definition onnxruntime_c_api.h:810
void * user_compute_stream
Definition onnxruntime_c_api.h:799
int device_id
CUDA device id (0 = default device)
Definition onnxruntime_c_api.h:797
const char * trt_engine_cache_path
Definition onnxruntime_c_api.h:811
int trt_engine_decryption_enable
Definition onnxruntime_c_api.h:812
int trt_max_partition_iterations
Definition onnxruntime_c_api.h:800
size_t trt_max_workspace_size
Definition onnxruntime_c_api.h:802
int trt_dla_enable
Definition onnxruntime_c_api.h:807
const char * trt_int8_calibration_table_name
Definition onnxruntime_c_api.h:805
int has_user_compute_stream
Definition onnxruntime_c_api.h:798
int trt_dla_core
Definition onnxruntime_c_api.h:808
int trt_int8_use_native_calibration_table
Definition onnxruntime_c_api.h:806
int trt_min_subgraph_size
Definition onnxruntime_c_api.h:801
int trt_force_sequential_engine_build
Definition onnxruntime_c_api.h:814
int trt_dump_subgraphs
Definition onnxruntime_c_api.h:809
int trt_fp16_enable
Definition onnxruntime_c_api.h:803
const char * trt_engine_decryption_lib_path
Definition onnxruntime_c_api.h:813
int trt_int8_enable
Definition onnxruntime_c_api.h:804
The Training C API that holds onnxruntime training function pointers.
Definition onnxruntime_training_c_api.h:122