ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nnfw::cker::eigen_support::EigenContext Struct Reference

#include <EigenSupport.h>

Public Member Functions

 EigenContext ()
 

Static Public Member Functions

static EigenContextGetEigenContext ()
 

Data Fields

std::unique_ptr< Eigen::ThreadPoolInterface > thread_pool_wrapper
 
std::unique_ptr< Eigen::ThreadPoolDevice > device
 

Static Public Attributes

static constexpr int default_num_threadpool_threads = 4
 

Detailed Description

Definition at line 85 of file EigenSupport.h.

Constructor & Destructor Documentation

◆ EigenContext()

nnfw::cker::eigen_support::EigenContext::EigenContext ( )
inline

Definition at line 91 of file EigenSupport.h.

92 {
93 int num_threads = std::thread::hardware_concurrency();
94 if (num_threads == 0)
95 {
97 }
98 device.reset(); // destroy before we invalidate the thread pool
99 thread_pool_wrapper.reset(new EigenThreadPoolWrapper(new Eigen::ThreadPool(num_threads)));
100 device.reset(new Eigen::ThreadPoolDevice(thread_pool_wrapper.get(), num_threads));
101 }
static constexpr int default_num_threadpool_threads
std::unique_ptr< Eigen::ThreadPoolInterface > thread_pool_wrapper
std::unique_ptr< Eigen::ThreadPoolDevice > device

References default_num_threadpool_threads, device, and thread_pool_wrapper.

Member Function Documentation

◆ GetEigenContext()

static EigenContext & nnfw::cker::eigen_support::EigenContext::GetEigenContext ( )
inlinestatic

Definition at line 103 of file EigenSupport.h.

104 {
105 static EigenContext instance;
106 return instance;
107 }

Referenced by nnfw::cker::eigen_support::GetThreadPoolDevice().

Field Documentation

◆ default_num_threadpool_threads

constexpr int nnfw::cker::eigen_support::EigenContext::default_num_threadpool_threads = 4
staticconstexpr

Definition at line 87 of file EigenSupport.h.

Referenced by EigenContext().

◆ device

std::unique_ptr<Eigen::ThreadPoolDevice> nnfw::cker::eigen_support::EigenContext::device

Definition at line 89 of file EigenSupport.h.

Referenced by EigenContext().

◆ thread_pool_wrapper

std::unique_ptr<Eigen::ThreadPoolInterface> nnfw::cker::eigen_support::EigenContext::thread_pool_wrapper

Definition at line 88 of file EigenSupport.h.

Referenced by EigenContext().


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