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

Configuration options for creating an OrtEnv. More...

#include <onnxruntime_c_api.h>

Public Attributes

uint32_t version
 Must be set to ORT_API_VERSION.
 
int32_t logging_severity_level
 The logging severity level for the environment. Must be set to a value from OrtLoggingLevel.
 
const char * log_id
 The log identifier. Must be set to a valid UTF-8 null-terminated string.
 
OrtLoggingFunction custom_logging_function
 Optional custom logging function. May be set to NULL.
 
void * custom_logging_param
 Optional state to pass as the first argument to OrtEnvCreationOptions::custom_logger_function. May be set to NULL.
 
const OrtThreadingOptionsthreading_options
 Optional threading options for creating an environment with global thread pools shared across sessions. May be set to NULL.
 
const OrtKeyValuePairsconfig_entries
 Optional environment configuration entries represented as string key-value pairs. May be set to NULL.
 

Detailed Description

Configuration options for creating an OrtEnv.

Note
The version field must be set to ORT_API_VERSION. This ensures forward compatibility as fields may be added in future versions.
Since
Version 1.24.

Member Data Documentation

◆ config_entries

const OrtKeyValuePairs* OrtEnvCreationOptions::config_entries

Optional environment configuration entries represented as string key-value pairs. May be set to NULL.

Note
The OrtKeyValuePairs instance is copied by ORT.
Refer to onnxruntime_env_config_keys.h for common config entry keys and their supported values.
An application provides environment-level configuration options for execution provider libraries by using keys with the prefix 'ep_factory.\<ep_name\>.'. Ex: the key 'ep_factory.my_ep.some_ep_key' represents a key named 'some_ep_key' that is meant to be consumed by an execution provider named 'my_ep'. Refer to the specific execution provider's documentation for valid keys and values.
An application may separately set session-level configuration options for execution providers via other APIs such as SessionOptionsAppendExecutionProvider_V2, which store configuration entries within OrtSessionOptions. If an environment-level configuration conflicts with a session-level configuration, then precedence is determined by the execution provider library itself.
Since
Version 1.24.

◆ custom_logging_function

OrtLoggingFunction OrtEnvCreationOptions::custom_logging_function

Optional custom logging function. May be set to NULL.

Note
The OrtEnvCreationOptions::custom_logging_param is provided as the first argument to this logging function. This allows passing custom state into the logging function.
This function is only called when a message's severity meets or exceeds the set logging severity level.
Since
Version 1.24.

◆ custom_logging_param

void* OrtEnvCreationOptions::custom_logging_param

Optional state to pass as the first argument to OrtEnvCreationOptions::custom_logger_function. May be set to NULL.

Since
Version 1.24.

◆ log_id

const char* OrtEnvCreationOptions::log_id

The log identifier. Must be set to a valid UTF-8 null-terminated string.

Note
This string identifier is copied by ORT.
Since
Version 1.24.

◆ logging_severity_level

int32_t OrtEnvCreationOptions::logging_severity_level

The logging severity level for the environment. Must be set to a value from OrtLoggingLevel.

Note
Logging messages which are less severe than the logging_severity_level are not emitted.
Serves as the default logging severity level for session creation and runs. Use OrtApi::SetSessionLogSeverityLevel to set a logging severity level for the creation of specific session. Use OrtApi::RunOptionsSetRunLogSeverityLevel to set a logging severity level for a specific session run.
Since
Version 1.24.

◆ threading_options

const OrtThreadingOptions* OrtEnvCreationOptions::threading_options

Optional threading options for creating an environment with global thread pools shared across sessions. May be set to NULL.

Note
The OrtThreadingOptions instance is copied by ORT.
Use OrtApi::CreateThreadingOptions() to create an instance of OrtThreadingOptions.
Use this in conjunction with OrtApi::DisablePerSessionThreads or else the session will use its own thread pools.
Since
Version 1.24.

◆ version

uint32_t OrtEnvCreationOptions::version

Must be set to ORT_API_VERSION.