ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::builtin::ExternalContext Class Reference

#include <ExternalContext.h>

Public Member Functions

 ExternalContext ()
 
void setMaxNumThreads (int max_num_threads)
 
ruy::Context * ruy_context () const
 

Detailed Description

Definition at line 37 of file ExternalContext.h.

Constructor & Destructor Documentation

◆ ExternalContext()

onert::backend::builtin::ExternalContext::ExternalContext ( )
inline

Definition at line 43 of file ExternalContext.h.

43 : _ruy_context(std::make_unique<ruy::Context>())
44 {
45 setMaxNumThreads(onert::util::getConfigInt(onert::util::config::NUM_THREADS));
46 initPerThreadState();
47 }
void setMaxNumThreads(int max_num_threads)
int getConfigInt(const std::string &key)

References onert::util::getConfigInt(), and setMaxNumThreads().

Member Function Documentation

◆ ruy_context()

ruy::Context * onert::backend::builtin::ExternalContext::ruy_context ( ) const
inline

Definition at line 56 of file ExternalContext.h.

56{ return _ruy_context.get(); }

◆ setMaxNumThreads()

void onert::backend::builtin::ExternalContext::setMaxNumThreads ( int  max_num_threads)
inline

Definition at line 49 of file ExternalContext.h.

50 {
51 const int target_num_threads =
52 max_num_threads > -1 ? max_num_threads : kDefaultNumThreadpoolThreads;
53 _ruy_context->set_max_num_threads(target_num_threads);
54 }

References kDefaultNumThreadpoolThreads.

Referenced by ExternalContext().


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