Project
Loading...
Searching...
No Matches
o2::ml::OrtModel Class Reference

#include <OrtInterface.h>

Classes

struct  OrtVariables
 

Public Member Functions

 OrtModel ()=default
 
 OrtModel (std::unordered_map< std::string, std::string > optionsMap)
 
void init (std::unordered_map< std::string, std::string > optionsMap)
 
virtual ~OrtModel ()=default
 
void initOptions (std::unordered_map< std::string, std::string > optionsMap)
 
void initEnvironment ()
 
void initSession ()
 
void memoryOnDevice (int32_t=0)
 
bool isInitialized ()
 
void resetSession ()
 
std::vector< std::vector< int64_t > > getNumInputNodes () const
 
std::vector< std::vector< int64_t > > getNumOutputNodes () const
 
std::vector< std::string > getInputNames () const
 
std::vector< std::string > getOutputNames () const
 
Ort::SessionOptions * getSessionOptions ()
 
Ort::MemoryInfo * getMemoryInfo ()
 
Ort::Env * getEnv ()
 
int32_t getIntraOpNumThreads () const
 
int32_t getInterOpNumThreads () const
 
void setDeviceId (int32_t id)
 
void setIO ()
 
void setActiveThreads (int threads)
 
void setIntraOpNumThreads (int threads)
 
void setInterOpNumThreads (int threads)
 
void setEnv (Ort::Env *)
 
template<class I , class O >
std::vector< O > v2v (std::vector< I > &, bool=true)
 
template<class I , class O >
std::vector< O > inference (std::vector< I > &)
 
template<class I , class O >
std::vector< O > inference (std::vector< std::vector< I > > &)
 
template<class I , class O >
void inference (I *, int64_t, O *)
 
template<class I , class O >
void inference (I **, int64_t, O *)
 
void release (bool=false)
 

Detailed Description

Definition at line 43 of file OrtInterface.h.

Constructor & Destructor Documentation

◆ OrtModel() [1/2]

o2::ml::OrtModel::OrtModel ( )
default

◆ OrtModel() [2/2]

o2::ml::OrtModel::OrtModel ( std::unordered_map< std::string, std::string >  optionsMap)
inline

Definition at line 49 of file OrtInterface.h.

◆ ~OrtModel()

virtual o2::ml::OrtModel::~OrtModel ( )
virtualdefault

Member Function Documentation

◆ getEnv()

Ort::Env * o2::ml::OrtModel::getEnv ( )

Definition at line 183 of file OrtInterface.cxx.

◆ getInputNames()

std::vector< std::string > o2::ml::OrtModel::getInputNames ( ) const
inline

Definition at line 68 of file OrtInterface.h.

◆ getInterOpNumThreads()

int32_t o2::ml::OrtModel::getInterOpNumThreads ( ) const
inline

Definition at line 74 of file OrtInterface.h.

◆ getIntraOpNumThreads()

int32_t o2::ml::OrtModel::getIntraOpNumThreads ( ) const
inline

Definition at line 73 of file OrtInterface.h.

◆ getMemoryInfo()

Ort::MemoryInfo * o2::ml::OrtModel::getMemoryInfo ( )

Definition at line 178 of file OrtInterface.cxx.

◆ getNumInputNodes()

std::vector< std::vector< int64_t > > o2::ml::OrtModel::getNumInputNodes ( ) const
inline

Definition at line 66 of file OrtInterface.h.

◆ getNumOutputNodes()

std::vector< std::vector< int64_t > > o2::ml::OrtModel::getNumOutputNodes ( ) const
inline

Definition at line 67 of file OrtInterface.h.

◆ getOutputNames()

std::vector< std::string > o2::ml::OrtModel::getOutputNames ( ) const
inline

Definition at line 69 of file OrtInterface.h.

◆ getSessionOptions()

Ort::SessionOptions * o2::ml::OrtModel::getSessionOptions ( )

Definition at line 173 of file OrtInterface.cxx.

◆ inference() [1/4]

template<class I , class O >
void o2::ml::OrtModel::inference ( I **  input,
int64_t  input_size,
O *  output 
)

Definition at line 319 of file OrtInterface.cxx.

◆ inference() [2/4]

template<class I , class O >
void o2::ml::OrtModel::inference ( I *  input,
int64_t  input_size,
O *  output 
)

Definition at line 286 of file OrtInterface.cxx.

◆ inference() [3/4]

template<class I , class O >
std::vector< O > o2::ml::OrtModel::inference ( std::vector< I > &  input)

Definition at line 260 of file OrtInterface.cxx.

◆ inference() [4/4]

template<class I , class O >
std::vector< O > o2::ml::OrtModel::inference ( std::vector< std::vector< I > > &  inputs)

Definition at line 379 of file OrtInterface.cxx.

◆ init()

void o2::ml::OrtModel::init ( std::unordered_map< std::string, std::string >  optionsMap)
inline

Definition at line 50 of file OrtInterface.h.

◆ initEnvironment()

void o2::ml::OrtModel::initEnvironment ( )

Definition at line 102 of file OrtInterface.cxx.

◆ initOptions()

void o2::ml::OrtModel::initOptions ( std::unordered_map< std::string, std::string >  optionsMap)

Definition at line 42 of file OrtInterface.cxx.

◆ initSession()

void o2::ml::OrtModel::initSession ( )

Definition at line 127 of file OrtInterface.cxx.

◆ isInitialized()

bool o2::ml::OrtModel::isInitialized ( )
inline

Definition at line 62 of file OrtInterface.h.

◆ memoryOnDevice()

void o2::ml::OrtModel::memoryOnDevice ( int32_t  deviceIndex = 0)

For now prefer to use single allocation, enabled by O2/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu -> SetONNXGPUStream -> rocm_options.arena_extend_strategy = 0;

Definition at line 142 of file OrtInterface.cxx.

◆ release()

void o2::ml::OrtModel::release ( bool  profilingEnabled = false)

Definition at line 428 of file OrtInterface.cxx.

◆ resetSession()

void o2::ml::OrtModel::resetSession ( )

Definition at line 167 of file OrtInterface.cxx.

◆ setActiveThreads()

void o2::ml::OrtModel::setActiveThreads ( int  threads)
inline

Definition at line 79 of file OrtInterface.h.

◆ setDeviceId()

void o2::ml::OrtModel::setDeviceId ( int32_t  id)
inline

Definition at line 77 of file OrtInterface.h.

◆ setEnv()

void o2::ml::OrtModel::setEnv ( Ort::Env *  env)

Definition at line 253 of file OrtInterface.cxx.

◆ setInterOpNumThreads()

void o2::ml::OrtModel::setInterOpNumThreads ( int  threads)
inline

Definition at line 86 of file OrtInterface.h.

◆ setIntraOpNumThreads()

void o2::ml::OrtModel::setIntraOpNumThreads ( int  threads)
inline

Definition at line 80 of file OrtInterface.h.

◆ setIO()

void o2::ml::OrtModel::setIO ( )

Definition at line 203 of file OrtInterface.cxx.

◆ v2v()

template<class I , class O >
std::vector< O > o2::ml::OrtModel::v2v ( std::vector< I > &  input,
bool  clearInput = true 
)

Definition at line 189 of file OrtInterface.cxx.


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