HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
onnxruntime_c_api.h File Reference
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
+ Include dependency graph for onnxruntime_c_api.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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...
 
#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))
 
#define ORT_EXPORT
 
#define ORT_API_CALL
 
#define ORT_MUST_USE_RESULT   __attribute__((warn_unused_result))
 
#define ORTCHAR_T   char
 
#define ORT_TSTR(X)   X
 
#define NO_EXCEPTION
 
#define ORT_API(RETURN_TYPE, NAME,...)   RETURN_TYPE ORT_API_CALL NAME(__VA_ARGS__) NO_EXCEPTION
 
#define ORT_API_STATUS(NAME,...)
 
#define ORT_API2_STATUS(NAME,...)   _Check_return_ _Ret_maybenull_ OrtStatusPtr(ORT_API_CALL* NAME)(__VA_ARGS__) NO_EXCEPTION ORT_MUST_USE_RESULT
 
#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)
 
#define ORT_RUNTIME_CLASS(X)
 

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)
 

Macro Definition Documentation

#define _Check_return_

Definition at line 54 of file onnxruntime_c_api.h.

#define _Frees_ptr_opt_

Definition at line 51 of file onnxruntime_c_api.h.

#define _In_

Definition at line 42 of file onnxruntime_c_api.h.

#define _In_opt_

Definition at line 44 of file onnxruntime_c_api.h.

#define _In_opt_z_

Definition at line 45 of file onnxruntime_c_api.h.

#define _In_reads_ (   X)

Definition at line 56 of file onnxruntime_c_api.h.

#define _In_z_

Definition at line 43 of file onnxruntime_c_api.h.

#define _Inout_

Definition at line 49 of file onnxruntime_c_api.h.

#define _Inout_opt_

Definition at line 50 of file onnxruntime_c_api.h.

#define _Inout_updates_all_ (   X)

Definition at line 57 of file onnxruntime_c_api.h.

#define _Out_

Definition at line 46 of file onnxruntime_c_api.h.

#define _Out_opt_

Definition at line 48 of file onnxruntime_c_api.h.

#define _Out_writes_all_ (   X)

Definition at line 59 of file onnxruntime_c_api.h.

#define _Out_writes_bytes_all_ (   X)

Definition at line 58 of file onnxruntime_c_api.h.

#define _Outptr_

Definition at line 47 of file onnxruntime_c_api.h.

#define _Outptr_result_buffer_maybenull_ (   X)

Definition at line 61 of file onnxruntime_c_api.h.

#define _Outptr_result_maybenull_

Definition at line 55 of file onnxruntime_c_api.h.

#define _Ret_maybenull_

Definition at line 52 of file onnxruntime_c_api.h.

#define _Ret_notnull_

Definition at line 53 of file onnxruntime_c_api.h.

#define _Success_ (   X)

Definition at line 60 of file onnxruntime_c_api.h.

#define NO_EXCEPTION

Definition at line 117 of file onnxruntime_c_api.h.

#define ORT_ALL_ARGS_NONNULL   __attribute__((nonnull))

Definition at line 62 of file onnxruntime_c_api.h.

#define ORT_API (   RETURN_TYPE,
  NAME,
  ... 
)    RETURN_TYPE ORT_API_CALL NAME(__VA_ARGS__) NO_EXCEPTION

Definition at line 121 of file onnxruntime_c_api.h.

#define ORT_API2_STATUS (   NAME,
  ... 
)    _Check_return_ _Ret_maybenull_ OrtStatusPtr(ORT_API_CALL* NAME)(__VA_ARGS__) NO_EXCEPTION ORT_MUST_USE_RESULT

Definition at line 128 of file onnxruntime_c_api.h.

#define ORT_API_CALL

Definition at line 86 of file onnxruntime_c_api.h.

#define ORT_API_STATUS (   NAME,
  ... 
)
Value:
#define _Check_return_
#define ORT_API_CALL
#define _Ret_maybenull_
OrtStatus * OrtStatusPtr
#define _Success_(X)
#define NO_EXCEPTION
#define ORT_MUST_USE_RESULT

Definition at line 123 of file onnxruntime_c_api.h.

#define ORT_API_STATUS_IMPL (   NAME,
  ... 
)    _Success_(return == 0) _Check_return_ _Ret_maybenull_ OrtStatusPtr ORT_API_CALL NAME(__VA_ARGS__) NO_EXCEPTION

Definition at line 132 of file onnxruntime_c_api.h.

#define ORT_CLASS_RELEASE (   X)    void(ORT_API_CALL * Release##X)(_Frees_ptr_opt_ Ort##X * input)

Definition at line 135 of file onnxruntime_c_api.h.

#define ORT_EXPORT

Definition at line 84 of file onnxruntime_c_api.h.

#define ORT_MUST_USE_RESULT   __attribute__((warn_unused_result))

Definition at line 87 of file onnxruntime_c_api.h.

#define ORT_RUNTIME_CLASS (   X)
Value:
struct Ort##X; \
typedef struct Ort##X Ort##X;
X
Definition: ImathEuler.h:183

Definition at line 241 of file onnxruntime_c_api.h.

#define ORT_TSTR (   X)    X

Definition at line 95 of file onnxruntime_c_api.h.

#define ORTCHAR_T   char

Definition at line 88 of file onnxruntime_c_api.h.