# OnnxRuntime: onnxruntime_c_api.h Source File

Loading...
Searching...
No Matches
onnxruntime_c_api.h
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// See docs\c_cxx\README.md on generating the Doxygen documentation from this file
#pragma once
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#define ORT_API_VERSION 15
#ifdef __cplusplus
extern "C" {
#endif
// SAL2 Definitions
#ifndef _WIN32
#define _In_
#define _In_z_
#define _In_opt_
#define _In_opt_z_
#define _Out_
#define _Outptr_
#define _Out_opt_
#define _Inout_
#define _Inout_opt_
#define _Frees_ptr_opt_
#define _Ret_maybenull_
#define _Ret_notnull_
#define _Check_return_
#define _Outptr_result_maybenull_
#define _In_reads_(X)
#define _Inout_updates_all_(X)
#define _Out_writes_bytes_all_(X)
#define _Out_writes_all_(X)
#define _Success_(X)
#define _Outptr_result_buffer_maybenull_(X)
#define ORT_ALL_ARGS_NONNULL __attribute__((nonnull))
#else
#include <specstrings.h>
#define ORT_ALL_ARGS_NONNULL
#endif
#ifdef _WIN32
// Define ORT_DLL_IMPORT if your program is dynamically linked to Ort.
// dllexport is not used, we use a .def file.
#ifdef ORT_DLL_IMPORT
#define ORT_EXPORT __declspec(dllimport)
#else
#define ORT_EXPORT
#endif
#define ORT_API_CALL _stdcall
#define ORT_MUST_USE_RESULT
#define ORTCHAR_T wchar_t
#else
// To make symbols visible on macOS/iOS
#ifdef __APPLE__
#define ORT_EXPORT __attribute__((visibility("default")))
#else
#define ORT_EXPORT
#endif
#define ORT_API_CALL
#define ORT_MUST_USE_RESULT __attribute__((warn_unused_result))
#define ORTCHAR_T char
#endif
#ifndef ORT_TSTR
#ifdef _WIN32
#define ORT_TSTR(X) L##X
#else
#define ORT_TSTR(X) X
#endif
#endif
// Any pointer marked with _In_ or _Out_, cannot be NULL.
// Windows users should use unicode paths when possible to bypass the MAX_PATH limitation
// Every pointer marked with _In_ or _Out_, cannot be NULL. Caller should ensure that.
// for ReleaseXXX(...) functions, they can accept NULL pointer.
#ifdef __cplusplus
// For any compiler with C++11 support, MSVC 2015 and greater, or Clang version supporting noexcept.
// Such complex condition is needed because compilers set __cplusplus value differently.
#ifndef __has_feature
#define __has_feature(x) 0
#endif
#if ((__cplusplus >= 201103L) || (_MSC_VER >= 1900) || (defined(__has_feature) && __has_feature(cxx_noexcept)))
#define NO_EXCEPTION noexcept
#else
#define NO_EXCEPTION throw()
#endif
#else
#define NO_EXCEPTION
#endif
// __VA_ARGS__ on Windows and Linux are different
#define ORT_API(RETURN_TYPE, NAME, ...) RETURN_TYPE ORT_API_CALL NAME(__VA_ARGS__) NO_EXCEPTION
#define ORT_API_STATUS(NAME, ...) \
_Success_(return == 0) _Check_return_ _Ret_maybenull_ OrtStatusPtr ORT_API_CALL NAME(__VA_ARGS__) \
NO_EXCEPTION ORT_MUST_USE_RESULT
// XXX: Unfortunately, SAL annotations are known to not work with function pointers
#define ORT_API2_STATUS(NAME, ...) \
_Check_return_ _Ret_maybenull_ OrtStatusPtr(ORT_API_CALL* NAME)(__VA_ARGS__) NO_EXCEPTION ORT_MUST_USE_RESULT
// Used in *.cc files. Almost as same as ORT_API_STATUS, except without ORT_MUST_USE_RESULT and ORT_EXPORT
#define ORT_API_STATUS_IMPL(NAME, ...) \
_Success_(return == 0) _Check_return_ _Ret_maybenull_ OrtStatusPtr ORT_API_CALL NAME(__VA_ARGS__) NO_EXCEPTION
#define ORT_CLASS_RELEASE(X) void(ORT_API_CALL * Release##X)(_Frees_ptr_opt_ Ort##X * input)
#ifdef __DOXYGEN__
#undef ORT_API_STATUS
#define ORT_API_STATUS(NAME, ...) OrtStatus* NAME(__VA_ARGS__)
#undef ORT_API2_STATUS
#define ORT_API2_STATUS(NAME, ...) OrtStatus* NAME(__VA_ARGS__)
#undef ORT_CLASS_RELEASE
#define ORT_CLASS_RELEASE(X) void Release##X(Ort##X* input)
#undef NO_EXCEPTION
#define NO_EXCEPTION
#endif
typedef enum ONNXTensorElementDataType {
ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED,
ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT, // maps to c type float
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8, // maps to c type uint8_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8, // maps to c type int8_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16, // maps to c type uint16_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16, // maps to c type int16_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32, // maps to c type int32_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64, // maps to c type int64_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING, // maps to c++ type std::string
ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL,
ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16,
ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE, // maps to c type double
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32, // maps to c type uint32_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64, // maps to c type uint64_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64, // complex with float32 real and imaginary components
ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128, // complex with float64 real and imaginary components
ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16 // Non-IEEE floating-point format based on IEEE754 single-precision
} ONNXTensorElementDataType;
// Synced with onnx TypeProto oneof
typedef enum ONNXType {
ONNX_TYPE_UNKNOWN,
ONNX_TYPE_TENSOR,
ONNX_TYPE_SEQUENCE,
ONNX_TYPE_MAP,
ONNX_TYPE_OPAQUE,
ONNX_TYPE_SPARSETENSOR,
ONNX_TYPE_OPTIONAL
} ONNXType;
// These types are synced with internal
// SparseFormatFlags
typedef enum OrtSparseFormat {
ORT_SPARSE_UNDEFINED = 0,
ORT_SPARSE_COO = 0x1,
ORT_SPARSE_CSRC = 0x2,
ORT_SPARSE_BLOCK_SPARSE = 0x4
} OrtSparseFormat;
// Enum allows to query sparse tensor indices
enum OrtSparseIndicesFormat {
ORT_SPARSE_COO_INDICES,
ORT_SPARSE_CSR_INNER_INDICES,
ORT_SPARSE_CSR_OUTER_INDICES,
ORT_SPARSE_BLOCK_SPARSE_INDICES
};
typedef enum OrtLoggingLevel {
ORT_LOGGING_LEVEL_VERBOSE,
ORT_LOGGING_LEVEL_INFO,
ORT_LOGGING_LEVEL_WARNING,
ORT_LOGGING_LEVEL_ERROR,
ORT_LOGGING_LEVEL_FATAL,
} OrtLoggingLevel;
typedef enum OrtErrorCode {
ORT_OK,
ORT_FAIL,
ORT_INVALID_ARGUMENT,
ORT_NO_SUCHFILE,
ORT_NO_MODEL,
ORT_ENGINE_ERROR,
ORT_RUNTIME_EXCEPTION,
ORT_INVALID_PROTOBUF,
ORT_MODEL_LOADED,
ORT_NOT_IMPLEMENTED,
ORT_INVALID_GRAPH,
ORT_EP_FAIL,
} OrtErrorCode;
typedef enum OrtOpAttrType {
ORT_OP_ATTR_UNDEFINED = 0,
ORT_OP_ATTR_INT,
ORT_OP_ATTR_INTS,
ORT_OP_ATTR_FLOAT,
ORT_OP_ATTR_FLOATS,
ORT_OP_ATTR_STRING,
ORT_OP_ATTR_STRINGS,
} OrtOpAttrType;
#define ORT_RUNTIME_CLASS(X) \
struct Ort##X; \
typedef struct Ort##X Ort##X;
// The actual types defined have an Ort prefix
ORT_RUNTIME_CLASS(Env);
ORT_RUNTIME_CLASS(Status); // nullptr for Status* indicates success
ORT_RUNTIME_CLASS(MemoryInfo);
ORT_RUNTIME_CLASS(IoBinding);
ORT_RUNTIME_CLASS(Session); // Don't call ReleaseSession from Dllmain (because session owns a thread pool)
ORT_RUNTIME_CLASS(Value);
ORT_RUNTIME_CLASS(RunOptions);
ORT_RUNTIME_CLASS(TypeInfo);
ORT_RUNTIME_CLASS(TensorTypeAndShapeInfo);
ORT_RUNTIME_CLASS(SessionOptions);
ORT_RUNTIME_CLASS(CustomOpDomain);
ORT_RUNTIME_CLASS(MapTypeInfo);
ORT_RUNTIME_CLASS(SequenceTypeInfo);
ORT_RUNTIME_CLASS(ModelMetadata);
ORT_RUNTIME_CLASS(ThreadPoolParams);
ORT_RUNTIME_CLASS(ThreadingOptions);
ORT_RUNTIME_CLASS(ArenaCfg);
ORT_RUNTIME_CLASS(PrepackedWeightsContainer);
ORT_RUNTIME_CLASS(TensorRTProviderOptionsV2);
ORT_RUNTIME_CLASS(CUDAProviderOptionsV2);
ORT_RUNTIME_CLASS(CANNProviderOptions);
ORT_RUNTIME_CLASS(DnnlProviderOptions);
ORT_RUNTIME_CLASS(Op);
ORT_RUNTIME_CLASS(OpAttr);
#ifdef _WIN32
typedef _Return_type_success_(return == 0) OrtStatus* OrtStatusPtr;
#else
typedef OrtStatus* OrtStatusPtr;
#endif
typedef struct OrtAllocator {
uint32_t version;
void*(ORT_API_CALL* Alloc)(struct OrtAllocator* this_, size_t size);
void(ORT_API_CALL* Free)(struct OrtAllocator* this_, void* p);
const struct OrtMemoryInfo*(ORT_API_CALL* Info)(const struct OrtAllocator* this_);
} OrtAllocator;
typedef void(ORT_API_CALL* OrtLoggingFunction)(
void* param, OrtLoggingLevel severity, const char* category, const char* logid, const char* code_location,
const char* message);
typedef enum GraphOptimizationLevel {
ORT_DISABLE_ALL = 0,
ORT_ENABLE_BASIC = 1,
ORT_ENABLE_EXTENDED = 2,
ORT_ENABLE_ALL = 99
} GraphOptimizationLevel;
typedef enum ExecutionMode {
ORT_SEQUENTIAL = 0,
ORT_PARALLEL = 1,
} ExecutionMode;
typedef enum OrtLanguageProjection {
ORT_PROJECTION_C = 0,
ORT_PROJECTION_CPLUSPLUS = 1,
ORT_PROJECTION_CSHARP = 2,
ORT_PROJECTION_PYTHON = 3,
ORT_PROJECTION_JAVA = 4,
ORT_PROJECTION_WINML = 5,
ORT_PROJECTION_NODEJS = 6,
} OrtLanguageProjection;
struct OrtKernelInfo;
typedef struct OrtKernelInfo OrtKernelInfo;
struct OrtKernelContext;
typedef struct OrtKernelContext OrtKernelContext;
struct OrtCustomOp;
typedef struct OrtCustomOp OrtCustomOp;
typedef enum OrtAllocatorType {
OrtInvalidAllocator = -1,
OrtDeviceAllocator = 0,
OrtArenaAllocator = 1
} OrtAllocatorType;
// Whenever this struct is updated, please also update the MakeKey function in onnxruntime / core / framework / execution_provider.cc
typedef enum OrtMemType {
OrtMemTypeCPUInput = -2,
OrtMemTypeCPUOutput = -1,
OrtMemTypeCPU = OrtMemTypeCPUOutput,
OrtMemTypeDefault = 0,
} OrtMemType;
typedef enum OrtMemoryInfoDeviceType {
OrtMemoryInfoDeviceType_CPU = 0,
OrtMemoryInfoDeviceType_GPU = 1,
OrtMemoryInfoDeviceType_FPGA = 2
} OrtMemoryInfoDeviceType;
typedef enum OrtCudnnConvAlgoSearch {
OrtCudnnConvAlgoSearchExhaustive, // expensive exhaustive benchmarking using cudnnFindConvolutionForwardAlgorithmEx
OrtCudnnConvAlgoSearchHeuristic, // lightweight heuristic based search using cudnnGetConvolutionForwardAlgorithm_v7
OrtCudnnConvAlgoSearchDefault, // default algorithm using CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM
} OrtCudnnConvAlgoSearch;
typedef struct OrtCUDAProviderOptions {
#ifdef __cplusplus
OrtCUDAProviderOptions()
: device_id{},
cudnn_conv_algo_search{OrtCudnnConvAlgoSearchExhaustive},
gpu_mem_limit{SIZE_MAX},
arena_extend_strategy{},
do_copy_in_default_stream{1},
has_user_compute_stream{},
user_compute_stream{},
default_memory_arena_cfg{},
tunable_op_enabled{false} {}
#endif
int device_id;
OrtCudnnConvAlgoSearch cudnn_conv_algo_search;
size_t gpu_mem_limit;
int arena_extend_strategy;
int do_copy_in_default_stream;
int has_user_compute_stream;
void* user_compute_stream;
OrtArenaCfg* default_memory_arena_cfg;
int tunable_op_enabled;
} OrtCUDAProviderOptions;
typedef struct OrtROCMProviderOptions {
#ifdef __cplusplus
OrtROCMProviderOptions()
: device_id{},
miopen_conv_exhaustive_search{0},
gpu_mem_limit{SIZE_MAX},
arena_extend_strategy{},
do_copy_in_default_stream{1},
has_user_compute_stream{},
user_compute_stream{},
default_memory_arena_cfg{},
tunable_op_enabled{false} {}
#endif
int device_id;
int miopen_conv_exhaustive_search;
size_t gpu_mem_limit;
int arena_extend_strategy;
int do_copy_in_default_stream;
int has_user_compute_stream;
void* user_compute_stream;
OrtArenaCfg* default_memory_arena_cfg;
int tunable_op_enabled;
} OrtROCMProviderOptions;
typedef struct OrtTensorRTProviderOptions {
int device_id;
int has_user_compute_stream; // indicator of user specified CUDA compute stream.
void* user_compute_stream; // user specified CUDA compute stream.
int trt_max_partition_iterations; // maximum iterations for TensorRT parser to get capability
int trt_min_subgraph_size; // minimum size of TensorRT subgraphs
size_t trt_max_workspace_size; // maximum workspace size for TensorRT.
int trt_fp16_enable; // enable TensorRT FP16 precision. Default 0 = false, nonzero = true
int trt_int8_enable; // enable TensorRT INT8 precision. Default 0 = false, nonzero = true
const char* trt_int8_calibration_table_name; // TensorRT INT8 calibration table name.
int trt_int8_use_native_calibration_table; // use native TensorRT generated calibration table. Default 0 = false, nonzero = true
int trt_dla_enable; // enable DLA. Default 0 = false, nonzero = true
int trt_dla_core; // DLA core number. Default 0
int trt_dump_subgraphs; // dump TRT subgraph. Default 0 = false, nonzero = true
int trt_engine_cache_enable; // enable engine caching. Default 0 = false, nonzero = true
const char* trt_engine_cache_path; // specify engine cache path
int trt_engine_decryption_enable; // enable engine decryption. Default 0 = false, nonzero = true
const char* trt_engine_decryption_lib_path; // specify engine decryption library path
int trt_force_sequential_engine_build; // force building TensorRT engine sequentially. Default 0 = false, nonzero = true
// This is the legacy struct and don't add new fields here.
// For new field that can be represented by string, please add it in include/onnxruntime/core/providers/tensorrt/tensorrt_provider_options.h
// For non-string field, need to create a new separate api to handle it.
} OrtTensorRTProviderOptions;
typedef struct OrtMIGraphXProviderOptions {
int device_id; // hip device id.
int migraphx_fp16_enable; // enable MIGraphX FP16 precision. Default 0 = false, nonzero = true
int migraphx_int8_enable; // enable MIGraphX INT8 precision. Default 0 = false, nonzero = true
} OrtMIGraphXProviderOptions;
typedef struct OrtOpenVINOProviderOptions {
#ifdef __cplusplus
OrtOpenVINOProviderOptions() : device_type{}, enable_vpu_fast_compile{}, device_id{},
num_of_threads{}, cache_dir{},
context{}, enable_opencl_throttling{}, enable_dynamic_shapes{} {}
#endif
const char* device_type;
unsigned char enable_vpu_fast_compile;
const char* device_id;
size_t num_of_threads;
const char* cache_dir; // path is set to empty by default
void* context;
unsigned char enable_opencl_throttling;
unsigned char enable_dynamic_shapes;
} OrtOpenVINOProviderOptions;
struct OrtApi;
typedef struct OrtApi OrtApi;
struct OrtTrainingApi;
typedef struct OrtTrainingApi OrtTrainingApi;
struct OrtApiBase {
const OrtApi*(ORT_API_CALL* GetApi)(uint32_t version)NO_EXCEPTION;
const char*(ORT_API_CALL* GetVersionString)(void)NO_EXCEPTION;
};
typedef struct OrtApiBase OrtApiBase;
ORT_EXPORT const OrtApiBase* ORT_API_CALL OrtGetApiBase(void) NO_EXCEPTION;
typedef void (*OrtThreadWorkerFn)(void* ort_worker_fn_param);
typedef const struct OrtCustomHandleType {
char __place_holder;
}* OrtCustomThreadHandle;
typedef OrtCustomThreadHandle (*OrtCustomCreateThreadFn)(void* ort_custom_thread_creation_options, OrtThreadWorkerFn ort_thread_worker_fn, void* ort_worker_fn_param);
typedef void (*OrtCustomJoinThreadFn)(OrtCustomThreadHandle ort_custom_thread_handle);
typedef OrtStatus*(ORT_API_CALL* RegisterCustomOpsFn)(OrtSessionOptions* options, const OrtApiBase* api);
struct OrtApi {
OrtStatus*(ORT_API_CALL* CreateStatus)(OrtErrorCode code, _In_ const char* msg)NO_EXCEPTION ORT_ALL_ARGS_NONNULL;
OrtErrorCode(ORT_API_CALL* GetErrorCode)(_In_ const OrtStatus* status) NO_EXCEPTION ORT_ALL_ARGS_NONNULL;
const char*(ORT_API_CALL* GetErrorMessage)(_In_ const OrtStatus* status)NO_EXCEPTION ORT_ALL_ARGS_NONNULL;
ORT_API2_STATUS(CreateEnv, OrtLoggingLevel log_severity_level, _In_ const char* logid, _Outptr_ OrtEnv** out);
ORT_API2_STATUS(CreateEnvWithCustomLogger, OrtLoggingFunction logging_function, _In_opt_ void* logger_param,
OrtLoggingLevel log_severity_level, _In_ const char* logid, _Outptr_ OrtEnv** out);
ORT_API2_STATUS(EnableTelemetryEvents, _In_ const OrtEnv* env);
ORT_API2_STATUS(DisableTelemetryEvents, _In_ const OrtEnv* env);
// TODO: document the path separator convention? '/' vs '\'
// TODO: should specify the access characteristics of model_path. Is this read only during the
// execution of CreateSession, or does the OrtSession retain a handle to the file/directory
// and continue to access throughout the OrtSession lifetime?
// What sort of access is needed to model_path : read or read/write?
ORT_API2_STATUS(CreateSession, _In_ const OrtEnv* env, _In_ const ORTCHAR_T* model_path,
_In_ const OrtSessionOptions* options, _Outptr_ OrtSession** out);
ORT_API2_STATUS(CreateSessionFromArray, _In_ const OrtEnv* env, _In_ const void* model_data, size_t model_data_length,
_In_ const OrtSessionOptions* options, _Outptr_ OrtSession** out);
ORT_API2_STATUS(Run, _Inout_ OrtSession* session, _In_opt_ const OrtRunOptions* run_options,
_In_reads_(input_len) const char* const* input_names,
_In_reads_(input_len) const OrtValue* const* inputs, size_t input_len,
_In_reads_(output_names_len) const char* const* output_names, size_t output_names_len,
_Inout_updates_all_(output_names_len) OrtValue** outputs);
ORT_API2_STATUS(CreateSessionOptions, _Outptr_ OrtSessionOptions** options);
ORT_API2_STATUS(SetOptimizedModelFilePath, _Inout_ OrtSessionOptions* options,
_In_ const ORTCHAR_T* optimized_model_filepath);
ORT_API2_STATUS(CloneSessionOptions, _In_ const OrtSessionOptions* in_options,
_Outptr_ OrtSessionOptions** out_options);
ORT_API2_STATUS(SetSessionExecutionMode, _Inout_ OrtSessionOptions* options, ExecutionMode execution_mode);
ORT_API2_STATUS(EnableProfiling, _Inout_ OrtSessionOptions* options, _In_ const ORTCHAR_T* profile_file_prefix);
ORT_API2_STATUS(DisableProfiling, _Inout_ OrtSessionOptions* options);
ORT_API2_STATUS(EnableMemPattern, _Inout_ OrtSessionOptions* options);
ORT_API2_STATUS(DisableMemPattern, _Inout_ OrtSessionOptions* options);
ORT_API2_STATUS(EnableCpuMemArena, _Inout_ OrtSessionOptions* options);
ORT_API2_STATUS(DisableCpuMemArena, _Inout_ OrtSessionOptions* options);
ORT_API2_STATUS(SetSessionLogId, _Inout_ OrtSessionOptions* options, const char* logid);
ORT_API2_STATUS(SetSessionLogVerbosityLevel, _Inout_ OrtSessionOptions* options, int session_log_verbosity_level);
ORT_API2_STATUS(SetSessionLogSeverityLevel, _Inout_ OrtSessionOptions* options, int session_log_severity_level);
ORT_API2_STATUS(SetSessionGraphOptimizationLevel, _Inout_ OrtSessionOptions* options,
GraphOptimizationLevel graph_optimization_level);
ORT_API2_STATUS(SetIntraOpNumThreads, _Inout_ OrtSessionOptions* options, int intra_op_num_threads);
ORT_API2_STATUS(SetInterOpNumThreads, _Inout_ OrtSessionOptions* options, int inter_op_num_threads);
ORT_API2_STATUS(CreateCustomOpDomain, _In_ const char* domain, _Outptr_ OrtCustomOpDomain** out);
ORT_API2_STATUS(CustomOpDomain_Add, _Inout_ OrtCustomOpDomain* custom_op_domain, _In_ const OrtCustomOp* op);
ORT_API2_STATUS(AddCustomOpDomain, _Inout_ OrtSessionOptions* options, _In_ OrtCustomOpDomain* custom_op_domain);
ORT_API2_STATUS(RegisterCustomOpsLibrary, _Inout_ OrtSessionOptions* options, _In_ const char* library_path, _Outptr_ void** library_handle);
ORT_API2_STATUS(SessionGetInputCount, _In_ const OrtSession* session, _Out_ size_t* out);
ORT_API2_STATUS(SessionGetOutputCount, _In_ const OrtSession* session, _Out_ size_t* out);
ORT_API2_STATUS(SessionGetOverridableInitializerCount, _In_ const OrtSession* session, _Out_ size_t* out);
ORT_API2_STATUS(SessionGetInputTypeInfo, _In_ const OrtSession* session, size_t index, _Outptr_ OrtTypeInfo** type_info);
ORT_API2_STATUS(SessionGetOutputTypeInfo, _In_ const OrtSession* session, size_t index, _Outptr_ OrtTypeInfo** type_info);
ORT_API2_STATUS(SessionGetOverridableInitializerTypeInfo, _In_ const OrtSession* session, size_t index, _Outptr_ OrtTypeInfo** type_info);
ORT_API2_STATUS(SessionGetInputName, _In_ const OrtSession* session, size_t index, _Inout_ OrtAllocator* allocator, _Outptr_ char** value);
ORT_API2_STATUS(SessionGetOutputName, _In_ const OrtSession* session, size_t index, _Inout_ OrtAllocator* allocator, _Outptr_ char** value);
ORT_API2_STATUS(SessionGetOverridableInitializerName, _In_ const OrtSession* session, size_t index,
_Inout_ OrtAllocator* allocator, _Outptr_ char** value);
ORT_API2_STATUS(CreateRunOptions, _Outptr_ OrtRunOptions** out);
ORT_API2_STATUS(RunOptionsSetRunLogVerbosityLevel, _Inout_ OrtRunOptions* options, int log_verbosity_level);
ORT_API2_STATUS(RunOptionsSetRunLogSeverityLevel, _Inout_ OrtRunOptions* options, int log_severity_level);
ORT_API2_STATUS(RunOptionsSetRunTag, _Inout_ OrtRunOptions* options, _In_ const char* run_tag);
ORT_API2_STATUS(RunOptionsGetRunLogVerbosityLevel, _In_ const OrtRunOptions* options,
_Out_ int* log_verbosity_level);
ORT_API2_STATUS(RunOptionsGetRunLogSeverityLevel, _In_ const OrtRunOptions* options, _Out_ int* log_severity_level);
ORT_API2_STATUS(RunOptionsGetRunTag, _In_ const OrtRunOptions* options, _Out_ const char** run_tag);
ORT_API2_STATUS(RunOptionsSetTerminate, _Inout_ OrtRunOptions* options);
ORT_API2_STATUS(RunOptionsUnsetTerminate, _Inout_ OrtRunOptions* options);
ORT_API2_STATUS(CreateTensorAsOrtValue, _Inout_ OrtAllocator* allocator, _In_ const int64_t* shape, size_t shape_len,
ONNXTensorElementDataType type, _Outptr_ OrtValue** out);
ORT_API2_STATUS(CreateTensorWithDataAsOrtValue, _In_ const OrtMemoryInfo* info, _Inout_ void* p_data,
size_t p_data_len, _In_ const int64_t* shape, size_t shape_len, ONNXTensorElementDataType type,
_Outptr_ OrtValue** out);
ORT_API2_STATUS(IsTensor, _In_ const OrtValue* value, _Out_ int* out);
ORT_API2_STATUS(GetTensorMutableData, _In_ OrtValue* value, _Outptr_ void** out);
ORT_API2_STATUS(FillStringTensor, _Inout_ OrtValue* value, _In_ const char* const* s, size_t s_len);
ORT_API2_STATUS(GetStringTensorDataLength, _In_ const OrtValue* value, _Out_ size_t* len);
ORT_API2_STATUS(GetStringTensorContent, _In_ const OrtValue* value, _Out_writes_bytes_all_(s_len) void* s,
size_t s_len, _Out_writes_all_(offsets_len) size_t* offsets, size_t offsets_len);
ORT_API2_STATUS(CastTypeInfoToTensorInfo, _In_ const OrtTypeInfo* type_info,
_Outptr_result_maybenull_ const OrtTensorTypeAndShapeInfo** out);
ORT_API2_STATUS(GetOnnxTypeFromTypeInfo, _In_ const OrtTypeInfo* type_info, _Out_ enum ONNXType* out);
ORT_API2_STATUS(CreateTensorTypeAndShapeInfo, _Outptr_ OrtTensorTypeAndShapeInfo** out);
ORT_API2_STATUS(SetTensorElementType, _Inout_ OrtTensorTypeAndShapeInfo* info, enum ONNXTensorElementDataType type);
ORT_API2_STATUS(SetDimensions, OrtTensorTypeAndShapeInfo* info, _In_ const int64_t* dim_values, size_t dim_count);
ORT_API2_STATUS(GetTensorElementType, _In_ const OrtTensorTypeAndShapeInfo* info,
_Out_ enum ONNXTensorElementDataType* out);
ORT_API2_STATUS(GetDimensionsCount, _In_ const OrtTensorTypeAndShapeInfo* info, _Out_ size_t* out);
ORT_API2_STATUS(GetDimensions, _In_ const OrtTensorTypeAndShapeInfo* info, _Out_ int64_t* dim_values,
size_t dim_values_length);
ORT_API2_STATUS(GetSymbolicDimensions, _In_ const OrtTensorTypeAndShapeInfo* info,
_Out_writes_all_(dim_params_length) const char* dim_params[], size_t dim_params_length);
ORT_API2_STATUS(GetTensorShapeElementCount, _In_ const OrtTensorTypeAndShapeInfo* info, _Out_ size_t* out);
ORT_API2_STATUS(GetTensorTypeAndShape, _In_ const OrtValue* value, _Outptr_ OrtTensorTypeAndShapeInfo** out);
ORT_API2_STATUS(GetTypeInfo, _In_ const OrtValue* value, _Outptr_result_maybenull_ OrtTypeInfo** out);
ORT_API2_STATUS(GetValueType, _In_ const OrtValue* value, _Out_ enum ONNXType* out);
ORT_API2_STATUS(CreateMemoryInfo, _In_ const char* name, enum OrtAllocatorType type, int id,
enum OrtMemType mem_type, _Outptr_ OrtMemoryInfo** out);
ORT_API2_STATUS(CreateCpuMemoryInfo, enum OrtAllocatorType type, enum OrtMemType mem_type,
_Outptr_ OrtMemoryInfo** out);
ORT_API2_STATUS(CompareMemoryInfo, _In_ const OrtMemoryInfo* info1, _In_ const OrtMemoryInfo* info2, _Out_ int* out);
ORT_API2_STATUS(MemoryInfoGetName, _In_ const OrtMemoryInfo* ptr, _Out_ const char** out);
ORT_API2_STATUS(MemoryInfoGetId, _In_ const OrtMemoryInfo* ptr, _Out_ int* out);
ORT_API2_STATUS(MemoryInfoGetMemType, _In_ const OrtMemoryInfo* ptr, _Out_ OrtMemType* out);
ORT_API2_STATUS(MemoryInfoGetType, _In_ const OrtMemoryInfo* ptr, _Out_ OrtAllocatorType* out);
ORT_API2_STATUS(AllocatorAlloc, _Inout_ OrtAllocator* ort_allocator, size_t size, _Outptr_ void** out);
ORT_API2_STATUS(AllocatorFree, _Inout_ OrtAllocator* ort_allocator, void* p);
ORT_API2_STATUS(AllocatorGetInfo, _In_ const OrtAllocator* ort_allocator, _Outptr_ const struct OrtMemoryInfo** out);
ORT_API2_STATUS(GetAllocatorWithDefaultOptions, _Outptr_ OrtAllocator** out);
ORT_API2_STATUS(AddFreeDimensionOverride, _Inout_ OrtSessionOptions* options, _In_ const char* dim_denotation,
_In_ int64_t dim_value);
/* Internal information (not seen in Doxygen)
*
* APIs to support non-tensor types - map and sequence.
* Currently only the following types are supported
* Note: the following types should be kept in sync with data_types.h
* Map types
* =========
* std::map<std::string, std::string>
* std::map<std::string, int64_t>
* std::map<std::string, float>
* std::map<std::string, double>
* std::map<int64_t, std::string>
* std::map<int64_t, int64_t>
* std::map<int64_t, float>
* std::map<int64_t, double>
*
* Sequence types
* ==============
* std::vector<std::string>
* std::vector<int64_t>
* std::vector<float>
* std::vector<double>
* std::vector<std::map<std::string, float>>
* std::vector<std::map<int64_t, float>
*/
ORT_API2_STATUS(GetValue, _In_ const OrtValue* value, int index, _Inout_ OrtAllocator* allocator,
_Outptr_ OrtValue** out);
ORT_API2_STATUS(GetValueCount, _In_ const OrtValue* value, _Out_ size_t* out);
ORT_API2_STATUS(CreateValue, _In_reads_(num_values) const OrtValue* const* in, size_t num_values,
enum ONNXType value_type, _Outptr_ OrtValue** out);
ORT_API2_STATUS(CreateOpaqueValue, _In_z_ const char* domain_name, _In_z_ const char* type_name,
_In_ const void* data_container, size_t data_container_size, _Outptr_ OrtValue** out);
ORT_API2_STATUS(GetOpaqueValue, _In_ const char* domain_name, _In_ const char* type_name, _In_ const OrtValue* in,
_Out_ void* data_container, size_t data_container_size);
ORT_API2_STATUS(KernelInfoGetAttribute_float, _In_ const OrtKernelInfo* info, _In_ const char* name,
_Out_ float* out);
ORT_API2_STATUS(KernelInfoGetAttribute_int64, _In_ const OrtKernelInfo* info, _In_ const char* name,
_Out_ int64_t* out);
ORT_API2_STATUS(KernelInfoGetAttribute_string, _In_ const OrtKernelInfo* info, _In_ const char* name, _Out_ char* out,
_Inout_ size_t* size);
ORT_API2_STATUS(KernelContext_GetInputCount, _In_ const OrtKernelContext* context, _Out_ size_t* out);
ORT_API2_STATUS(KernelContext_GetOutputCount, _In_ const OrtKernelContext* context, _Out_ size_t* out);
ORT_API2_STATUS(KernelContext_GetInput, _In_ const OrtKernelContext* context, _In_ size_t index,
_Out_ const OrtValue** out);
ORT_API2_STATUS(KernelContext_GetOutput, _Inout_ OrtKernelContext* context, _In_ size_t index,
_In_ const int64_t* dim_values, size_t dim_count, _Outptr_ OrtValue** out);
ORT_CLASS_RELEASE(Env);
ORT_CLASS_RELEASE(Status);
ORT_CLASS_RELEASE(MemoryInfo);
ORT_CLASS_RELEASE(Session); // Don't call ReleaseSession from Dllmain (because session owns a thread pool)
ORT_CLASS_RELEASE(Value);
ORT_CLASS_RELEASE(RunOptions);
ORT_CLASS_RELEASE(TypeInfo);
ORT_CLASS_RELEASE(TensorTypeAndShapeInfo);
ORT_CLASS_RELEASE(SessionOptions);
ORT_CLASS_RELEASE(CustomOpDomain);
ORT_API2_STATUS(GetDenotationFromTypeInfo, _In_ const OrtTypeInfo* type_info, _Out_ const char** const denotation,
_Out_ size_t* len);
ORT_API2_STATUS(CastTypeInfoToMapTypeInfo, _In_ const OrtTypeInfo* type_info,
_Outptr_result_maybenull_ const OrtMapTypeInfo** out);
ORT_API2_STATUS(CastTypeInfoToSequenceTypeInfo, _In_ const OrtTypeInfo* type_info,
_Outptr_result_maybenull_ const OrtSequenceTypeInfo** out);
ORT_API2_STATUS(GetMapKeyType, _In_ const OrtMapTypeInfo* map_type_info, _Out_ enum ONNXTensorElementDataType* out);
ORT_API2_STATUS(GetMapValueType, _In_ const OrtMapTypeInfo* map_type_info, _Outptr_ OrtTypeInfo** type_info);
ORT_API2_STATUS(GetSequenceElementType, _In_ const OrtSequenceTypeInfo* sequence_type_info,
_Outptr_ OrtTypeInfo** type_info);
ORT_CLASS_RELEASE(MapTypeInfo);
ORT_CLASS_RELEASE(SequenceTypeInfo);
ORT_API2_STATUS(SessionEndProfiling, _In_ OrtSession* session, _Inout_ OrtAllocator* allocator, _Outptr_ char** out);
ORT_API2_STATUS(SessionGetModelMetadata, _In_ const OrtSession* session, _Outptr_ OrtModelMetadata** out);
ORT_API2_STATUS(ModelMetadataGetProducerName, _In_ const OrtModelMetadata* model_metadata,
_Inout_ OrtAllocator* allocator, _Outptr_ char** value);
ORT_API2_STATUS(ModelMetadataGetGraphName, _In_ const OrtModelMetadata* model_metadata,
_Inout_ OrtAllocator* allocator, _Outptr_ char** value);
ORT_API2_STATUS(ModelMetadataGetDomain, _In_ const OrtModelMetadata* model_metadata, _Inout_ OrtAllocator* allocator,
_Outptr_ char** value);
ORT_API2_STATUS(ModelMetadataGetDescription, _In_ const OrtModelMetadata* model_metadata,
_Inout_ OrtAllocator* allocator, _Outptr_ char** value);
ORT_API2_STATUS(ModelMetadataLookupCustomMetadataMap, _In_ const OrtModelMetadata* model_metadata,
_Inout_ OrtAllocator* allocator, _In_ const char* key, _Outptr_result_maybenull_ char** value);
ORT_API2_STATUS(ModelMetadataGetVersion, _In_ const OrtModelMetadata* model_metadata, _Out_ int64_t* value);
ORT_CLASS_RELEASE(ModelMetadata);
ORT_API2_STATUS(CreateEnvWithGlobalThreadPools, OrtLoggingLevel log_severity_level, _In_ const char* logid,
_In_ const OrtThreadingOptions* tp_options, _Outptr_ OrtEnv** out);
ORT_API2_STATUS(DisablePerSessionThreads, _Inout_ OrtSessionOptions* options);
ORT_API2_STATUS(CreateThreadingOptions, _Outptr_ OrtThreadingOptions** out);
ORT_CLASS_RELEASE(ThreadingOptions);
ORT_API2_STATUS(ModelMetadataGetCustomMetadataMapKeys, _In_ const OrtModelMetadata* model_metadata,
_Inout_ OrtAllocator* allocator, _Outptr_result_buffer_maybenull_(*num_keys) char*** keys, _Out_ int64_t* num_keys);
ORT_API2_STATUS(AddFreeDimensionOverrideByName,
_Inout_ OrtSessionOptions* options, _In_ const char* dim_name,
_In_ int64_t dim_value);
ORT_API2_STATUS(GetAvailableProviders, _Outptr_ char*** out_ptr, _Out_ int* provider_length);
ORT_API2_STATUS(ReleaseAvailableProviders, _In_ char** ptr,
_In_ int providers_length);
ORT_API2_STATUS(GetStringTensorElementLength, _In_ const OrtValue* value, size_t index, _Out_ size_t* out);
ORT_API2_STATUS(GetStringTensorElement, _In_ const OrtValue* value, size_t s_len, size_t index, _Out_writes_bytes_all_(s_len) void* s);
ORT_API2_STATUS(FillStringTensorElement, _Inout_ OrtValue* value, _In_ const char* s, size_t index);
ORT_API2_STATUS(AddSessionConfigEntry, _Inout_ OrtSessionOptions* options,
_In_z_ const char* config_key, _In_z_ const char* config_value);
ORT_API2_STATUS(CreateAllocator, _In_ const OrtSession* session, _In_ const OrtMemoryInfo* mem_info,
_Outptr_ OrtAllocator** out);
ORT_CLASS_RELEASE(Allocator);
ORT_API2_STATUS(RunWithBinding, _Inout_ OrtSession* session, _In_ const OrtRunOptions* run_options, _In_ const OrtIoBinding* binding_ptr);
ORT_API2_STATUS(CreateIoBinding, _Inout_ OrtSession* session, _Outptr_ OrtIoBinding** out);
ORT_CLASS_RELEASE(IoBinding);
ORT_API2_STATUS(BindInput, _Inout_ OrtIoBinding* binding_ptr, _In_ const char* name, _In_ const OrtValue* val_ptr);
ORT_API2_STATUS(BindOutput, _Inout_ OrtIoBinding* binding_ptr, _In_ const char* name, _In_ const OrtValue* val_ptr);
ORT_API2_STATUS(BindOutputToDevice, _Inout_ OrtIoBinding* binding_ptr, _In_ const char* name, _In_ const OrtMemoryInfo* mem_info_ptr);
ORT_API2_STATUS(GetBoundOutputNames, _In_ const OrtIoBinding* binding_ptr, _In_ OrtAllocator* allocator,
_Out_ char** buffer, _Out_writes_all_(count) size_t** lengths, _Out_ size_t* count);
ORT_API2_STATUS(GetBoundOutputValues, _In_ const OrtIoBinding* binding_ptr, _In_ OrtAllocator* allocator,
_Out_writes_all_(output_count) OrtValue*** output, _Out_ size_t* output_count);
void(ORT_API_CALL* ClearBoundInputs)(_Inout_ OrtIoBinding* binding_ptr) NO_EXCEPTION ORT_ALL_ARGS_NONNULL;
void(ORT_API_CALL* ClearBoundOutputs)(_Inout_ OrtIoBinding* binding_ptr) NO_EXCEPTION ORT_ALL_ARGS_NONNULL;
ORT_API2_STATUS(TensorAt, _Inout_ OrtValue* value, const int64_t* location_values, size_t location_values_count, _Outptr_ void** out);
ORT_API2_STATUS(CreateAndRegisterAllocator, _Inout_ OrtEnv* env, _In_ const OrtMemoryInfo* mem_info,
_In_ const OrtArenaCfg* arena_cfg);
ORT_API2_STATUS(SetLanguageProjection, _In_ const OrtEnv* ort_env, _In_ OrtLanguageProjection projection);
ORT_API2_STATUS(SessionGetProfilingStartTimeNs, _In_ const OrtSession* session, _Outptr_ uint64_t* out);
ORT_API2_STATUS(SetGlobalIntraOpNumThreads, _Inout_ OrtThreadingOptions* tp_options, int intra_op_num_threads);
ORT_API2_STATUS(SetGlobalInterOpNumThreads, _Inout_ OrtThreadingOptions* tp_options, int inter_op_num_threads);
ORT_API2_STATUS(SetGlobalSpinControl, _Inout_ OrtThreadingOptions* tp_options, int allow_spinning);
ORT_API2_STATUS(AddInitializer, _Inout_ OrtSessionOptions* options, _In_z_ const char* name,
_In_ const OrtValue* val);
ORT_API2_STATUS(CreateEnvWithCustomLoggerAndGlobalThreadPools, OrtLoggingFunction logging_function, _In_opt_ void* logger_param, OrtLoggingLevel log_severity_level,
_In_ const char* logid, _In_ const struct OrtThreadingOptions* tp_options, _Outptr_ OrtEnv** out);
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_CUDA,
_In_ OrtSessionOptions* options, _In_ const OrtCUDAProviderOptions* cuda_options);
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_ROCM,
_In_ OrtSessionOptions* options, _In_ const OrtROCMProviderOptions* rocm_options);
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_OpenVINO,
_In_ OrtSessionOptions* options, _In_ const OrtOpenVINOProviderOptions* provider_options);
ORT_API2_STATUS(SetGlobalDenormalAsZero, _Inout_ OrtThreadingOptions* tp_options);
ORT_API2_STATUS(CreateArenaCfg, _In_ size_t max_mem, int arena_extend_strategy, int initial_chunk_size_bytes,
int max_dead_bytes_per_chunk, _Outptr_ OrtArenaCfg** out);
ORT_CLASS_RELEASE(ArenaCfg);
ORT_API2_STATUS(ModelMetadataGetGraphDescription, _In_ const OrtModelMetadata* model_metadata,
_Inout_ OrtAllocator* allocator, _Outptr_ char** value);
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_TensorRT,
_In_ OrtSessionOptions* options, _In_ const OrtTensorRTProviderOptions* tensorrt_options);
ORT_API2_STATUS(SetCurrentGpuDeviceId, _In_ int device_id);
ORT_API2_STATUS(GetCurrentGpuDeviceId, _In_ int* device_id);
ORT_API2_STATUS(KernelInfoGetAttributeArray_float, _In_ const OrtKernelInfo* info, _In_ const char* name,
_Out_ float* out, _Inout_ size_t* size);
ORT_API2_STATUS(KernelInfoGetAttributeArray_int64, _In_ const OrtKernelInfo* info, _In_ const char* name,
_Out_ int64_t* out, _Inout_ size_t* size);
ORT_API2_STATUS(CreateArenaCfgV2, _In_reads_(num_keys) const char* const* arena_config_keys,
_In_reads_(num_keys) const size_t* arena_config_values, _In_ size_t num_keys,
_Outptr_ OrtArenaCfg** out);
ORT_API2_STATUS(AddRunConfigEntry, _Inout_ OrtRunOptions* options,
_In_z_ const char* config_key, _In_z_ const char* config_value);
ORT_API2_STATUS(CreatePrepackedWeightsContainer, _Outptr_ OrtPrepackedWeightsContainer** out);
ORT_CLASS_RELEASE(PrepackedWeightsContainer);
ORT_API2_STATUS(CreateSessionWithPrepackedWeightsContainer, _In_ const OrtEnv* env, _In_ const ORTCHAR_T* model_path,
_In_ const OrtSessionOptions* options, _Inout_ OrtPrepackedWeightsContainer* prepacked_weights_container,
_Outptr_ OrtSession** out);
ORT_API2_STATUS(CreateSessionFromArrayWithPrepackedWeightsContainer, _In_ const OrtEnv* env,
_In_ const void* model_data, size_t model_data_length,
_In_ const OrtSessionOptions* options, _Inout_ OrtPrepackedWeightsContainer* prepacked_weights_container,
_Outptr_ OrtSession** out);
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_TensorRT_V2,
_In_ OrtSessionOptions* options, _In_ const OrtTensorRTProviderOptionsV2* tensorrt_options);
ORT_API2_STATUS(CreateTensorRTProviderOptions, _Outptr_ OrtTensorRTProviderOptionsV2** out);
ORT_API2_STATUS(UpdateTensorRTProviderOptions, _Inout_ OrtTensorRTProviderOptionsV2* tensorrt_options,
_In_reads_(num_keys) const char* const* provider_options_keys,
_In_reads_(num_keys) const char* const* provider_options_values,
_In_ size_t num_keys);
ORT_API2_STATUS(GetTensorRTProviderOptionsAsString, _In_ const OrtTensorRTProviderOptionsV2* tensorrt_options, _Inout_ OrtAllocator* allocator, _Outptr_ char** ptr);
void(ORT_API_CALL* ReleaseTensorRTProviderOptions)(_Frees_ptr_opt_ OrtTensorRTProviderOptionsV2* input);
ORT_API2_STATUS(EnableOrtCustomOps, _Inout_ OrtSessionOptions* options);
ORT_API2_STATUS(RegisterAllocator, _Inout_ OrtEnv* env, _In_ OrtAllocator* allocator);
ORT_API2_STATUS(UnregisterAllocator, _Inout_ OrtEnv* env,
_In_ const OrtMemoryInfo* mem_info);
ORT_API2_STATUS(IsSparseTensor, _In_ const OrtValue* value, _Out_ int* out);
ORT_API2_STATUS(CreateSparseTensorAsOrtValue, _Inout_ OrtAllocator* allocator, _In_ const int64_t* dense_shape,
size_t dense_shape_len, ONNXTensorElementDataType type, _Outptr_ OrtValue** out);
ORT_API2_STATUS(FillSparseTensorCoo, _Inout_ OrtValue* ort_value, _In_ const OrtMemoryInfo* data_mem_info,
_In_ const int64_t* values_shape, size_t values_shape_len, _In_ const void* values,
_In_ const int64_t* indices_data, size_t indices_num);
ORT_API2_STATUS(FillSparseTensorCsr, _Inout_ OrtValue* ort_value, _In_ const OrtMemoryInfo* data_mem_info,
_In_ const int64_t* values_shape, size_t values_shape_len, _In_ const void* values,
_In_ const int64_t* inner_indices_data, size_t inner_indices_num,
_In_ const int64_t* outer_indices_data, size_t outer_indices_num);
ORT_API2_STATUS(FillSparseTensorBlockSparse, _Inout_ OrtValue* ort_value, _In_ const OrtMemoryInfo* data_mem_info,
_In_ const int64_t* values_shape, size_t values_shape_len, _In_ const void* values,
_In_ const int64_t* indices_shape_data, size_t indices_shape_len,
_In_ const int32_t* indices_data);
ORT_API2_STATUS(CreateSparseTensorWithValuesAsOrtValue, _In_ const OrtMemoryInfo* info, _Inout_ void* p_data,
_In_ const int64_t* dense_shape, size_t dense_shape_len,
_In_ const int64_t* values_shape, size_t values_shape_len,
ONNXTensorElementDataType type, _Outptr_ OrtValue** out);
ORT_API2_STATUS(UseCooIndices, _Inout_ OrtValue* ort_value, _Inout_ int64_t* indices_data, size_t indices_num);
ORT_API2_STATUS(UseCsrIndices, _Inout_ OrtValue* ort_value, _Inout_ int64_t* inner_data, size_t inner_num,
_Inout_ int64_t* outer_data, size_t outer_num);
ORT_API2_STATUS(UseBlockSparseIndices, _Inout_ OrtValue* ort_value, const int64_t* indices_shape, size_t indices_shape_len, _Inout_ int32_t* indices_data);
ORT_API2_STATUS(GetSparseTensorFormat, _In_ const OrtValue* ort_value, _Out_ enum OrtSparseFormat* out);
ORT_API2_STATUS(GetSparseTensorValuesTypeAndShape, _In_ const OrtValue* ort_value, _Outptr_ OrtTensorTypeAndShapeInfo** out);
ORT_API2_STATUS(GetSparseTensorValues, _In_ const OrtValue* ort_value, _Outptr_ const void** out);
ORT_API2_STATUS(GetSparseTensorIndicesTypeShape, _In_ const OrtValue* ort_value, enum OrtSparseIndicesFormat indices_format, _Outptr_ OrtTensorTypeAndShapeInfo** out);
ORT_API2_STATUS(GetSparseTensorIndices, _In_ const OrtValue* ort_value, enum OrtSparseIndicesFormat indices_format, _Out_ size_t* num_indices, _Outptr_ const void** indices);
ORT_API2_STATUS(HasValue, _In_ const OrtValue* value, _Out_ int* out);
ORT_API2_STATUS(KernelContext_GetGPUComputeStream, _In_ const OrtKernelContext* context, _Outptr_ void** out);
ORT_API2_STATUS(GetTensorMemoryInfo, _In_ const OrtValue* value, _Out_ const OrtMemoryInfo** mem_info);
ORT_API2_STATUS(GetExecutionProviderApi, _In_ const char* provider_name, _In_ uint32_t version, _Outptr_ const void** provider_api);
ORT_API2_STATUS(SessionOptionsSetCustomCreateThreadFn, _Inout_ OrtSessionOptions* options, _In_ OrtCustomCreateThreadFn ort_custom_create_thread_fn);
ORT_API2_STATUS(SessionOptionsSetCustomThreadCreationOptions, _Inout_ OrtSessionOptions* options, _In_ void* ort_custom_thread_creation_options);
ORT_API2_STATUS(SessionOptionsSetCustomJoinThreadFn, _Inout_ OrtSessionOptions* options, _In_ OrtCustomJoinThreadFn ort_custom_join_thread_fn);
ORT_API2_STATUS(SetGlobalCustomCreateThreadFn, _Inout_ OrtThreadingOptions* tp_options, _In_ OrtCustomCreateThreadFn ort_custom_create_thread_fn);
ORT_API2_STATUS(SetGlobalCustomThreadCreationOptions, _Inout_ OrtThreadingOptions* tp_options, _In_ void* ort_custom_thread_creation_options);
ORT_API2_STATUS(SetGlobalCustomJoinThreadFn, _Inout_ OrtThreadingOptions* tp_options, _In_ OrtCustomJoinThreadFn ort_custom_join_thread_fn);
ORT_API2_STATUS(SynchronizeBoundInputs, _Inout_ OrtIoBinding* binding_ptr);
ORT_API2_STATUS(SynchronizeBoundOutputs, _Inout_ OrtIoBinding* binding_ptr);
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_CUDA_V2,
_In_ OrtSessionOptions* options, _In_ const OrtCUDAProviderOptionsV2* cuda_options);
ORT_API2_STATUS(CreateCUDAProviderOptions, _Outptr_ OrtCUDAProviderOptionsV2** out);
ORT_API2_STATUS(UpdateCUDAProviderOptions, _Inout_ OrtCUDAProviderOptionsV2* cuda_options,
_In_reads_(num_keys) const char* const* provider_options_keys,
_In_reads_(num_keys) const char* const* provider_options_values,
_In_ size_t num_keys);
ORT_API2_STATUS(GetCUDAProviderOptionsAsString, _In_ const OrtCUDAProviderOptionsV2* cuda_options, _Inout_ OrtAllocator* allocator, _Outptr_ char** ptr);
void(ORT_API_CALL* ReleaseCUDAProviderOptions)(_Frees_ptr_opt_ OrtCUDAProviderOptionsV2* input);
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_MIGraphX,
_In_ OrtSessionOptions* options, _In_ const OrtMIGraphXProviderOptions* migraphx_options);
ORT_API2_STATUS(AddExternalInitializers, _In_ OrtSessionOptions* options,
_In_reads_(input_len) const char* const* initializer_names,
_In_reads_(input_len) const OrtValue* const* initializers, size_t initializers_num);
ORT_API2_STATUS(CreateOpAttr,
_In_ const char* name,
_In_ const void* data,
_In_ int len,
_In_ OrtOpAttrType type,
_Outptr_ OrtOpAttr** op_attr);
/* \brief: Release op attribute
*
* \param[in] opAttr Attribute created by OrtApi::CreateOpAttr
*
* \since Version 1.12.
*/
ORT_CLASS_RELEASE(OpAttr);
ORT_API2_STATUS(CreateOp,
_In_ const OrtKernelInfo* info,
_In_ const char* op_name,
_In_ const char* domain,
_In_ int version,
_In_opt_ const char** type_constraint_names,
_In_opt_ const ONNXTensorElementDataType* type_constraint_values,
_In_opt_ int type_constraint_count,
_In_opt_ const OrtOpAttr* const* attr_values,
_In_opt_ int attr_count,
_In_ int input_count,
_In_ int output_count,
_Outptr_ OrtOp** ort_op);
ORT_API2_STATUS(InvokeOp,
_In_ const OrtKernelContext* context,
_In_ const OrtOp* ort_op,
_In_ const OrtValue* const* input_values,
_In_ int input_count,
_Inout_ OrtValue* const* output_values,
_In_ int output_count);
/* \brief: Release an onnxruntime operator
*
* \param[in] Op Operator created by OrtApi::CreateOp
*
* \since Version 1.12.
*/
ORT_CLASS_RELEASE(Op);
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider, _In_ OrtSessionOptions* options,
_In_ const char* provider_name,
_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);
/* \brief: Get a copy of kernel info
*
* \param[in] info Kernel info
* \param[out] info_copy Copy of kernel info
*
* \since Version 1.12.
*/
ORT_API2_STATUS(CopyKernelInfo,
_In_ const OrtKernelInfo* info,
_Outptr_ OrtKernelInfo** info_copy);
/* \brief: Release kernel info
*
* \param[in] KernelInfo A copy of kernel info returned by CopyKernelInfo
*
* \since Version 1.12.
*/
ORT_CLASS_RELEASE(KernelInfo);
/* \brief: Get the training C Api
*
* \param[in] version Must be ::ORT_API_VERSION
* \return The ::OrtTrainingApi for the version requested.
* nullptr will be returned and no error message will be printed if the training api is not supported with
* this build.
* nullptr will be returned and an error message will be printed if the provided version is unsupported, for
* example when using a runtime older than the version created with this header file.
*
* \since Version 1.13
*/
const OrtTrainingApi*(ORT_API_CALL* GetTrainingApi)(uint32_t version)NO_EXCEPTION;
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_CANN,
_In_ OrtSessionOptions* options, _In_ const OrtCANNProviderOptions* cann_options);
ORT_API2_STATUS(CreateCANNProviderOptions, _Outptr_ OrtCANNProviderOptions** out);
ORT_API2_STATUS(UpdateCANNProviderOptions, _Inout_ OrtCANNProviderOptions* cann_options,
_In_reads_(num_keys) const char* const* provider_options_keys,
_In_reads_(num_keys) const char* const* provider_options_values,
_In_ size_t num_keys);
ORT_API2_STATUS(GetCANNProviderOptionsAsString, _In_ const OrtCANNProviderOptions* cann_options,
_Inout_ OrtAllocator* allocator, _Outptr_ char** ptr);
void(ORT_API_CALL* ReleaseCANNProviderOptions)(_Frees_ptr_opt_ OrtCANNProviderOptions* input);
/* \brief Get OrtDevice type from MemoryInfo
*
* \since Version 1.14
*/
void(ORT_API_CALL* MemoryInfoGetDeviceType)(_In_ const OrtMemoryInfo* ptr, _Out_ OrtMemoryInfoDeviceType* out);
/* \brief Update the OrtEnv instance with custom log severity level
*
* \param[in] ort_env The OrtEnv instance being used
* \param[in] log_severity_level The log severity level.
*
* \since Version 1.14.
*/
ORT_API2_STATUS(UpdateEnvWithCustomLogLevel, _In_ OrtEnv* ort_env, OrtLoggingLevel log_severity_level);
/* \brief Set affinities for intra op threads
*
* Affinity string follows format:
* logical_processor_id,logical_processor_id;logical_processor_id,logical_processor_id
* Semicolon isolates configurations among threads, while comma split processors where ith thread expected to attach to.
* e.g. 1,2,3;4,5
* specifies affinities for two threads, with the 1st thread attach to the 1st, 2nd, and 3rd processor, and 2nd thread to the 4th and 5th.
* To ease the configuration, an "interval" is also allowed:
* e.g. 1-8;8-16;17-24
* orders that the 1st thread runs on first eight processors, 2nd thread runs on next eight processors, and so forth.
* Note:
* 1. Once set, the number of thread affinities must equal to intra_op_num_threads - 1,
* ort does not set affinity on the main thread which is started and managed by the calling app;
* 2. For windows, ort will infer the group id from a logical processor id, for example, assuming there are two groups with each has 64 logical processors,
* an id of 64 will be inferred as the last processor of the 1st group, while 65 will be interpreted as the 1st processor of the second group.
* Hence 64-65 is an invalid configuration, because a windows thread cannot be attached to processors across group boundary.
*
* \since Version 1.14
*/
ORT_API2_STATUS(SetGlobalIntraOpThreadAffinity, _Inout_ OrtThreadingOptions* tp_options, const char* affinity_string);
ORT_API2_STATUS(RegisterCustomOpsLibrary_V2, _Inout_ OrtSessionOptions* options, _In_ const ORTCHAR_T* library_name);
ORT_API2_STATUS(RegisterCustomOpsUsingFunction, _Inout_ OrtSessionOptions* options,
_In_ const char* registration_func_name);
ORT_API2_STATUS(KernelInfo_GetInputCount, _In_ const OrtKernelInfo* info, _Out_ size_t* out);
ORT_API2_STATUS(KernelInfo_GetOutputCount, _In_ const OrtKernelInfo* info, _Out_ size_t* out);
ORT_API2_STATUS(KernelInfo_GetInputName, _In_ const OrtKernelInfo* info, size_t index, _Out_ char* out,
_Inout_ size_t* size);
ORT_API2_STATUS(KernelInfo_GetOutputName, _In_ const OrtKernelInfo* info, size_t index, _Out_ char* out,
_Inout_ size_t* size);
ORT_API2_STATUS(KernelInfo_GetInputTypeInfo, _In_ const OrtKernelInfo* info, size_t index,
_Outptr_ OrtTypeInfo** type_info);
ORT_API2_STATUS(KernelInfo_GetOutputTypeInfo, _In_ const OrtKernelInfo* info, size_t index,
_Outptr_ OrtTypeInfo** type_info);
ORT_API2_STATUS(KernelInfoGetAttribute_tensor, _In_ const OrtKernelInfo* info, _In_z_ const char* name,
_Inout_ OrtAllocator* allocator, _Outptr_ OrtValue** out);
ORT_API2_STATUS(HasSessionConfigEntry, _In_ const OrtSessionOptions* options,
_In_z_ const char* config_key, _Out_ int* out);
ORT_API2_STATUS(GetSessionConfigEntry, _In_ const OrtSessionOptions* options,
_In_z_ const char* config_key, _Out_ char* config_value, _Inout_ size_t* size);
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_Dnnl,
_In_ OrtSessionOptions* options, _In_ const OrtDnnlProviderOptions* dnnl_options);
ORT_API2_STATUS(CreateDnnlProviderOptions, _Outptr_ OrtDnnlProviderOptions** out);
ORT_API2_STATUS(UpdateDnnlProviderOptions, _Inout_ OrtDnnlProviderOptions* dnnl_options,
_In_reads_(num_keys) const char* const* provider_options_keys,
_In_reads_(num_keys) const char* const* provider_options_values,
_In_ size_t num_keys);
ORT_API2_STATUS(GetDnnlProviderOptionsAsString, _In_ const OrtDnnlProviderOptions* dnnl_options, _Inout_ OrtAllocator* allocator, _Outptr_ char** ptr);
void(ORT_API_CALL* ReleaseDnnlProviderOptions)(_Frees_ptr_opt_ OrtDnnlProviderOptions* input);
#ifdef __cplusplus
OrtApi(const OrtApi&) = delete; // Prevent users from accidentally copying the API structure, it should always be passed as a pointer
#endif
};
/*
* Steps to use a custom op:
* 1 Create an OrtCustomOpDomain with the domain name used by the custom ops
* 2 Create an OrtCustomOp structure for each op and add them to the domain
* 3 Call OrtAddCustomOpDomain to add the custom domain of ops to the session options
*/
// Specifies some characteristics of inputs/outputs of custom ops:
// Specify if the inputs/outputs are one of:
// 1) Non-optional (input/output must be present in the node)
// 2) Optional (input/output may be absent in the node)
// 3) Variadic: A variadic input or output specifies N (i.e., the minimum arity) or more operands.
// Only the last input or output of a custom op may be marked as variadic.
// The homogeneity of the variadic input or output determines whether all operands must be of the same
// tensor element type.
typedef enum OrtCustomOpInputOutputCharacteristic {
INPUT_OUTPUT_REQUIRED = 0,
INPUT_OUTPUT_OPTIONAL,
INPUT_OUTPUT_VARIADIC,
} OrtCustomOpInputOutputCharacteristic;
/*
* The OrtCustomOp structure defines a custom op's schema and its kernel callbacks. The callbacks are filled in by
* the implementor of the custom op.
*/
struct OrtCustomOp {
uint32_t version; // Must be initialized to ORT_API_VERSION
// This callback creates the kernel, which is a user defined parameter that is passed to the Kernel* callbacks below.
void*(ORT_API_CALL* CreateKernel)(_In_ const struct OrtCustomOp* op, _In_ const OrtApi* api,
_In_ const OrtKernelInfo* info);
// Returns the name of the op
const char*(ORT_API_CALL* GetName)(_In_ const struct OrtCustomOp* op);
// Returns the type of the execution provider, return nullptr to use CPU execution provider
const char*(ORT_API_CALL* GetExecutionProviderType)(_In_ const struct OrtCustomOp* op);
// Returns the count and types of the input & output tensors
ONNXTensorElementDataType(ORT_API_CALL* GetInputType)(_In_ const struct OrtCustomOp* op, _In_ size_t index);
size_t(ORT_API_CALL* GetInputTypeCount)(_In_ const struct OrtCustomOp* op);
ONNXTensorElementDataType(ORT_API_CALL* GetOutputType)(_In_ const struct OrtCustomOp* op, _In_ size_t index);
size_t(ORT_API_CALL* GetOutputTypeCount)(_In_ const struct OrtCustomOp* op);
// Op kernel callbacks
void(ORT_API_CALL* KernelCompute)(_In_ void* op_kernel, _In_ OrtKernelContext* context);
void(ORT_API_CALL* KernelDestroy)(_In_ void* op_kernel);
// Returns the characteristics of the input & output tensors
OrtCustomOpInputOutputCharacteristic(ORT_API_CALL* GetInputCharacteristic)(_In_ const struct OrtCustomOp* op, _In_ size_t index);
OrtCustomOpInputOutputCharacteristic(ORT_API_CALL* GetOutputCharacteristic)(_In_ const struct OrtCustomOp* op, _In_ size_t index);
// Returns the memory type of the input tensors. This API allows the custom op
// to place the inputs on specific devices. By default, it returns
// OrtMemTypeDefault, which means the input is placed on the default device for
// the execution provider. If the inputs need to be with different memory tyeps,
// this function can be overridden to return the specific memory types.
OrtMemType(ORT_API_CALL* GetInputMemoryType)(_In_ const struct OrtCustomOp* op, _In_ size_t index);
// Returns the minimum number of input arguments expected for the variadic input.
// Applicable only for custom ops that have a variadic input.
int(ORT_API_CALL* GetVariadicInputMinArity)(_In_ const struct OrtCustomOp* op);
// Returns true (non-zero) if all arguments of a variadic input have to be of the same type (homogeneous),
// and false (zero) otherwise.
// Applicable only for custom ops that have a variadic input.
int(ORT_API_CALL* GetVariadicInputHomogeneity)(_In_ const struct OrtCustomOp* op);
// Returns the minimum number of output values expected for the variadic output.
// Applicable only for custom ops that have a variadic output.
int(ORT_API_CALL* GetVariadicOutputMinArity)(_In_ const struct OrtCustomOp* op);
// Returns true (non-zero) if all outputs values of a variadic output have to be of the same type (homogeneous),
// and false (zero) otherwise.
// Applicable only for custom ops that have a variadic output.
int(ORT_API_CALL* GetVariadicOutputHomogeneity)(_In_ const struct OrtCustomOp* op);
};
/*
* This is the old way to add the CUDA provider to the session, please use SessionOptionsAppendExecutionProvider_CUDA above to access the latest functionality
* This function always exists, but will only succeed if Onnxruntime was built with CUDA support and the CUDA provider shared library exists
*
* \param device_id CUDA device id, starts from zero.
*/
ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_CUDA, _In_ OrtSessionOptions* options, int device_id);
/*
* This is the old way to add the MIGraphX provider to the session, please use
* SessionOptionsAppendExecutionProvider_MIGraphX above to access the latest functionality
* This function always exists, but will only succeed if Onnxruntime was built with
* HIP support and the MIGraphX provider shared library exists
*
* \param device_id HIP device id, starts from zero.
*/
ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_MIGraphX, _In_ OrtSessionOptions* options, int device_id);
/*
* This is the old way to add the oneDNN provider to the session, please use
* SessionOptionsAppendExecutionProvider_oneDNN above to access the latest functionality
* This function always exists, but will only succeed if Onnxruntime was built with
* oneDNN support and the oneDNN provider shared library exists
*
* \param use_arena zero: false. non-zero: true.
*/
ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_Dnnl, _In_ OrtSessionOptions* options, int use_arena);
#ifdef __cplusplus
}
#endif
OrtSessionOptionsAppendExecutionProvider_MIGraphX
OrtStatus * OrtSessionOptionsAppendExecutionProvider_MIGraphX(OrtSessionOptions *options, int device_id)
OrtMemoryInfo
struct OrtMemoryInfo OrtMemoryInfo
Definition: onnxruntime_c_api.h:252
OrtKernelInfo
struct OrtKernelInfo OrtKernelInfo
Definition: onnxruntime_c_api.h:329
OrtLoggingLevel
OrtLoggingLevel
Logging severity levels.
Definition: onnxruntime_c_api.h:207
OrtCustomThreadHandle
const struct OrtCustomHandleType * OrtCustomThreadHandle
OrtMemoryInfoDeviceType
OrtMemoryInfoDeviceType
This mimics OrtDevice type constants so they can be returned in the API.
Definition: onnxruntime_c_api.h:353
OrtLoggingFunction
void(* OrtLoggingFunction)(void *param, OrtLoggingLevel severity, const char *category, const char *logid, const char *code_location, const char *message)
Definition: onnxruntime_c_api.h:294
OrtCustomJoinThreadFn
void(* OrtCustomJoinThreadFn)(OrtCustomThreadHandle ort_custom_thread_handle)
Custom thread join function.
Definition: onnxruntime_c_api.h:627
RegisterCustomOpsFn
OrtStatus *(* RegisterCustomOpsFn)(OrtSessionOptions *options, const OrtApiBase *api)
Definition: onnxruntime_c_api.h:629
OrtCustomOpInputOutputCharacteristic
OrtCustomOpInputOutputCharacteristic
Definition: onnxruntime_c_api.h:3979
OrtTensorRTProviderOptionsV2
struct OrtTensorRTProviderOptionsV2 OrtTensorRTProviderOptionsV2
Definition: onnxruntime_c_api.h:268
OrtOpAttr
struct OrtOpAttr OrtOpAttr
Definition: onnxruntime_c_api.h:273
OrtThreadingOptions
struct OrtThreadingOptions OrtThreadingOptions
Definition: onnxruntime_c_api.h:265
OrtSequenceTypeInfo
struct OrtSequenceTypeInfo OrtSequenceTypeInfo
Definition: onnxruntime_c_api.h:262
OrtLanguageProjection
OrtLanguageProjection
Language projection identifiers /see OrtApi::SetLanguageProjection.
Definition: onnxruntime_c_api.h:318
OrtDnnlProviderOptions
struct OrtDnnlProviderOptions OrtDnnlProviderOptions
Definition: onnxruntime_c_api.h:271
OrtSparseIndicesFormat
OrtSparseIndicesFormat
Definition: onnxruntime_c_api.h:196
OrtPrepackedWeightsContainer
struct OrtPrepackedWeightsContainer OrtPrepackedWeightsContainer
Definition: onnxruntime_c_api.h:267
OrtSession
struct OrtSession OrtSession
Definition: onnxruntime_c_api.h:254
OrtCustomOpDomain
struct OrtCustomOpDomain OrtCustomOpDomain
Definition: onnxruntime_c_api.h:260
OrtIoBinding
struct OrtIoBinding OrtIoBinding
Definition: onnxruntime_c_api.h:253
OrtAllocatorType
OrtAllocatorType
Definition: onnxruntime_c_api.h:335
OrtOp
struct OrtOp OrtOp
Definition: onnxruntime_c_api.h:272
OrtModelMetadata
struct OrtModelMetadata OrtModelMetadata
Definition: onnxruntime_c_api.h:263
OrtTypeInfo
struct OrtTypeInfo OrtTypeInfo
Definition: onnxruntime_c_api.h:257
OrtTensorTypeAndShapeInfo
struct OrtTensorTypeAndShapeInfo OrtTensorTypeAndShapeInfo
Definition: onnxruntime_c_api.h:258
OrtCUDAProviderOptionsV2
struct OrtCUDAProviderOptionsV2 OrtCUDAProviderOptionsV2
Definition: onnxruntime_c_api.h:269
OrtKernelContext
struct OrtKernelContext OrtKernelContext
Definition: onnxruntime_c_api.h:331
OrtSessionOptionsAppendExecutionProvider_Dnnl
OrtStatus * OrtSessionOptionsAppendExecutionProvider_Dnnl(OrtSessionOptions *options, int use_arena)
OrtCudnnConvAlgoSearch
OrtCudnnConvAlgoSearch
Algorithm to use for cuDNN Convolution Op.
Definition: onnxruntime_c_api.h:361
OrtCANNProviderOptions
struct OrtCANNProviderOptions OrtCANNProviderOptions
Definition: onnxruntime_c_api.h:270
OrtRunOptions
struct OrtRunOptions OrtRunOptions
Definition: onnxruntime_c_api.h:256
OrtThreadWorkerFn
void(* OrtThreadWorkerFn)(void *ort_worker_fn_param)
Thread work loop function.
Definition: onnxruntime_c_api.h:609
OrtSessionOptions
struct OrtSessionOptions OrtSessionOptions
Definition: onnxruntime_c_api.h:259
OrtValue
struct OrtValue OrtValue
Definition: onnxruntime_c_api.h:255
GraphOptimizationLevel
GraphOptimizationLevel
Graph optimization level.
Definition: onnxruntime_c_api.h:303
OrtStatusPtr
OrtStatus * OrtStatusPtr
Definition: onnxruntime_c_api.h:278
OrtMemType
OrtMemType
Memory types for allocated memory, execution provider specific types should be extended in each provi...
Definition: onnxruntime_c_api.h:344
OrtSparseFormat
OrtSparseFormat
Definition: onnxruntime_c_api.h:188
ONNXType
ONNXType
Definition: onnxruntime_c_api.h:176
OrtEnv
struct OrtEnv OrtEnv
Definition: onnxruntime_c_api.h:250
OrtErrorCode
OrtErrorCode
Definition: onnxruntime_c_api.h:215
OrtStatus
struct OrtStatus OrtStatus
Definition: onnxruntime_c_api.h:251
OrtTrainingApi
struct OrtTrainingApi OrtTrainingApi
Definition: onnxruntime_c_api.h:580
OrtMapTypeInfo
struct OrtMapTypeInfo OrtMapTypeInfo
Definition: onnxruntime_c_api.h:261
OrtArenaCfg
struct OrtArenaCfg OrtArenaCfg
Definition: onnxruntime_c_api.h:266
ExecutionMode
ExecutionMode
Definition: onnxruntime_c_api.h:310
OrtSessionOptionsAppendExecutionProvider_CUDA
OrtStatus * OrtSessionOptionsAppendExecutionProvider_CUDA(OrtSessionOptions *options, int device_id)
OrtOpAttrType
OrtOpAttrType
Definition: onnxruntime_c_api.h:230
OrtCustomCreateThreadFn
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:620
ONNXTensorElementDataType
ONNXTensorElementDataType
Definition: onnxruntime_c_api.h:155
OrtGetApiBase
const OrtApiBase * OrtGetApiBase(void)
The Onnxruntime library's entry point to access the C API.
ORT_LOGGING_LEVEL_VERBOSE
@ ORT_LOGGING_LEVEL_VERBOSE
Verbose informational messages (least severe).
Definition: onnxruntime_c_api.h:208
ORT_LOGGING_LEVEL_INFO
@ ORT_LOGGING_LEVEL_INFO
Informational messages.
Definition: onnxruntime_c_api.h:209
ORT_LOGGING_LEVEL_ERROR
@ ORT_LOGGING_LEVEL_ERROR
Error messages.
Definition: onnxruntime_c_api.h:211
ORT_LOGGING_LEVEL_WARNING
@ ORT_LOGGING_LEVEL_WARNING
Warning messages.
Definition: onnxruntime_c_api.h:210
ORT_LOGGING_LEVEL_FATAL
@ ORT_LOGGING_LEVEL_FATAL
Fatal error messages (most severe).
Definition: onnxruntime_c_api.h:212
OrtMemoryInfoDeviceType_GPU
@ OrtMemoryInfoDeviceType_GPU
Definition: onnxruntime_c_api.h:355
OrtMemoryInfoDeviceType_FPGA
@ OrtMemoryInfoDeviceType_FPGA
Definition: onnxruntime_c_api.h:356
OrtMemoryInfoDeviceType_CPU
@ OrtMemoryInfoDeviceType_CPU
Definition: onnxruntime_c_api.h:354
INPUT_OUTPUT_VARIADIC
@ INPUT_OUTPUT_VARIADIC
Definition: onnxruntime_c_api.h:3982
INPUT_OUTPUT_REQUIRED
@ INPUT_OUTPUT_REQUIRED
Definition: onnxruntime_c_api.h:3980
INPUT_OUTPUT_OPTIONAL
@ INPUT_OUTPUT_OPTIONAL
Definition: onnxruntime_c_api.h:3981
ORT_PROJECTION_C
@ ORT_PROJECTION_C
Definition: onnxruntime_c_api.h:319
ORT_PROJECTION_PYTHON
@ ORT_PROJECTION_PYTHON
Definition: onnxruntime_c_api.h:322
ORT_PROJECTION_CPLUSPLUS
@ ORT_PROJECTION_CPLUSPLUS
Definition: onnxruntime_c_api.h:320
ORT_PROJECTION_WINML
@ ORT_PROJECTION_WINML
Definition: onnxruntime_c_api.h:324
ORT_PROJECTION_CSHARP
@ ORT_PROJECTION_CSHARP
Definition: onnxruntime_c_api.h:321
ORT_PROJECTION_JAVA
@ ORT_PROJECTION_JAVA
Definition: onnxruntime_c_api.h:323
ORT_PROJECTION_NODEJS
@ ORT_PROJECTION_NODEJS
Definition: onnxruntime_c_api.h:325
ORT_SPARSE_COO_INDICES
@ ORT_SPARSE_COO_INDICES
Definition: onnxruntime_c_api.h:197
ORT_SPARSE_BLOCK_SPARSE_INDICES
@ ORT_SPARSE_BLOCK_SPARSE_INDICES
Definition: onnxruntime_c_api.h:200
ORT_SPARSE_CSR_OUTER_INDICES
@ ORT_SPARSE_CSR_OUTER_INDICES
Definition: onnxruntime_c_api.h:199
ORT_SPARSE_CSR_INNER_INDICES
@ ORT_SPARSE_CSR_INNER_INDICES
Definition: onnxruntime_c_api.h:198
OrtDeviceAllocator
@ OrtDeviceAllocator
Definition: onnxruntime_c_api.h:337
OrtArenaAllocator
@ OrtArenaAllocator
Definition: onnxruntime_c_api.h:338
OrtInvalidAllocator
@ OrtInvalidAllocator
Definition: onnxruntime_c_api.h:336
OrtCudnnConvAlgoSearchDefault
@ OrtCudnnConvAlgoSearchDefault
Definition: onnxruntime_c_api.h:364
OrtCudnnConvAlgoSearchExhaustive
@ OrtCudnnConvAlgoSearchExhaustive
Definition: onnxruntime_c_api.h:362
OrtCudnnConvAlgoSearchHeuristic
@ OrtCudnnConvAlgoSearchHeuristic
Definition: onnxruntime_c_api.h:363
ORT_ENABLE_BASIC
@ ORT_ENABLE_BASIC
Definition: onnxruntime_c_api.h:305
ORT_ENABLE_ALL
@ ORT_ENABLE_ALL
Definition: onnxruntime_c_api.h:307
ORT_DISABLE_ALL
@ ORT_DISABLE_ALL
Definition: onnxruntime_c_api.h:304
ORT_ENABLE_EXTENDED
@ ORT_ENABLE_EXTENDED
Definition: onnxruntime_c_api.h:306
OrtMemTypeCPUInput
@ OrtMemTypeCPUInput
Any CPU memory used by non-CPU execution provider.
Definition: onnxruntime_c_api.h:345
OrtMemTypeCPU
@ OrtMemTypeCPU
Temporary CPU accessible memory allocated by non-CPU execution provider, i.e. CUDA_PINNED.
Definition: onnxruntime_c_api.h:347
OrtMemTypeDefault
@ OrtMemTypeDefault
The default allocator for execution provider.
Definition: onnxruntime_c_api.h:348
OrtMemTypeCPUOutput
@ OrtMemTypeCPUOutput
CPU accessible memory outputted by non-CPU execution provider, i.e. CUDA_PINNED.
Definition: onnxruntime_c_api.h:346
ORT_SPARSE_CSRC
@ ORT_SPARSE_CSRC
Definition: onnxruntime_c_api.h:191
ORT_SPARSE_COO
@ ORT_SPARSE_COO
Definition: onnxruntime_c_api.h:190
ORT_SPARSE_BLOCK_SPARSE
@ ORT_SPARSE_BLOCK_SPARSE
Definition: onnxruntime_c_api.h:192
ORT_SPARSE_UNDEFINED
@ ORT_SPARSE_UNDEFINED
Definition: onnxruntime_c_api.h:189
ONNX_TYPE_SEQUENCE
@ ONNX_TYPE_SEQUENCE
Definition: onnxruntime_c_api.h:179
ONNX_TYPE_MAP
@ ONNX_TYPE_MAP
Definition: onnxruntime_c_api.h:180
ONNX_TYPE_OPAQUE
@ ONNX_TYPE_OPAQUE
Definition: onnxruntime_c_api.h:181
ONNX_TYPE_UNKNOWN
@ ONNX_TYPE_UNKNOWN
Definition: onnxruntime_c_api.h:177
ONNX_TYPE_TENSOR
@ ONNX_TYPE_TENSOR
Definition: onnxruntime_c_api.h:178
ONNX_TYPE_SPARSETENSOR
@ ONNX_TYPE_SPARSETENSOR
Definition: onnxruntime_c_api.h:182
ONNX_TYPE_OPTIONAL
@ ONNX_TYPE_OPTIONAL
Definition: onnxruntime_c_api.h:183
ORT_NO_SUCHFILE
@ ORT_NO_SUCHFILE
Definition: onnxruntime_c_api.h:219
ORT_OK
@ ORT_OK
Definition: onnxruntime_c_api.h:216
ORT_INVALID_ARGUMENT
@ ORT_INVALID_ARGUMENT
Definition: onnxruntime_c_api.h:218
ORT_EP_FAIL
@ ORT_EP_FAIL
Definition: onnxruntime_c_api.h:227
ORT_NOT_IMPLEMENTED
@ ORT_NOT_IMPLEMENTED
Definition: onnxruntime_c_api.h:225
ORT_RUNTIME_EXCEPTION
@ ORT_RUNTIME_EXCEPTION
Definition: onnxruntime_c_api.h:222
ORT_ENGINE_ERROR
@ ORT_ENGINE_ERROR
Definition: onnxruntime_c_api.h:221
ORT_FAIL
@ ORT_FAIL
Definition: onnxruntime_c_api.h:217
ORT_INVALID_PROTOBUF
@ ORT_INVALID_PROTOBUF
Definition: onnxruntime_c_api.h:223
ORT_NO_MODEL
@ ORT_NO_MODEL
Definition: onnxruntime_c_api.h:220
ORT_INVALID_GRAPH
@ ORT_INVALID_GRAPH
Definition: onnxruntime_c_api.h:226
ORT_MODEL_LOADED
@ ORT_MODEL_LOADED
Definition: onnxruntime_c_api.h:224
ORT_PARALLEL
@ ORT_PARALLEL
Definition: onnxruntime_c_api.h:312
ORT_SEQUENTIAL
@ ORT_SEQUENTIAL
Definition: onnxruntime_c_api.h:311
ORT_OP_ATTR_INT
@ ORT_OP_ATTR_INT
Definition: onnxruntime_c_api.h:232
ORT_OP_ATTR_FLOATS
@ ORT_OP_ATTR_FLOATS
Definition: onnxruntime_c_api.h:235
ORT_OP_ATTR_STRINGS
@ ORT_OP_ATTR_STRINGS
Definition: onnxruntime_c_api.h:237
ORT_OP_ATTR_UNDEFINED
@ ORT_OP_ATTR_UNDEFINED
Definition: onnxruntime_c_api.h:231
ORT_OP_ATTR_INTS
@ ORT_OP_ATTR_INTS
Definition: onnxruntime_c_api.h:233
ORT_OP_ATTR_STRING
@ ORT_OP_ATTR_STRING
Definition: onnxruntime_c_api.h:236
ORT_OP_ATTR_FLOAT
@ ORT_OP_ATTR_FLOAT
Definition: onnxruntime_c_api.h:234
ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING
Definition: onnxruntime_c_api.h:164
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32
Definition: onnxruntime_c_api.h:162
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32
Definition: onnxruntime_c_api.h:168
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16
Definition: onnxruntime_c_api.h:160
ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED
Definition: onnxruntime_c_api.h:156
ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128
Definition: onnxruntime_c_api.h:171
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64
Definition: onnxruntime_c_api.h:169
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64
Definition: onnxruntime_c_api.h:163
ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL
Definition: onnxruntime_c_api.h:165
ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16
Definition: onnxruntime_c_api.h:166
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8
Definition: onnxruntime_c_api.h:158
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16
Definition: onnxruntime_c_api.h:161
ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE
Definition: onnxruntime_c_api.h:167
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8
Definition: onnxruntime_c_api.h:159
ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT
Definition: onnxruntime_c_api.h:157
ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16
Definition: onnxruntime_c_api.h:172
ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64
@ ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64
Definition: onnxruntime_c_api.h:170
OrtAllocator
Memory allocation interface.
Definition: onnxruntime_c_api.h:287
OrtAllocator::Free
void(* Free)(struct OrtAllocator *this_, void *p)
Free a block of memory previously allocated with OrtAllocator::Alloc.
Definition: onnxruntime_c_api.h:290
OrtAllocator::Info
const struct OrtMemoryInfo *(* Info)(const struct OrtAllocator *this_)
Return a pointer to an OrtMemoryInfo that describes this allocator.
Definition: onnxruntime_c_api.h:291
OrtAllocator::version
uint32_t version
Must be initialized to ORT_API_VERSION.
Definition: onnxruntime_c_api.h:288
OrtAllocator::Alloc
void *(* Alloc)(struct OrtAllocator *this_, size_t size)
Returns a pointer to an allocated block of size bytes.
Definition: onnxruntime_c_api.h:289
OrtApiBase
The helper interface to get the right version of OrtApi.
Definition: onnxruntime_c_api.h:586
OrtApiBase::GetVersionString
const char *(* GetVersionString)(void)
Returns a null terminated string of the version of the Onnxruntime library (eg: "1....
Definition: onnxruntime_c_api.h:594
OrtApiBase::GetApi
const OrtApi *(* GetApi)(uint32_t version)
Get a pointer to the requested version of the OrtApi.
Definition: onnxruntime_c_api.h:593
OrtApi
The C API.
Definition: onnxruntime_c_api.h:638
OrtApi::SetGlobalIntraOpThreadAffinity
OrtStatus * SetGlobalIntraOpThreadAffinity(OrtThreadingOptions *tp_options, const char *affinity_string)
OrtApi::SessionGetOverridableInitializerTypeInfo
OrtStatus * SessionGetOverridableInitializerTypeInfo(const OrtSession *session, size_t index, OrtTypeInfo **type_info)
Get overridable initializer type information.
OrtApi::SessionOptionsSetCustomJoinThreadFn
OrtStatus * SessionOptionsSetCustomJoinThreadFn(OrtSessionOptions *options, OrtCustomJoinThreadFn ort_custom_join_thread_fn)
Set custom thread join function.
OrtApi::KernelInfoGetAttributeArray_int64
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.
OrtApi::CreateSessionOptions
OrtStatus * CreateSessionOptions(OrtSessionOptions **options)
Create an OrtSessionOptions object.
OrtApi::ReleaseDnnlProviderOptions
void(* ReleaseDnnlProviderOptions)(OrtDnnlProviderOptions *input)
Release an OrtDnnlProviderOptions.
Definition: onnxruntime_c_api.h:3957
OrtApi::TensorAt
OrtStatus * TensorAt(OrtValue *value, const int64_t *location_values, size_t location_values_count, void **out)
Direct memory access to a specified tensor element.
OrtApi::KernelInfoGetAttribute_float
OrtStatus * KernelInfoGetAttribute_float(const OrtKernelInfo *info, const char *name, float *out)
Get a float stored as an attribute in the graph node.
OrtApi::GetCANNProviderOptionsAsString
OrtStatus * GetCANNProviderOptionsAsString(const OrtCANNProviderOptions *cann_options, OrtAllocator *allocator, char **ptr)
Get serialized CANN provider options string.
OrtApi::InvokeOp
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...
OrtApi::HasSessionConfigEntry
OrtStatus * HasSessionConfigEntry(const OrtSessionOptions *options, const char *config_key, int *out)
Checks if the given session configuration entry exists.
OrtApi::GetTensorMemoryInfo
OrtStatus * GetTensorMemoryInfo(const OrtValue *value, const OrtMemoryInfo **mem_info)
Returns a pointer to the OrtMemoryInfo of a Tensor.
OrtApi::EnableCpuMemArena
OrtStatus * EnableCpuMemArena(OrtSessionOptions *options)
Enable the memory arena on CPU.
OrtApi::CreateSparseTensorWithValuesAsOrtValue
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)
OrtApi::GetValueCount
OrtStatus * GetValueCount(const OrtValue *value, size_t *out)
Get non tensor value count from an OrtValue.
OrtApi::SetGlobalCustomJoinThreadFn
OrtStatus * SetGlobalCustomJoinThreadFn(OrtThreadingOptions *tp_options, OrtCustomJoinThreadFn ort_custom_join_thread_fn)
Set custom thread join function for global thread pools.
OrtApi::CreateCUDAProviderOptions
OrtStatus * CreateCUDAProviderOptions(OrtCUDAProviderOptionsV2 **out)
Create an OrtCUDAProviderOptionsV2.
OrtApi::DisableProfiling
OrtStatus * DisableProfiling(OrtSessionOptions *options)
Disable profiling for a session.
OrtApi::KernelInfoGetAttributeArray_float
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.
OrtApi::CreatePrepackedWeightsContainer
OrtStatus * CreatePrepackedWeightsContainer(OrtPrepackedWeightsContainer **out)
Create an OrtPrepackedWeightsContainer.
OrtApi::CreateSessionFromArrayWithPrepackedWeightsContainer
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.
OrtApi::AddFreeDimensionOverrideByName
OrtStatus * AddFreeDimensionOverrideByName(OrtSessionOptions *options, const char *dim_name, int64_t dim_value)
OrtApi::KernelInfo_GetInputCount
OrtStatus * KernelInfo_GetInputCount(const OrtKernelInfo *info, size_t *out)
Get the number of inputs from OrtKernelInfo.
OrtApi::GetSparseTensorFormat
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.
OrtApi::KernelContext_GetGPUComputeStream
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.
OrtApi::UpdateCANNProviderOptions
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.
OrtApi::SessionGetOutputName
OrtStatus * SessionGetOutputName(const OrtSession *session, size_t index, OrtAllocator *allocator, char **value)
Get output name.
OrtApi::SessionOptionsAppendExecutionProvider_TensorRT
OrtStatus * SessionOptionsAppendExecutionProvider_TensorRT(OrtSessionOptions *options, const OrtTensorRTProviderOptions *tensorrt_options)
Append TensorRT provider to session options.
OrtApi::GetTrainingApi
const OrtTrainingApi *(* GetTrainingApi)(uint32_t version)
Definition: onnxruntime_c_api.h:3557
OrtApi::SetIntraOpNumThreads
OrtStatus * SetIntraOpNumThreads(OrtSessionOptions *options, int intra_op_num_threads)
Sets the number of threads used to parallelize the execution within nodes.
OrtApi::GetTypeInfo
OrtStatus * GetTypeInfo(const OrtValue *value, OrtTypeInfo **out)
Get type information of an OrtValue.
OrtApi::CastTypeInfoToMapTypeInfo
OrtStatus * CastTypeInfoToMapTypeInfo(const OrtTypeInfo *type_info, const OrtMapTypeInfo **out)
Get detailed map information from an OrtTypeInfo.
OrtApi::SetGlobalCustomThreadCreationOptions
OrtStatus * SetGlobalCustomThreadCreationOptions(OrtThreadingOptions *tp_options, void *ort_custom_thread_creation_options)
Set custom thread creation options for global thread pools.
OrtApi::AddSessionConfigEntry
OrtStatus * AddSessionConfigEntry(OrtSessionOptions *options, const char *config_key, const char *config_value)
Set a session configuration entry as a pair of strings.
OrtApi::SetGlobalDenormalAsZero
OrtStatus * SetGlobalDenormalAsZero(OrtThreadingOptions *tp_options)
Set threading flush-to-zero and denormal-as-zero.
OrtApi::ClearBoundInputs
void(* ClearBoundInputs)(OrtIoBinding *binding_ptr) __attribute__((nonnull))
Clears any previously set Inputs for an OrtIoBinding.
Definition: onnxruntime_c_api.h:2302
OrtApi::KernelInfo_GetInputTypeInfo
OrtStatus * KernelInfo_GetInputTypeInfo(const OrtKernelInfo *info, size_t index, OrtTypeInfo **type_info)
Get the type information for a OrtKernelInfo's input.
OrtApi::KernelInfoGetAttribute_string
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.
OrtApi::GetSparseTensorIndicesTypeShape
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.
OrtApi::SessionOptionsAppendExecutionProvider_MIGraphX
OrtStatus * SessionOptionsAppendExecutionProvider_MIGraphX(OrtSessionOptions *options, const OrtMIGraphXProviderOptions *migraphx_options)
Append MIGraphX provider to session options.
OrtApi::RunOptionsSetRunLogVerbosityLevel
OrtStatus * RunOptionsSetRunLogVerbosityLevel(OrtRunOptions *options, int log_verbosity_level)
Set per-run log verbosity level.
OrtApi::AddInitializer
OrtStatus * AddInitializer(OrtSessionOptions *options, const char *name, const OrtValue *val)
Add a pre-allocated initializer to a session.
OrtApi::CreateEnv
OrtStatus * CreateEnv(OrtLoggingLevel log_severity_level, const char *logid, OrtEnv **out)
Create an OrtEnv.
OrtApi::UseCooIndices
OrtStatus * UseCooIndices(OrtValue *ort_value, int64_t *indices_data, size_t indices_num)
OrtApi::GetTensorMutableData
OrtStatus * GetTensorMutableData(OrtValue *value, void **out)
Get a pointer to the raw data inside a tensor.
OrtApi::SessionOptionsAppendExecutionProvider_OpenVINO
OrtStatus * SessionOptionsAppendExecutionProvider_OpenVINO(OrtSessionOptions *options, const OrtOpenVINOProviderOptions *provider_options)
Append OpenVINO execution provider to the session options.
OrtApi::IsSparseTensor
OrtStatus * IsSparseTensor(const OrtValue *value, int *out)
Sets *out to 1 iff an OrtValue is a SparseTensor, and 0 otherwise.
OrtApi::GetTensorElementType
OrtStatus * GetTensorElementType(const OrtTensorTypeAndShapeInfo *info, enum ONNXTensorElementDataType *out)
Get element type in OrtTensorTypeAndShapeInfo.
OrtApi::CreateSparseTensorAsOrtValue
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.
OrtApi::FillStringTensorElement
OrtStatus * FillStringTensorElement(OrtValue *value, const char *s, size_t index)
Set a single string in a string tensor.
OrtApi::CreateTensorWithDataAsOrtValue
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.
OrtApi::ModelMetadataGetGraphDescription
OrtStatus * ModelMetadataGetGraphDescription(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char **value)
OrtApi::UpdateDnnlProviderOptions
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.
OrtApi::GetStringTensorElementLength
OrtStatus * GetStringTensorElementLength(const OrtValue *value, size_t index, size_t *out)
Get the length of a single string in a string tensor.
OrtApi::MemoryInfoGetDeviceType
void(* MemoryInfoGetDeviceType)(const OrtMemoryInfo *ptr, OrtMemoryInfoDeviceType *out)
Definition: onnxruntime_c_api.h:3627
OrtApi::AddRunConfigEntry
OrtStatus * AddRunConfigEntry(OrtRunOptions *options, const char *config_key, const char *config_value)
Set a single run configuration entry as a pair of strings.
OrtApi::GetBoundOutputValues
OrtStatus * GetBoundOutputValues(const OrtIoBinding *binding_ptr, OrtAllocator *allocator, OrtValue ***output, size_t *output_count)
Get the output OrtValue objects from an OrtIoBinding.
OrtApi::ModelMetadataGetDomain
OrtStatus * ModelMetadataGetDomain(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char **value)
Get domain from an OrtModelMetadata.
OrtApi::SetLanguageProjection
OrtStatus * SetLanguageProjection(const OrtEnv *ort_env, OrtLanguageProjection projection)
Set language projection.
OrtApi::FillStringTensor
OrtStatus * FillStringTensor(OrtValue *value, const char *const *s, size_t s_len)
Set all strings at once in a string tensor.
OrtApi::SetSessionLogId
OrtStatus * SetSessionLogId(OrtSessionOptions *options, const char *logid)
Set session log id.
OrtApi::SessionOptionsAppendExecutionProvider_CUDA
OrtStatus * SessionOptionsAppendExecutionProvider_CUDA(OrtSessionOptions *options, const OrtCUDAProviderOptions *cuda_options)
Append CUDA provider to session options.
OrtApi::AddExternalInitializers
OrtStatus * AddExternalInitializers(OrtSessionOptions *options, const char *const *initializer_names, const OrtValue *const *initializers, size_t initializers_num)
Replace initialized Tensors with external data with the data provided in initializers.
OrtApi::RegisterAllocator
OrtStatus * RegisterAllocator(OrtEnv *env, OrtAllocator *allocator)
Register a custom allocator.
OrtApi::SetGlobalSpinControl
OrtStatus * SetGlobalSpinControl(OrtThreadingOptions *tp_options, int allow_spinning)
Set global spin control options.
OrtApi::MemoryInfoGetId
OrtStatus * MemoryInfoGetId(const OrtMemoryInfo *ptr, int *out)
Get the id from OrtMemoryInfo.
OrtApi::KernelInfo_GetOutputName
OrtStatus * KernelInfo_GetOutputName(const OrtKernelInfo *info, size_t index, char *out, size_t *size)
Get the name of a OrtKernelInfo's output.
OrtApi::CreateEnvWithCustomLogger
OrtStatus * CreateEnvWithCustomLogger(OrtLoggingFunction logging_function, void *logger_param, OrtLoggingLevel log_severity_level, const char *logid, OrtEnv **out)
Create an OrtEnv.
OrtApi::MemoryInfoGetName
OrtStatus * MemoryInfoGetName(const OrtMemoryInfo *ptr, const char **out)
Get name from OrtMemoryInfo.
OrtApi::GetExecutionProviderApi
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...
OrtApi::KernelContext_GetOutputCount
OrtStatus * KernelContext_GetOutputCount(const OrtKernelContext *context, size_t *out)
Used for custom operators, get the output count of a kernel.
OrtApi::GetTensorShapeElementCount
OrtStatus * GetTensorShapeElementCount(const OrtTensorTypeAndShapeInfo *info, size_t *out)
Get total number of elements in a tensor shape from an OrtTensorTypeAndShapeInfo.
OrtApi::CastTypeInfoToTensorInfo
OrtStatus * CastTypeInfoToTensorInfo(const OrtTypeInfo *type_info, const OrtTensorTypeAndShapeInfo **out)
Get OrtTensorTypeAndShapeInfo from an OrtTypeInfo.
OrtApi::CreateOp
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
OrtApi::MemoryInfoGetType
OrtStatus * MemoryInfoGetType(const OrtMemoryInfo *ptr, OrtAllocatorType *out)
Get the OrtAllocatorType from OrtMemoryInfo.
OrtApi::HasValue
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...
OrtApi::CreateEnvWithGlobalThreadPools
OrtStatus * CreateEnvWithGlobalThreadPools(OrtLoggingLevel log_severity_level, const char *logid, const OrtThreadingOptions *tp_options, OrtEnv **out)
Create an OrtEnv.
OrtApi::GetCUDAProviderOptionsAsString
OrtStatus * GetCUDAProviderOptionsAsString(const OrtCUDAProviderOptionsV2 *cuda_options, OrtAllocator *allocator, char **ptr)
OrtApi::UpdateCUDAProviderOptions
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.
OrtApi::CopyKernelInfo
OrtStatus * CopyKernelInfo(const OrtKernelInfo *info, OrtKernelInfo **info_copy)
OrtApi::GetTensorRTProviderOptionsAsString
OrtStatus * GetTensorRTProviderOptionsAsString(const OrtTensorRTProviderOptionsV2 *tensorrt_options, OrtAllocator *allocator, char **ptr)
Get serialized TensorRT provider options string.
OrtApi::SessionOptionsSetCustomThreadCreationOptions
OrtStatus * SessionOptionsSetCustomThreadCreationOptions(OrtSessionOptions *options, void *ort_custom_thread_creation_options)
Set creation options for custom thread.
OrtApi::GetDimensionsCount
OrtStatus * GetDimensionsCount(const OrtTensorTypeAndShapeInfo *info, size_t *out)
Get dimension count in OrtTensorTypeAndShapeInfo.
OrtApi::KernelInfo_GetInputName
OrtStatus * KernelInfo_GetInputName(const OrtKernelInfo *info, size_t index, char *out, size_t *size)
Get the name of a OrtKernelInfo's input.
OrtApi::RegisterCustomOpsLibrary
OrtStatus * RegisterCustomOpsLibrary(OrtSessionOptions *options, const char *library_path, void **library_handle)
OrtApi::OrtApi
OrtApi(const OrtApi &)=delete
OrtApi::SetCurrentGpuDeviceId
OrtStatus * SetCurrentGpuDeviceId(int device_id)
Set current GPU device ID.
OrtApi::GetOnnxTypeFromTypeInfo
OrtStatus * GetOnnxTypeFromTypeInfo(const OrtTypeInfo *type_info, enum ONNXType *out)
Get ONNXType from OrtTypeInfo.
OrtApi::GetDenotationFromTypeInfo
OrtStatus * GetDenotationFromTypeInfo(const OrtTypeInfo *type_info, const char **const denotation, size_t *len)
Get denotation from type information.
OrtApi::ReleaseCANNProviderOptions
void(* ReleaseCANNProviderOptions)(OrtCANNProviderOptions *input)
Release an OrtCANNProviderOptions.
Definition: onnxruntime_c_api.h:3621
OrtApi::SetGlobalInterOpNumThreads
OrtStatus * SetGlobalInterOpNumThreads(OrtThreadingOptions *tp_options, int inter_op_num_threads)
Set global inter-op thread count.
OrtApi::CloneSessionOptions
OrtStatus * CloneSessionOptions(const OrtSessionOptions *in_options, OrtSessionOptions **out_options)
Create a copy of an existing OrtSessionOptions.
OrtApi::GetSessionConfigEntry
OrtStatus * GetSessionConfigEntry(const OrtSessionOptions *options, const char *config_key, char *config_value, size_t *size)
Get a session configuration value.
OrtApi::SessionOptionsAppendExecutionProvider_TensorRT_V2
OrtStatus * SessionOptionsAppendExecutionProvider_TensorRT_V2(OrtSessionOptions *options, const OrtTensorRTProviderOptionsV2 *tensorrt_options)
Append TensorRT execution provider to the session options.
OrtApi::AddFreeDimensionOverride
OrtStatus * AddFreeDimensionOverride(OrtSessionOptions *options, const char *dim_denotation, int64_t dim_value)
Override session symbolic dimensions.
OrtApi::KernelContext_GetOutput
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.
OrtApi::EnableTelemetryEvents
OrtStatus * EnableTelemetryEvents(const OrtEnv *env)
Enable Telemetry.
OrtApi::CreateMemoryInfo
OrtStatus * CreateMemoryInfo(const char *name, enum OrtAllocatorType type, int id, enum OrtMemType mem_type, OrtMemoryInfo **out)
Create an OrtMemoryInfo.
OrtApi::SessionOptionsAppendExecutionProvider_ROCM
OrtStatus * SessionOptionsAppendExecutionProvider_ROCM(OrtSessionOptions *options, const OrtROCMProviderOptions *rocm_options)
Append ROCM execution provider to the session options.
OrtApi::SessionGetInputTypeInfo
OrtStatus * SessionGetInputTypeInfo(const OrtSession *session, size_t index, OrtTypeInfo **type_info)
Get input type information.
OrtApi::GetSymbolicDimensions
OrtStatus * GetSymbolicDimensions(const OrtTensorTypeAndShapeInfo *info, const char *dim_params[], size_t dim_params_length)
Get symbolic dimension names in OrtTensorTypeAndShapeInfo.
OrtApi::GetStringTensorDataLength
OrtStatus * GetStringTensorDataLength(const OrtValue *value, size_t *len)
Get total byte length for all strings in a string tensor.
OrtApi::KernelContext_GetInputCount
OrtStatus * KernelContext_GetInputCount(const OrtKernelContext *context, size_t *out)
Used for custom operators, get the input count of a kernel.
OrtApi::BindOutputToDevice
OrtStatus * BindOutputToDevice(OrtIoBinding *binding_ptr, const char *name, const OrtMemoryInfo *mem_info_ptr)
Bind an OrtIoBinding output to a device.
OrtApi::SessionOptionsAppendExecutionProvider
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.
OrtApi::SetSessionGraphOptimizationLevel
OrtStatus * SetSessionGraphOptimizationLevel(OrtSessionOptions *options, GraphOptimizationLevel graph_optimization_level)
Set the optimization level to apply when loading a graph.
OrtApi::ModelMetadataGetDescription
OrtStatus * ModelMetadataGetDescription(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char **value)
Get description from an OrtModelMetadata.
OrtApi::CreateCANNProviderOptions
OrtStatus * CreateCANNProviderOptions(OrtCANNProviderOptions **out)
Create an OrtCANNProviderOptions.
OrtApi::DisablePerSessionThreads
OrtStatus * DisablePerSessionThreads(OrtSessionOptions *options)
Use global thread pool on a session.
OrtApi::SetDimensions
OrtStatus * SetDimensions(OrtTensorTypeAndShapeInfo *info, const int64_t *dim_values, size_t dim_count)
Set shape information in OrtTensorTypeAndShapeInfo.
OrtApi::SetInterOpNumThreads
OrtStatus * SetInterOpNumThreads(OrtSessionOptions *options, int inter_op_num_threads)
Sets the number of threads used to parallelize the execution of the graph.
OrtApi::CustomOpDomain_Add
OrtStatus * CustomOpDomain_Add(OrtCustomOpDomain *custom_op_domain, const OrtCustomOp *op)
Add a custom op to a custom op domain.
OrtApi::GetSequenceElementType
OrtStatus * GetSequenceElementType(const OrtSequenceTypeInfo *sequence_type_info, OrtTypeInfo **type_info)
Get element type from an OrtSequenceTypeInfo.
OrtApi::RunOptionsGetRunLogVerbosityLevel
OrtStatus * RunOptionsGetRunLogVerbosityLevel(const OrtRunOptions *options, int *log_verbosity_level)
Get per-run log verbosity level.
OrtApi::FillSparseTensorCsr
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)
OrtApi::CreateAndRegisterAllocator
OrtStatus * CreateAndRegisterAllocator(OrtEnv *env, const OrtMemoryInfo *mem_info, const OrtArenaCfg *arena_cfg)
Create an allocator and register it with the OrtEnv.
OrtApi::CreateCpuMemoryInfo
OrtStatus * CreateCpuMemoryInfo(enum OrtAllocatorType type, enum OrtMemType mem_type, OrtMemoryInfo **out)
Create an OrtMemoryInfo for CPU memory.
OrtApi::AddCustomOpDomain
OrtStatus * AddCustomOpDomain(OrtSessionOptions *options, OrtCustomOpDomain *custom_op_domain)
Add custom op domain to a session options.
OrtApi::KernelInfo_GetOutputTypeInfo
OrtStatus * KernelInfo_GetOutputTypeInfo(const OrtKernelInfo *info, size_t index, OrtTypeInfo **type_info)
Get the type information for a OrtKernelInfo's output.
OrtApi::KernelContext_GetInput
OrtStatus * KernelContext_GetInput(const OrtKernelContext *context, size_t index, const OrtValue **out)
Used for custom operators, get an input of a kernel.
OrtApi::CreateEnvWithCustomLoggerAndGlobalThreadPools
OrtStatus * CreateEnvWithCustomLoggerAndGlobalThreadPools(OrtLoggingFunction logging_function, void *logger_param, OrtLoggingLevel log_severity_level, const char *logid, const struct OrtThreadingOptions *tp_options, OrtEnv **out)
OrtApi::DisableTelemetryEvents
OrtStatus * DisableTelemetryEvents(const OrtEnv *env)
Disable Telemetry.
OrtApi::KernelInfo_GetOutputCount
OrtStatus * KernelInfo_GetOutputCount(const OrtKernelInfo *info, size_t *out)
Get the number of outputs from OrtKernelInfo.
OrtApi::ModelMetadataGetGraphName
OrtStatus * ModelMetadataGetGraphName(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char **value)
Get graph name from an OrtModelMetadata.
OrtApi::ModelMetadataLookupCustomMetadataMap
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.
OrtApi::RunOptionsSetRunLogSeverityLevel
OrtStatus * RunOptionsSetRunLogSeverityLevel(OrtRunOptions *options, int log_severity_level)
Set per-run log severity level.
OrtApi::SetSessionExecutionMode
OrtStatus * SetSessionExecutionMode(OrtSessionOptions *options, ExecutionMode execution_mode)
Set execution mode.
OrtApi::SessionGetInputName
OrtStatus * SessionGetInputName(const OrtSession *session, size_t index, OrtAllocator *allocator, char **value)
Get input name.
OrtApi::GetDnnlProviderOptionsAsString
OrtStatus * GetDnnlProviderOptionsAsString(const OrtDnnlProviderOptions *dnnl_options, OrtAllocator *allocator, char **ptr)
OrtApi::CreateRunOptions
OrtStatus * CreateRunOptions(OrtRunOptions **out)
Create an OrtRunOptions.
OrtApi::RunOptionsGetRunTag
OrtStatus * RunOptionsGetRunTag(const OrtRunOptions *options, const char **run_tag)
Get per-run tag.
OrtApi::CreateCustomOpDomain
OrtStatus * CreateCustomOpDomain(const char *domain, OrtCustomOpDomain **out)
Create a custom op domain.
OrtApi::ModelMetadataGetCustomMetadataMapKeys
OrtStatus * ModelMetadataGetCustomMetadataMapKeys(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char ***keys, int64_t *num_keys)
OrtApi::GetErrorMessage
const char *(* GetErrorMessage)(const OrtStatus *status) __attribute__((nonnull))
Get error string from OrtStatus.
Definition: onnxruntime_c_api.h:663
OrtApi::IsTensor
OrtStatus * IsTensor(const OrtValue *value, int *out)
Return if an OrtValue is a tensor type.
OrtApi::AllocatorFree
OrtStatus * AllocatorFree(OrtAllocator *ort_allocator, void *p)
Calls OrtAllocator::Free function.
OrtApi::GetMapValueType
OrtStatus * GetMapValueType(const OrtMapTypeInfo *map_type_info, OrtTypeInfo **type_info)
Get the value type from an OrtMapTypeInfo.
OrtApi::CreateSessionFromArray
OrtStatus * CreateSessionFromArray(const OrtEnv *env, const void *model_data, size_t model_data_length, const OrtSessionOptions *options, OrtSession **out)
Create an OrtSession from memory.
OrtApi::CreateArenaCfgV2
OrtStatus * CreateArenaCfgV2(const char *const *arena_config_keys, const size_t *arena_config_values, size_t num_keys, OrtArenaCfg **out)
Create an OrtArenaCfg.
OrtApi::GetAllocatorWithDefaultOptions
OrtStatus * GetAllocatorWithDefaultOptions(OrtAllocator **out)
Get the default allocator.
OrtApi::CreateSession
OrtStatus * CreateSession(const OrtEnv *env, const char *model_path, const OrtSessionOptions *options, OrtSession **out)
Create an OrtSession from a model file.
OrtApi::SessionOptionsAppendExecutionProvider_Dnnl
OrtStatus * SessionOptionsAppendExecutionProvider_Dnnl(OrtSessionOptions *options, const OrtDnnlProviderOptions *dnnl_options)
Append dnnl provider to session options.
OrtApi::CreateArenaCfg
OrtStatus * CreateArenaCfg(size_t max_mem, int arena_extend_strategy, int initial_chunk_size_bytes, int max_dead_bytes_per_chunk, OrtArenaCfg **out)
OrtApi::SessionGetInputCount
OrtStatus * SessionGetInputCount(const OrtSession *session, size_t *out)
Get input count for a session.
OrtApi::GetValue
OrtStatus * GetValue(const OrtValue *value, int index, OrtAllocator *allocator, OrtValue **out)
Get non tensor data from an OrtValue.
OrtApi::GetSparseTensorIndices
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.
OrtApi::EnableProfiling
OrtStatus * EnableProfiling(OrtSessionOptions *options, const char *profile_file_prefix)
Enable profiling for a session.
OrtApi::GetStringTensorElement
OrtStatus * GetStringTensorElement(const OrtValue *value, size_t s_len, size_t index, void *s)
Get a single string from a string tensor.
OrtApi::GetTensorTypeAndShape
OrtStatus * GetTensorTypeAndShape(const OrtValue *value, OrtTensorTypeAndShapeInfo **out)
Get type and shape information from a tensor OrtValue.
OrtApi::BindInput
OrtStatus * BindInput(OrtIoBinding *binding_ptr, const char *name, const OrtValue *val_ptr)
Bind an OrtValue to an OrtIoBinding input.
OrtApi::DisableCpuMemArena
OrtStatus * DisableCpuMemArena(OrtSessionOptions *options)
Disable the memory arena on CPU.
OrtApi::ClearBoundOutputs
void(* ClearBoundOutputs)(OrtIoBinding *binding_ptr) __attribute__((nonnull))
Clears any previously set Outputs for an OrtIoBinding.
Definition: onnxruntime_c_api.h:2306
OrtApi::SessionOptionsAppendExecutionProvider_CANN
OrtStatus * SessionOptionsAppendExecutionProvider_CANN(OrtSessionOptions *options, const OrtCANNProviderOptions *cann_options)
Append CANN provider to session options.
OrtApi::MemoryInfoGetMemType
OrtStatus * MemoryInfoGetMemType(const OrtMemoryInfo *ptr, OrtMemType *out)
Get the OrtMemType from OrtMemoryInfo.
OrtApi::AllocatorGetInfo
OrtStatus * AllocatorGetInfo(const OrtAllocator *ort_allocator, const struct OrtMemoryInfo **out)
Calls OrtAllocator::Info function.
OrtApi::CompareMemoryInfo
OrtStatus * CompareMemoryInfo(const OrtMemoryInfo *info1, const OrtMemoryInfo *info2, int *out)
Compare OrtMemoryInfo objects for equality.
OrtApi::GetAvailableProviders
OrtStatus * GetAvailableProviders(char ***out_ptr, int *provider_length)
Get the names of all available providers.
OrtApi::SynchronizeBoundInputs
OrtStatus * SynchronizeBoundInputs(OrtIoBinding *binding_ptr)
Synchronize bound inputs. The call may be necessary for some providers, such as cuda,...
OrtApi::GetOpaqueValue
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.
OrtApi::AllocatorAlloc
OrtStatus * AllocatorAlloc(OrtAllocator *ort_allocator, size_t size, void **out)
Calls OrtAllocator::Alloc function.
OrtApi::RegisterCustomOpsLibrary_V2
OrtStatus * RegisterCustomOpsLibrary_V2(OrtSessionOptions *options, const char *library_name)
Register custom ops from a shared library.
OrtApi::SessionGetOverridableInitializerName
OrtStatus * SessionGetOverridableInitializerName(const OrtSession *session, size_t index, OrtAllocator *allocator, char **value)
Get overridable initializer name.
OrtApi::UnregisterAllocator
OrtStatus * UnregisterAllocator(OrtEnv *env, const OrtMemoryInfo *mem_info)
Unregister a custom allocator.
OrtApi::DisableMemPattern
OrtStatus * DisableMemPattern(OrtSessionOptions *options)
Disable the memory pattern optimization.
OrtApi::UseBlockSparseIndices
OrtStatus * UseBlockSparseIndices(OrtValue *ort_value, const int64_t *indices_shape, size_t indices_shape_len, int32_t *indices_data)
OrtApi::CreateStatus
OrtStatus *(* CreateStatus)(OrtErrorCode code, const char *msg) __attribute__((nonnull))
Create an OrtStatus from a null terminated string.
Definition: onnxruntime_c_api.h:649
OrtApi::RunWithBinding
OrtStatus * RunWithBinding(OrtSession *session, const OrtRunOptions *run_options, const OrtIoBinding *binding_ptr)
Run a model using Io Bindings for the inputs & outputs.
OrtApi::CreateDnnlProviderOptions
OrtStatus * CreateDnnlProviderOptions(OrtDnnlProviderOptions **out)
Create an OrtDnnlProviderOptions.
OrtApi::GetMapKeyType
OrtStatus * GetMapKeyType(const OrtMapTypeInfo *map_type_info, enum ONNXTensorElementDataType *out)
Get key type from an OrtMapTypeInfo.
OrtApi::RunOptionsGetRunLogSeverityLevel
OrtStatus * RunOptionsGetRunLogSeverityLevel(const OrtRunOptions *options, int *log_severity_level)
Get per-run log severity level.
OrtApi::SessionGetModelMetadata
OrtStatus * SessionGetModelMetadata(const OrtSession *session, OrtModelMetadata **out)
Get OrtModelMetadata from an OrtSession.
OrtApi::GetCurrentGpuDeviceId
OrtStatus * GetCurrentGpuDeviceId(int *device_id)
Get current GPU device ID.
OrtApi::SessionGetOutputTypeInfo
OrtStatus * SessionGetOutputTypeInfo(const OrtSession *session, size_t index, OrtTypeInfo **type_info)
Get output type information.
OrtApi::EnableOrtCustomOps
OrtStatus * EnableOrtCustomOps(OrtSessionOptions *options)
Enable custom operators.
OrtApi::UpdateEnvWithCustomLogLevel
OrtStatus * UpdateEnvWithCustomLogLevel(OrtEnv *ort_env, OrtLoggingLevel log_severity_level)
OrtApi::CreateValue
OrtStatus * CreateValue(const OrtValue *const *in, size_t num_values, enum ONNXType value_type, OrtValue **out)
Create a map or sequence OrtValue.
OrtApi::RegisterCustomOpsUsingFunction
OrtStatus * RegisterCustomOpsUsingFunction(OrtSessionOptions *options, const char *registration_func_name)
Register custom ops by calling a RegisterCustomOpsFn function.
OrtApi::RunOptionsSetTerminate
OrtStatus * RunOptionsSetTerminate(OrtRunOptions *options)
Set terminate flag.
OrtApi::SetSessionLogVerbosityLevel
OrtStatus * SetSessionLogVerbosityLevel(OrtSessionOptions *options, int session_log_verbosity_level)
Set session log verbosity level.
OrtApi::SetSessionLogSeverityLevel
OrtStatus * SetSessionLogSeverityLevel(OrtSessionOptions *options, int session_log_severity_level)
Set session log severity level.
OrtApi::CreateThreadingOptions
OrtStatus * CreateThreadingOptions(OrtThreadingOptions **out)
Create an OrtThreadingOptions.
OrtApi::UseCsrIndices
OrtStatus * UseCsrIndices(OrtValue *ort_value, int64_t *inner_data, size_t inner_num, int64_t *outer_data, size_t outer_num)
OrtApi::SessionGetOverridableInitializerCount
OrtStatus * SessionGetOverridableInitializerCount(const OrtSession *session, size_t *out)
Get overridable initializer count.
OrtApi::CreateSessionWithPrepackedWeightsContainer
OrtStatus * CreateSessionWithPrepackedWeightsContainer(const OrtEnv *env, const char *model_path, const OrtSessionOptions *options, OrtPrepackedWeightsContainer *prepacked_weights_container, OrtSession **out)
Create session with prepacked weights container.
OrtApi::UpdateTensorRTProviderOptions
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.
OrtApi::KernelInfoGetAttribute_tensor
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.
OrtApi::EnableMemPattern
OrtStatus * EnableMemPattern(OrtSessionOptions *options)
Enable the memory pattern optimization.
OrtApi::SetOptimizedModelFilePath
OrtStatus * SetOptimizedModelFilePath(OrtSessionOptions *options, const char *optimized_model_filepath)
Set filepath to save optimized model after graph level transformations.
OrtApi::CreateAllocator
OrtStatus * CreateAllocator(const OrtSession *session, const OrtMemoryInfo *mem_info, OrtAllocator **out)
Create an allocator for an OrtSession following an OrtMemoryInfo.
OrtApi::SynchronizeBoundOutputs
OrtStatus * SynchronizeBoundOutputs(OrtIoBinding *binding_ptr)
Synchronize bound outputs. The call may be necessary for some providers, such as cuda,...
OrtApi::SessionGetOutputCount
OrtStatus * SessionGetOutputCount(const OrtSession *session, size_t *out)
Get output count for a session.
OrtApi::CastTypeInfoToSequenceTypeInfo
OrtStatus * CastTypeInfoToSequenceTypeInfo(const OrtTypeInfo *type_info, const OrtSequenceTypeInfo **out)
Cast OrtTypeInfo to an OrtSequenceTypeInfo.
OrtApi::Run
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.
OrtApi::GetValueType
OrtStatus * GetValueType(const OrtValue *value, enum ONNXType *out)
Get ONNXType of an OrtValue.
OrtApi::CreateTensorRTProviderOptions
OrtStatus * CreateTensorRTProviderOptions(OrtTensorRTProviderOptionsV2 **out)
Create an OrtTensorRTProviderOptionsV2.
OrtApi::GetDimensions
OrtStatus * GetDimensions(const OrtTensorTypeAndShapeInfo *info, int64_t *dim_values, size_t dim_values_length)
Get dimensions in OrtTensorTypeAndShapeInfo.
OrtApi::SessionGetProfilingStartTimeNs
OrtStatus * SessionGetProfilingStartTimeNs(const OrtSession *session, uint64_t *out)
Return the time that profiling was started.
OrtApi::RunOptionsUnsetTerminate
OrtStatus * RunOptionsUnsetTerminate(OrtRunOptions *options)
Clears the terminate flag.
OrtApi::CreateOpaqueValue
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.
OrtApi::GetSparseTensorValuesTypeAndShape
OrtStatus * GetSparseTensorValuesTypeAndShape(const OrtValue *ort_value, OrtTensorTypeAndShapeInfo **out)
Returns data type and shape of sparse tensor values (nnz) iff OrtValue contains a SparseTensor.
OrtApi::ReleaseTensorRTProviderOptions
void(* ReleaseTensorRTProviderOptions)(OrtTensorRTProviderOptionsV2 *input)
Release an OrtTensorRTProviderOptionsV2.
Definition: onnxruntime_c_api.h:2857
OrtApi::ReleaseAvailableProviders
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 ...
OrtApi::RunOptionsSetRunTag
OrtStatus * RunOptionsSetRunTag(OrtRunOptions *options, const char *run_tag)
Set per-run tag.
OrtApi::CreateIoBinding
OrtStatus * CreateIoBinding(OrtSession *session, OrtIoBinding **out)
Create an OrtIoBinding instance.
OrtApi::SetGlobalIntraOpNumThreads
OrtStatus * SetGlobalIntraOpNumThreads(OrtThreadingOptions *tp_options, int intra_op_num_threads)
Set global intra-op thread count.
OrtApi::CreateOpAttr
OrtStatus * CreateOpAttr(const char *name, const void *data, int len, OrtOpAttrType type, OrtOpAttr **op_attr)
: Create attribute of onnxruntime operator
OrtApi::FillSparseTensorBlockSparse
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)
OrtApi::ModelMetadataGetVersion
OrtStatus * ModelMetadataGetVersion(const OrtModelMetadata *model_metadata, int64_t *value)
Get version number from an OrtModelMetadata.
OrtApi::GetStringTensorContent
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.
OrtApi::GetBoundOutputNames
OrtStatus * GetBoundOutputNames(const OrtIoBinding *binding_ptr, OrtAllocator *allocator, char **buffer, size_t **lengths, size_t *count)
Get the names of an OrtIoBinding's outputs.
OrtApi::CreateTensorTypeAndShapeInfo
OrtStatus * CreateTensorTypeAndShapeInfo(OrtTensorTypeAndShapeInfo **out)
Create an OrtTensorTypeAndShapeInfo object.
OrtApi::FillSparseTensorCoo
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)
OrtApi::SessionEndProfiling
OrtStatus * SessionEndProfiling(OrtSession *session, OrtAllocator *allocator, char **out)
End profiling and return filename of the profile data.
OrtApi::ModelMetadataGetProducerName
OrtStatus * ModelMetadataGetProducerName(const OrtModelMetadata *model_metadata, OrtAllocator *allocator, char **value)
Get producer name from an OrtModelMetadata.
OrtApi::SessionOptionsSetCustomCreateThreadFn
OrtStatus * SessionOptionsSetCustomCreateThreadFn(OrtSessionOptions *options, OrtCustomCreateThreadFn ort_custom_create_thread_fn)
Set custom thread creation function.
OrtApi::SetGlobalCustomCreateThreadFn
OrtStatus * SetGlobalCustomCreateThreadFn(OrtThreadingOptions *tp_options, OrtCustomCreateThreadFn ort_custom_create_thread_fn)
Set custom thread creation function for global thread pools.
OrtApi::SessionOptionsAppendExecutionProvider_CUDA_V2
OrtStatus * SessionOptionsAppendExecutionProvider_CUDA_V2(OrtSessionOptions *options, const OrtCUDAProviderOptionsV2 *cuda_options)
Append CUDA execution provider to the session options.
OrtApi::CreateTensorAsOrtValue
OrtStatus * CreateTensorAsOrtValue(OrtAllocator *allocator, const int64_t *shape, size_t shape_len, ONNXTensorElementDataType type, OrtValue **out)
Create a tensor.
OrtApi::ReleaseCUDAProviderOptions
void(* ReleaseCUDAProviderOptions)(OrtCUDAProviderOptionsV2 *input)
Release an OrtCUDAProviderOptionsV2.
Definition: onnxruntime_c_api.h:3360
OrtApi::KernelInfoGetAttribute_int64
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.
OrtApi::GetErrorCode
OrtErrorCode(* GetErrorCode)(const OrtStatus *status) __attribute__((nonnull))
Get OrtErrorCode from OrtStatus.
Definition: onnxruntime_c_api.h:656
OrtApi::SetTensorElementType
OrtStatus * SetTensorElementType(OrtTensorTypeAndShapeInfo *info, enum ONNXTensorElementDataType type)
Set element type in OrtTensorTypeAndShapeInfo.
OrtApi::BindOutput
OrtStatus * BindOutput(OrtIoBinding *binding_ptr, const char *name, const OrtValue *val_ptr)
Bind an OrtValue to an OrtIoBinding output.
OrtApi::GetSparseTensorValues
OrtStatus * GetSparseTensorValues(const OrtValue *ort_value, const void **out)
Returns numeric data for sparse tensor values (nnz). For string values use GetStringTensor*().
OrtCUDAProviderOptions
CUDA Provider Options.
Definition: onnxruntime_c_api.h:371
OrtCUDAProviderOptions::has_user_compute_stream
int has_user_compute_stream
Flag indicating if there is a user provided compute stream Defaults to 0.
Definition: onnxruntime_c_api.h:422
OrtCUDAProviderOptions::do_copy_in_default_stream
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:417
OrtCUDAProviderOptions::user_compute_stream
void * user_compute_stream
User provided compute stream. If provided, please set has_user_compute_stream to 1.
Definition: onnxruntime_c_api.h:427
OrtCUDAProviderOptions::gpu_mem_limit
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:400
OrtCUDAProviderOptions::arena_extend_strategy
int arena_extend_strategy
Strategy used to grow the memory arena 0 = kNextPowerOfTwo 1 = kSameAsRequested Defaults to 0.
Definition: onnxruntime_c_api.h:408
OrtCUDAProviderOptions::tunable_op_enabled
int tunable_op_enabled
Enable TunableOp. Set it to 1 to enable TunableOp. Otherwise, it is disabled by default....
Definition: onnxruntime_c_api.h:437
OrtCUDAProviderOptions::OrtCUDAProviderOptions
OrtCUDAProviderOptions()
Definition: onnxruntime_c_api.h:373
OrtCUDAProviderOptions::default_memory_arena_cfg
OrtArenaCfg * default_memory_arena_cfg
CUDA memory arena configuration parameters.
Definition: onnxruntime_c_api.h:431
OrtCUDAProviderOptions::cudnn_conv_algo_search
OrtCudnnConvAlgoSearch cudnn_conv_algo_search
CUDA Convolution algorithm search configuration. See enum OrtCudnnConvAlgoSearch for more details....
Definition: onnxruntime_c_api.h:394
OrtCUDAProviderOptions::device_id
int device_id
CUDA device Id Defaults to 0.
Definition: onnxruntime_c_api.h:388
OrtCustomHandleType
Definition: onnxruntime_c_api.h:611
OrtCustomHandleType::__place_holder
char __place_holder
Definition: onnxruntime_c_api.h:612
OrtCustomOp
Definition: onnxruntime_c_api.h:3989
OrtCustomOp::GetVariadicInputHomogeneity
int(* GetVariadicInputHomogeneity)(const struct OrtCustomOp *op)
Definition: onnxruntime_c_api.h:4030
OrtCustomOp::GetOutputCharacteristic
OrtCustomOpInputOutputCharacteristic(* GetOutputCharacteristic)(const struct OrtCustomOp *op, size_t index)
Definition: onnxruntime_c_api.h:4014
OrtCustomOp::GetInputTypeCount
size_t(* GetInputTypeCount)(const struct OrtCustomOp *op)
Definition: onnxruntime_c_api.h:4004
OrtCustomOp::GetVariadicOutputMinArity
int(* GetVariadicOutputMinArity)(const struct OrtCustomOp *op)
Definition: onnxruntime_c_api.h:4034
OrtCustomOp::GetName
const char *(* GetName)(const struct OrtCustomOp *op)
Definition: onnxruntime_c_api.h:3997
OrtCustomOp::GetOutputTypeCount
size_t(* GetOutputTypeCount)(const struct OrtCustomOp *op)
Definition: onnxruntime_c_api.h:4006
OrtCustomOp::KernelDestroy
void(* KernelDestroy)(void *op_kernel)
Definition: onnxruntime_c_api.h:4010
OrtCustomOp::GetVariadicOutputHomogeneity
int(* GetVariadicOutputHomogeneity)(const struct OrtCustomOp *op)
Definition: onnxruntime_c_api.h:4039
OrtCustomOp::GetInputMemoryType
OrtMemType(* GetInputMemoryType)(const struct OrtCustomOp *op, size_t index)
Definition: onnxruntime_c_api.h:4021
OrtCustomOp::CreateKernel
void *(* CreateKernel)(const struct OrtCustomOp *op, const OrtApi *api, const OrtKernelInfo *info)
Definition: onnxruntime_c_api.h:3993
OrtCustomOp::version
uint32_t version
Definition: onnxruntime_c_api.h:3990
OrtCustomOp::GetInputType
ONNXTensorElementDataType(* GetInputType)(const struct OrtCustomOp *op, size_t index)
Definition: onnxruntime_c_api.h:4003
OrtCustomOp::GetInputCharacteristic
OrtCustomOpInputOutputCharacteristic(* GetInputCharacteristic)(const struct OrtCustomOp *op, size_t index)
Definition: onnxruntime_c_api.h:4013
OrtCustomOp::GetExecutionProviderType
const char *(* GetExecutionProviderType)(const struct OrtCustomOp *op)
Definition: onnxruntime_c_api.h:4000
OrtCustomOp::GetOutputType
ONNXTensorElementDataType(* GetOutputType)(const struct OrtCustomOp *op, size_t index)
Definition: onnxruntime_c_api.h:4005
OrtCustomOp::GetVariadicInputMinArity
int(* GetVariadicInputMinArity)(const struct OrtCustomOp *op)
Definition: onnxruntime_c_api.h:4025
OrtCustomOp::KernelCompute
void(* KernelCompute)(void *op_kernel, OrtKernelContext *context)
Definition: onnxruntime_c_api.h:4009
OrtMIGraphXProviderOptions
MIGraphX Provider Options.
Definition: onnxruntime_c_api.h:546
OrtMIGraphXProviderOptions::migraphx_int8_enable
int migraphx_int8_enable
Definition: onnxruntime_c_api.h:549
OrtMIGraphXProviderOptions::migraphx_fp16_enable
int migraphx_fp16_enable
Definition: onnxruntime_c_api.h:548
OrtMIGraphXProviderOptions::device_id
int device_id
Definition: onnxruntime_c_api.h:547
OrtOpenVINOProviderOptions
OpenVINO Provider Options.
Definition: onnxruntime_c_api.h:556
OrtOpenVINOProviderOptions::enable_opencl_throttling
unsigned char enable_opencl_throttling
0 = disabled, nonzero = enabled
Definition: onnxruntime_c_api.h:572
OrtOpenVINOProviderOptions::num_of_threads
size_t num_of_threads
0 = Use default number of threads
Definition: onnxruntime_c_api.h:569
OrtOpenVINOProviderOptions::context
void * context
Definition: onnxruntime_c_api.h:571
OrtOpenVINOProviderOptions::enable_vpu_fast_compile
unsigned char enable_vpu_fast_compile
0 = disabled, nonzero = enabled
Definition: onnxruntime_c_api.h:567
OrtOpenVINOProviderOptions::cache_dir
const char * cache_dir
Definition: onnxruntime_c_api.h:570
OrtOpenVINOProviderOptions::device_type
const char * device_type
Device type string.
Definition: onnxruntime_c_api.h:566
OrtOpenVINOProviderOptions::device_id
const char * device_id
Definition: onnxruntime_c_api.h:568
OrtOpenVINOProviderOptions::OrtOpenVINOProviderOptions
OrtOpenVINOProviderOptions()
Definition: onnxruntime_c_api.h:558
OrtOpenVINOProviderOptions::enable_dynamic_shapes
unsigned char enable_dynamic_shapes
0 = disabled, nonzero = enabled
Definition: onnxruntime_c_api.h:573
OrtROCMProviderOptions
ROCM Provider Options.
Definition: onnxruntime_c_api.h:445
OrtROCMProviderOptions::device_id
int device_id
ROCM device Id Defaults to 0.
Definition: onnxruntime_c_api.h:462
OrtROCMProviderOptions::do_copy_in_default_stream
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:490
OrtROCMProviderOptions::default_memory_arena_cfg
OrtArenaCfg * default_memory_arena_cfg
ROCM memory arena configuration parameters.
Definition: onnxruntime_c_api.h:504
OrtROCMProviderOptions::gpu_mem_limit
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:473
OrtROCMProviderOptions::OrtROCMProviderOptions
OrtROCMProviderOptions()
Definition: onnxruntime_c_api.h:447
OrtROCMProviderOptions::user_compute_stream
void * user_compute_stream
User provided compute stream. If provided, please set has_user_compute_stream to 1.
Definition: onnxruntime_c_api.h:500
OrtROCMProviderOptions::arena_extend_strategy
int arena_extend_strategy
Strategy used to grow the memory arena 0 = kNextPowerOfTwo 1 = kSameAsRequested Defaults to 0.
Definition: onnxruntime_c_api.h:481
OrtROCMProviderOptions::has_user_compute_stream
int has_user_compute_stream
Flag indicating if there is a user provided compute stream Defaults to 0.
Definition: onnxruntime_c_api.h:495
OrtROCMProviderOptions::tunable_op_enabled
int tunable_op_enabled
Enable TunableOp. Set it to 1 to enable TunableOp. Otherwise, it is disabled by default....
Definition: onnxruntime_c_api.h:510
OrtROCMProviderOptions::miopen_conv_exhaustive_search
int miopen_conv_exhaustive_search
ROCM MIOpen Convolution algorithm exaustive search option. Defaults to 0 (false).
Definition: onnxruntime_c_api.h:467
OrtTensorRTProviderOptions
TensorRT Provider Options.
Definition: onnxruntime_c_api.h:518
OrtTensorRTProviderOptions::trt_engine_cache_enable
int trt_engine_cache_enable
Definition: onnxruntime_c_api.h:532
OrtTensorRTProviderOptions::user_compute_stream
void * user_compute_stream
Definition: onnxruntime_c_api.h:521
OrtTensorRTProviderOptions::device_id
int device_id
CUDA device id (0 = default device)
Definition: onnxruntime_c_api.h:519
OrtTensorRTProviderOptions::trt_engine_cache_path
const char * trt_engine_cache_path
Definition: onnxruntime_c_api.h:533
OrtTensorRTProviderOptions::trt_engine_decryption_enable
int trt_engine_decryption_enable
Definition: onnxruntime_c_api.h:534
OrtTensorRTProviderOptions::trt_max_partition_iterations
int trt_max_partition_iterations
Definition: onnxruntime_c_api.h:522
OrtTensorRTProviderOptions::trt_max_workspace_size
size_t trt_max_workspace_size
Definition: onnxruntime_c_api.h:524
OrtTensorRTProviderOptions::trt_dla_enable
int trt_dla_enable
Definition: onnxruntime_c_api.h:529
OrtTensorRTProviderOptions::trt_int8_calibration_table_name
const char * trt_int8_calibration_table_name
Definition: onnxruntime_c_api.h:527
OrtTensorRTProviderOptions::has_user_compute_stream
int has_user_compute_stream
Definition: onnxruntime_c_api.h:520
OrtTensorRTProviderOptions::trt_dla_core
int trt_dla_core
Definition: onnxruntime_c_api.h:530
OrtTensorRTProviderOptions::trt_int8_use_native_calibration_table
int trt_int8_use_native_calibration_table
Definition: onnxruntime_c_api.h:528
OrtTensorRTProviderOptions::trt_min_subgraph_size
int trt_min_subgraph_size
Definition: onnxruntime_c_api.h:523
OrtTensorRTProviderOptions::trt_force_sequential_engine_build
int trt_force_sequential_engine_build
Definition: onnxruntime_c_api.h:536
OrtTensorRTProviderOptions::trt_dump_subgraphs
int trt_dump_subgraphs
Definition: onnxruntime_c_api.h:531
OrtTensorRTProviderOptions::trt_fp16_enable
int trt_fp16_enable
Definition: onnxruntime_c_api.h:525
OrtTensorRTProviderOptions::trt_engine_decryption_lib_path
const char * trt_engine_decryption_lib_path
Definition: onnxruntime_c_api.h:535
OrtTensorRTProviderOptions::trt_int8_enable
int trt_int8_enable
Definition: onnxruntime_c_api.h:526