HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
onnxruntime::Environment Class Reference

#include <environment.h>

Public Member Functions

logging::LoggingManagerGetLoggingManager () const
 
void SetLoggingManager (std::unique_ptr< onnxruntime::logging::LoggingManager > logging_manager)
 
onnxruntime::concurrency::ThreadPoolGetIntraOpThreadPool () const
 
onnxruntime::concurrency::ThreadPoolGetInterOpThreadPool () const
 
bool EnvCreatedWithGlobalThreadPools () const
 
Status RegisterAllocator (AllocatorPtr allocator)
 
Status CreateAndRegisterAllocator (const OrtMemoryInfo &mem_info, const OrtArenaCfg *arena_cfg=nullptr)
 
const std::vector< AllocatorPtr > & GetRegisteredSharedAllocators () const
 
Status UnregisterAllocator (const OrtMemoryInfo &mem_info)
 
 Environment ()=default
 

Static Public Member Functions

static Status Create (std::unique_ptr< logging::LoggingManager > logging_manager, std::unique_ptr< Environment > &environment, const OrtThreadingOptions *tp_options=nullptr, bool create_global_thread_pools=false)
 

Detailed Description

TODO: remove this class Provides the runtime environment for onnxruntime. Create one instance for the duration of execution.

Definition at line 20 of file environment.h.

Constructor & Destructor Documentation

onnxruntime::Environment::Environment ( )
default

Member Function Documentation

static Status onnxruntime::Environment::Create ( std::unique_ptr< logging::LoggingManager logging_manager,
std::unique_ptr< Environment > &  environment,
const OrtThreadingOptions *  tp_options = nullptr,
bool  create_global_thread_pools = false 
)
static

Create and initialize the runtime environment.

Parameters
loggingmanager instance that will enable per session logger output using session_options.session_logid as the logger id in messages. If nullptr, the default LoggingManager MUST have been created previously as it will be used for logging. This will use the default logger id in messages. See core/common/logging/logging.h for details, and how LoggingManager::DefaultLogger works.
tp_optionsoptional set of parameters controlling the number of intra and inter op threads for the global threadpools.
create_global_thread_poolsdetermine if this function will create the global threadpools or not.
Status onnxruntime::Environment::CreateAndRegisterAllocator ( const OrtMemoryInfo mem_info,
const OrtArenaCfg arena_cfg = nullptr 
)

Creates and registers an allocator for sharing between multiple sessions. Return an error if an allocator with the same OrtMemoryInfo is already registered.

bool onnxruntime::Environment::EnvCreatedWithGlobalThreadPools ( ) const
inline

Definition at line 54 of file environment.h.

onnxruntime::concurrency::ThreadPool* onnxruntime::Environment::GetInterOpThreadPool ( ) const
inline

Definition at line 50 of file environment.h.

onnxruntime::concurrency::ThreadPool* onnxruntime::Environment::GetIntraOpThreadPool ( ) const
inline

Definition at line 46 of file environment.h.

logging::LoggingManager* onnxruntime::Environment::GetLoggingManager ( ) const
inline

Definition at line 38 of file environment.h.

const std::vector<AllocatorPtr>& onnxruntime::Environment::GetRegisteredSharedAllocators ( ) const
inline

Returns the list of registered allocators in this env.

Definition at line 73 of file environment.h.

Status onnxruntime::Environment::RegisterAllocator ( AllocatorPtr  allocator)

Registers an allocator for sharing between multiple sessions. Return an error if an allocator with the same OrtMemoryInfo is already registered.

void onnxruntime::Environment::SetLoggingManager ( std::unique_ptr< onnxruntime::logging::LoggingManager logging_manager)
inline

Definition at line 42 of file environment.h.

Status onnxruntime::Environment::UnregisterAllocator ( const OrtMemoryInfo mem_info)

Removes registered allocator that was previously registered for sharing between multiple sessions.


The documentation for this class was generated from the following file: