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

#include <ExternalContext.h>

Public Member Functions

 ExternalContext ()
 
void setMaxNumThreads (int max_num_threads)
 
int32_t maxNumThreads () const
 

Detailed Description

Definition at line 28 of file ExternalContext.h.

Constructor & Destructor Documentation

◆ ExternalContext()

onert::backend::ggml::ExternalContext::ExternalContext ( )

Definition at line 62 of file ExternalContext.cc.

63 : _max_num_threads(onert::util::getConfigInt(onert::util::config::NUM_THREADS)),
64 _ggml_context(std::unique_ptr<ggml_context, decltype(&ggml_free)>(
65 ggml_init({.mem_size = 0, .mem_buffer = nullptr, .no_alloc = true}), &ggml_free))
66{
67 if (_max_num_threads <= -1)
68 countPhysicalCores();
69}
int getConfigInt(const std::string &key)

Member Function Documentation

◆ maxNumThreads()

int32_t onert::backend::ggml::ExternalContext::maxNumThreads ( ) const
inline

Definition at line 36 of file ExternalContext.h.

36{ return _max_num_threads; }

◆ setMaxNumThreads()

void onert::backend::ggml::ExternalContext::setMaxNumThreads ( int  max_num_threads)

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