HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Global

Classes

struct  OrtAllocator
 Memory allocation interface. More...
 
struct  OrtCUDAProviderOptions
 CUDA Provider Options. More...
 
struct  OrtROCMProviderOptions
 ROCM Provider Options. More...
 
struct  OrtTensorRTProviderOptions
 TensorRT Provider Options. More...
 
struct  OrtMIGraphXProviderOptions
 MIGraphX Provider Options. More...
 
struct  OrtOpenVINOProviderOptions
 OpenVINO Provider Options. More...
 
struct  OrtApiBase
 The helper interface to get the right version of OrtApi. More...
 
struct  OrtCustomHandleType
 
struct  OrtApi
 The C API. More...
 
struct  OrtCustomOp
 

Macros

#define ORT_API_VERSION   14
 The API version defined in this header. More...
 

Typedefs

typedef enum
ONNXTensorElementDataType 
ONNXTensorElementDataType
 
typedef enum ONNXType ONNXType
 
typedef enum OrtSparseFormat OrtSparseFormat
 
typedef enum OrtLoggingLevel OrtLoggingLevel
 Logging severity levels. More...
 
typedef enum OrtErrorCode OrtErrorCode
 
typedef enum OrtOpAttrType OrtOpAttrType
 
typedef OrtStatus * OrtStatusPtr
 
typedef struct OrtAllocator OrtAllocator
 Memory allocation interface. More...
 
typedef void(ORT_API_CALLOrtLoggingFunction )(void *param, OrtLoggingLevel severity, const char *category, const char *logid, const char *code_location, const char *message)
 
typedef enum GraphOptimizationLevel GraphOptimizationLevel
 Graph optimization level. More...
 
typedef enum ExecutionMode ExecutionMode
 
typedef enum OrtLanguageProjection OrtLanguageProjection
 Language projection identifiers /see OrtApi::SetLanguageProjection. More...
 
typedef struct OrtKernelInfo OrtKernelInfo
 
typedef struct OrtKernelContext OrtKernelContext
 
typedef struct OrtCustomOp OrtCustomOp
 
typedef enum OrtAllocatorType OrtAllocatorType
 
typedef enum OrtMemType OrtMemType
 Memory types for allocated memory, execution provider specific types should be extended in each provider. More...
 
typedef enum
OrtMemoryInfoDeviceType 
OrtMemoryInfoDeviceType
 This mimics OrtDevice type constants so they can be returned in the API. More...
 
typedef enum OrtCudnnConvAlgoSearch OrtCudnnConvAlgoSearch
 Algorithm to use for cuDNN Convolution Op. More...
 
typedef struct
OrtCUDAProviderOptions 
OrtCUDAProviderOptions
 CUDA Provider Options. More...
 
typedef struct
OrtROCMProviderOptions 
OrtROCMProviderOptions
 ROCM Provider Options. More...
 
typedef struct
OrtTensorRTProviderOptions 
OrtTensorRTProviderOptions
 TensorRT Provider Options. More...
 
typedef struct
OrtMIGraphXProviderOptions 
OrtMIGraphXProviderOptions
 MIGraphX Provider Options. More...
 
typedef struct
OrtOpenVINOProviderOptions 
OrtOpenVINOProviderOptions
 OpenVINO Provider Options. More...
 
typedef struct OrtApi OrtApi
 
typedef struct OrtTrainingApi OrtTrainingApi
 
typedef struct OrtApiBase OrtApiBase
 
typedef void(* OrtThreadWorkerFn )(void *ort_worker_fn_param)
 Thread work loop function. More...
 
typedef const struct
OrtCustomHandleType
OrtCustomThreadHandle
 
typedef OrtCustomThreadHandle(* OrtCustomCreateThreadFn )(void *ort_custom_thread_creation_options, OrtThreadWorkerFn ort_thread_worker_fn, void *ort_worker_fn_param)
 Ort custom thread creation function. More...
 
typedef void(* OrtCustomJoinThreadFn )(OrtCustomThreadHandle ort_custom_thread_handle)
 Custom thread join function. More...
 
typedef OrtStatus *(ORT_API_CALLRegisterCustomOpsFn )(OrtSessionOptions *options, const OrtApiBase *api)
 
typedef enum
OrtCustomOpInputOutputCharacteristic 
OrtCustomOpInputOutputCharacteristic
 

Enumerations

enum  ONNXTensorElementDataType {
  ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED, ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT, ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8, ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8,
  ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16, ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16, ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32, ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64,
  ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING, ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL, ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16, ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE,
  ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32, ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64, ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64, ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128,
  ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16
}
 
enum  ONNXType {
  ONNX_TYPE_UNKNOWN, ONNX_TYPE_TENSOR, ONNX_TYPE_SEQUENCE, ONNX_TYPE_MAP,
  ONNX_TYPE_OPAQUE, ONNX_TYPE_SPARSETENSOR, ONNX_TYPE_OPTIONAL
}
 
enum  OrtSparseFormat { ORT_SPARSE_UNDEFINED = 0, ORT_SPARSE_COO = 0x1, ORT_SPARSE_CSRC = 0x2, ORT_SPARSE_BLOCK_SPARSE = 0x4 }
 
enum  OrtSparseIndicesFormat { ORT_SPARSE_COO_INDICES, ORT_SPARSE_CSR_INNER_INDICES, ORT_SPARSE_CSR_OUTER_INDICES, ORT_SPARSE_BLOCK_SPARSE_INDICES }
 
enum  OrtLoggingLevel {
  ORT_LOGGING_LEVEL_VERBOSE, ORT_LOGGING_LEVEL_INFO, ORT_LOGGING_LEVEL_WARNING, ORT_LOGGING_LEVEL_ERROR,
  ORT_LOGGING_LEVEL_FATAL
}
 Logging severity levels. More...
 
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
}
 
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
}
 
enum  GraphOptimizationLevel { ORT_DISABLE_ALL = 0, ORT_ENABLE_BASIC = 1, ORT_ENABLE_EXTENDED = 2, ORT_ENABLE_ALL = 99 }
 Graph optimization level. More...
 
enum  ExecutionMode { ORT_SEQUENTIAL = 0, ORT_PARALLEL = 1 }
 
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
}
 Language projection identifiers /see OrtApi::SetLanguageProjection. More...
 
enum  OrtAllocatorType { OrtInvalidAllocator = -1, OrtDeviceAllocator = 0, OrtArenaAllocator = 1 }
 
enum  OrtMemType { OrtMemTypeCPUInput = -2, OrtMemTypeCPUOutput = -1, OrtMemTypeCPU = OrtMemTypeCPUOutput, OrtMemTypeDefault = 0 }
 Memory types for allocated memory, execution provider specific types should be extended in each provider. More...
 
enum  OrtMemoryInfoDeviceType { OrtMemoryInfoDeviceType_CPU = 0, OrtMemoryInfoDeviceType_GPU = 1, OrtMemoryInfoDeviceType_FPGA = 2 }
 This mimics OrtDevice type constants so they can be returned in the API. More...
 
enum  OrtCudnnConvAlgoSearch { OrtCudnnConvAlgoSearchExhaustive, OrtCudnnConvAlgoSearchHeuristic, OrtCudnnConvAlgoSearchDefault }
 Algorithm to use for cuDNN Convolution Op. More...
 
enum  OrtCustomOpInputOutputCharacteristic { INPUT_OUTPUT_REQUIRED = 0, INPUT_OUTPUT_OPTIONAL, INPUT_OUTPUT_VARIADIC }
 

Functions

 ORT_RUNTIME_CLASS (Env)
 
 ORT_RUNTIME_CLASS (Status)
 
 ORT_RUNTIME_CLASS (MemoryInfo)
 
 ORT_RUNTIME_CLASS (IoBinding)
 
 ORT_RUNTIME_CLASS (Session)
 
 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 (Op)
 
 ORT_RUNTIME_CLASS (OpAttr)
 
ORT_EXPORT const OrtApiBase
*ORT_API_CALL 
OrtGetApiBase (void) NO_EXCEPTION
 The Onnxruntime library's entry point to access the C API. More...
 
 ORT_API_STATUS (OrtSessionOptionsAppendExecutionProvider_CUDA, _In_ OrtSessionOptions *options, int device_id)
 
 ORT_API_STATUS (OrtSessionOptionsAppendExecutionProvider_MIGraphX, _In_ OrtSessionOptions *options, int device_id)
 

Detailed Description

ONNX Runtime C API

Macro Definition Documentation

#define ORT_API_VERSION   14

The API version defined in this header.

This value is used by some API functions to behave as this version of the header expects.

Definition at line 33 of file onnxruntime_c_api.h.

Typedef Documentation

Graph optimization level.

Refer to https://www.onnxruntime.ai/docs/resources/graph-optimizations.html for an in-depth understanding of Graph Optimizations

Copied from TensorProto::DataType Currently, Ort doesn't support complex64, complex128

typedef enum ONNXType ONNXType
typedef struct OrtAllocator OrtAllocator

Memory allocation interface.

Structure of function pointers that defines a memory allocator. This can be created and filled in by the user for custom allocators.

When an allocator is passed to any function, be sure that the allocator object is not destroyed until the last allocated object using it is freed.

typedef struct OrtApi OrtApi

Definition at line 576 of file onnxruntime_c_api.h.

typedef struct OrtApiBase OrtApiBase

Definition at line 595 of file onnxruntime_c_api.h.

CUDA Provider Options.

See Also
OrtApi::SessionOptionsAppendExecutionProvider_CUDA

Algorithm to use for cuDNN Convolution Op.

typedef OrtCustomThreadHandle(* OrtCustomCreateThreadFn)(void *ort_custom_thread_creation_options, OrtThreadWorkerFn ort_thread_worker_fn, void *ort_worker_fn_param)

Ort custom thread creation function.

The function should return a thread handle to be used in onnxruntime thread pools Onnxruntime will throw exception on return value of nullptr or 0, indicating that the function failed to create a thread

Definition at line 619 of file onnxruntime_c_api.h.

typedef void(* OrtCustomJoinThreadFn)(OrtCustomThreadHandle ort_custom_thread_handle)

Custom thread join function.

Onnxruntime thread pool destructor will call the function to join a custom thread. Argument ort_custom_thread_handle is the value returned by OrtCustomCreateThreadFn

Definition at line 626 of file onnxruntime_c_api.h.

typedef struct OrtCustomOp OrtCustomOp

Definition at line 332 of file onnxruntime_c_api.h.

typedef enum OrtErrorCode OrtErrorCode

Definition at line 330 of file onnxruntime_c_api.h.

typedef struct OrtKernelInfo OrtKernelInfo

Definition at line 328 of file onnxruntime_c_api.h.

Language projection identifiers /see OrtApi::SetLanguageProjection.

typedef void(ORT_API_CALL* OrtLoggingFunction)(void *param, OrtLoggingLevel severity, const char *category, const char *logid, const char *code_location, const char *message)

Definition at line 293 of file onnxruntime_c_api.h.

Logging severity levels.

In typical API usage, specifying a logging severity level specifies the minimum severity of log messages to show.

This mimics OrtDevice type constants so they can be returned in the API.

typedef enum OrtMemType OrtMemType

Memory types for allocated memory, execution provider specific types should be extended in each provider.

MIGraphX Provider Options.

See Also
OrtApi::SessionOptionsAppendExecutionProvider_MIGraphX

OpenVINO Provider Options.

See Also
OrtApi::SessionOptionsAppendExecutionProvider_OpenVINO

ROCM Provider Options.

See Also
OrtApi::SessionOptionsAppendExecutionProvider_ROCM
typedef OrtStatus* OrtStatusPtr

Definition at line 277 of file onnxruntime_c_api.h.

TensorRT Provider Options.

See Also
OrtApi::SessionOptionsAppendExecutionProvider_TensorRT
typedef void(* OrtThreadWorkerFn)(void *ort_worker_fn_param)

Thread work loop function.

Onnxruntime will provide the working loop on custom thread creation Argument is an onnxruntime built-in type which will be provided when thread pool calls OrtCustomCreateThreadFn

Definition at line 608 of file onnxruntime_c_api.h.

Definition at line 579 of file onnxruntime_c_api.h.

typedef OrtStatus*(ORT_API_CALL* RegisterCustomOpsFn)(OrtSessionOptions *options, const OrtApiBase *api)

Definition at line 628 of file onnxruntime_c_api.h.

Enumeration Type Documentation

Enumerator
ORT_SEQUENTIAL 
ORT_PARALLEL 

Definition at line 309 of file onnxruntime_c_api.h.

Graph optimization level.

Refer to https://www.onnxruntime.ai/docs/resources/graph-optimizations.html for an in-depth understanding of Graph Optimizations

Enumerator
ORT_DISABLE_ALL 
ORT_ENABLE_BASIC 
ORT_ENABLE_EXTENDED 
ORT_ENABLE_ALL 

Definition at line 302 of file onnxruntime_c_api.h.

Copied from TensorProto::DataType Currently, Ort doesn't support complex64, complex128

Enumerator
ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED 
ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT 
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8 
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8 
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16 
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16 
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32 
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64 
ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING 
ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL 
ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16 
ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE 
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32 
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64 
ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64 
ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128 
ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16 

Definition at line 155 of file onnxruntime_c_api.h.

enum ONNXType
Enumerator
ONNX_TYPE_UNKNOWN 
ONNX_TYPE_TENSOR 
ONNX_TYPE_SEQUENCE 
ONNX_TYPE_MAP 
ONNX_TYPE_OPAQUE 
ONNX_TYPE_SPARSETENSOR 
ONNX_TYPE_OPTIONAL 

Definition at line 176 of file onnxruntime_c_api.h.

Enumerator
OrtInvalidAllocator 
OrtDeviceAllocator 
OrtArenaAllocator 

Definition at line 334 of file onnxruntime_c_api.h.

Algorithm to use for cuDNN Convolution Op.

Enumerator
OrtCudnnConvAlgoSearchExhaustive 
OrtCudnnConvAlgoSearchHeuristic 
OrtCudnnConvAlgoSearchDefault 

Definition at line 360 of file onnxruntime_c_api.h.

Enumerator
INPUT_OUTPUT_REQUIRED 
INPUT_OUTPUT_OPTIONAL 
INPUT_OUTPUT_VARIADIC 

Definition at line 3902 of file onnxruntime_c_api.h.

Enumerator
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 

Definition at line 215 of file onnxruntime_c_api.h.

Language projection identifiers /see OrtApi::SetLanguageProjection.

Enumerator
ORT_PROJECTION_C 
ORT_PROJECTION_CPLUSPLUS 
ORT_PROJECTION_CSHARP 
ORT_PROJECTION_PYTHON 
ORT_PROJECTION_JAVA 
ORT_PROJECTION_WINML 
ORT_PROJECTION_NODEJS 

Definition at line 317 of file onnxruntime_c_api.h.

Logging severity levels.

In typical API usage, specifying a logging severity level specifies the minimum severity of log messages to show.

Enumerator
ORT_LOGGING_LEVEL_VERBOSE 

Verbose informational messages (least severe).

ORT_LOGGING_LEVEL_INFO 

Informational messages.

ORT_LOGGING_LEVEL_WARNING 

Warning messages.

ORT_LOGGING_LEVEL_ERROR 

Error messages.

ORT_LOGGING_LEVEL_FATAL 

Fatal error messages (most severe).

Definition at line 207 of file onnxruntime_c_api.h.

This mimics OrtDevice type constants so they can be returned in the API.

Enumerator
OrtMemoryInfoDeviceType_CPU 
OrtMemoryInfoDeviceType_GPU 
OrtMemoryInfoDeviceType_FPGA 

Definition at line 352 of file onnxruntime_c_api.h.

enum OrtMemType

Memory types for allocated memory, execution provider specific types should be extended in each provider.

Enumerator
OrtMemTypeCPUInput 

Any CPU memory used by non-CPU execution provider.

OrtMemTypeCPUOutput 

CPU accessible memory outputted by non-CPU execution provider, i.e. CUDA_PINNED.

OrtMemTypeCPU 

Temporary CPU accessible memory allocated by non-CPU execution provider, i.e. CUDA_PINNED.

OrtMemTypeDefault 

The default allocator for execution provider.

Definition at line 343 of file onnxruntime_c_api.h.

Enumerator
ORT_OP_ATTR_UNDEFINED 
ORT_OP_ATTR_INT 
ORT_OP_ATTR_INTS 
ORT_OP_ATTR_FLOAT 
ORT_OP_ATTR_FLOATS 
ORT_OP_ATTR_STRING 
ORT_OP_ATTR_STRINGS 

Definition at line 230 of file onnxruntime_c_api.h.

Enumerator
ORT_SPARSE_UNDEFINED 
ORT_SPARSE_COO 
ORT_SPARSE_CSRC 
ORT_SPARSE_BLOCK_SPARSE 

Definition at line 188 of file onnxruntime_c_api.h.

Enumerator
ORT_SPARSE_COO_INDICES 
ORT_SPARSE_CSR_INNER_INDICES 
ORT_SPARSE_CSR_OUTER_INDICES 
ORT_SPARSE_BLOCK_SPARSE_INDICES 

Definition at line 196 of file onnxruntime_c_api.h.

Function Documentation

ORT_API_STATUS ( OrtSessionOptionsAppendExecutionProvider_CUDA  ,
_In_ OrtSessionOptions *  options,
int  device_id 
)
ORT_API_STATUS ( OrtSessionOptionsAppendExecutionProvider_MIGraphX  ,
_In_ OrtSessionOptions *  options,
int  device_id 
)
ORT_RUNTIME_CLASS ( Env  )
ORT_RUNTIME_CLASS ( Status  )
ORT_RUNTIME_CLASS ( MemoryInfo  )
ORT_RUNTIME_CLASS ( IoBinding  )
ORT_RUNTIME_CLASS ( Session  )
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 ( Op  )
ORT_RUNTIME_CLASS ( OpAttr  )

The Onnxruntime library's entry point to access the C API.

Call this to get the a pointer to an OrtApiBase