ONNX Runtime
Loading...
Searching...
No Matches
OrtApiBase Struct Reference

The helper interface to get the right version of OrtApi. More...

#include <onnxruntime_c_api.h>

Public Attributes

const OrtApi *(* GetApi )(uint32_t version)
 Get a pointer to the requested version of the OrtApi.
 
const char *(* GetVersionString )(void)
 Returns a null terminated string of the version of the Onnxruntime library (eg: "1.8.1")
 

Detailed Description

The helper interface to get the right version of OrtApi.

Get a pointer to this structure through OrtGetApiBase

Member Data Documentation

◆ GetApi

const OrtApi *( * OrtApiBase::GetApi) (uint32_t version)

Get a pointer to the requested version of the OrtApi.

Parameters
[in]versionMust be ORT_API_VERSION
Returns
The OrtApi for the version requested, nullptr will be returned if this version is unsupported, for example when using a runtime older than the version created with this header file.

One can call GetVersionString() to get the version of the Onnxruntime library for logging and error reporting purposes.

◆ GetVersionString

const char *( * OrtApiBase::GetVersionString) (void)

Returns a null terminated string of the version of the Onnxruntime library (eg: "1.8.1")

Returns
UTF-8 encoded version string. Do not deallocate the returned buffer.