HDK
|
#include <environment.h>
Public Member Functions | |
logging::LoggingManager * | GetLoggingManager () const |
void | SetLoggingManager (std::unique_ptr< onnxruntime::logging::LoggingManager > logging_manager) |
onnxruntime::concurrency::ThreadPool * | GetIntraOpThreadPool () const |
onnxruntime::concurrency::ThreadPool * | GetInterOpThreadPool () 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 | |
Status | CreateAndRegisterAllocatorV2 (const std::string &provider_type, const OrtMemoryInfo &mem_info, const std::unordered_map< std::string, std::string > &options, const OrtArenaCfg *arena_cfg=nullptr) |
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) |
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.
|
default |
|
static |
Create and initialize the runtime environment.
logging | manager 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_options | optional set of parameters controlling the number of intra and inter op threads for the global threadpools. |
create_global_thread_pools | determine 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.
Status onnxruntime::Environment::CreateAndRegisterAllocatorV2 | ( | const std::string & | provider_type, |
const OrtMemoryInfo & | mem_info, | ||
const std::unordered_map< std::string, std::string > & | options, | ||
const OrtArenaCfg * | arena_cfg = nullptr |
||
) |
Create and register an allocator, specified by provider_type, for sharing between multiple sessions. Return an error if an allocator with the same OrtMemoryInfo is already registered. For provider_type please refer core/graph/constants.h
|
inline |
Definition at line 54 of file environment.h.
|
inline |
Definition at line 50 of file environment.h.
|
inline |
Definition at line 46 of file environment.h.
|
inline |
Definition at line 38 of file environment.h.
|
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.
|
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.