ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::ruy::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 32 of file ExternalContext.h.

Constructor & Destructor Documentation

◆ ExternalContext()

onert::backend::ruy::ExternalContext::ExternalContext ( )
inline

Definition at line 38 of file ExternalContext.h.

38 : _ruy_context(new ::ruy::Context)
39 {
40 setMaxNumThreads(onert::util::getConfigInt(onert::util::config::NUM_THREADS));
41 }
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::ruy::ExternalContext::ruy_context ( ) const
inline

Definition at line 50 of file ExternalContext.h.

50{ return _ruy_context.get(); }

◆ setMaxNumThreads()

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

Definition at line 43 of file ExternalContext.h.

44 {
45 const int target_num_threads =
46 max_num_threads > -1 ? max_num_threads : kDefaultNumThreadpoolThreads;
47 _ruy_context->set_max_num_threads(target_num_threads);
48 }

References kDefaultNumThreadpoolThreads.

Referenced by ExternalContext().


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