tvm
|
Classes | |
class | ThreadGroup |
A platform-agnostic abstraction for managing a collection of thread pool threads. More... | |
Functions | |
void | Yield () |
Platform-agnostic no-op. More... | |
int | MaxConcurrency () |
void | SetMaxConcurrency (int value) |
Setting the maximum number of available cores. More... | |
void | ResetThreadPool () |
Reset the threads in the pool. All current threads are destroyed and new ones are created. More... | |
void | Configure (tvm::runtime::threading::ThreadGroup::AffinityMode mode, int nthreads, std::vector< unsigned int > cpus) |
Configuring the CPU affinity mode for the working threads. More... | |
int32_t | NumThreads () |
Get the number of threads being used by the TVM runtime. More... | |
void tvm::runtime::threading::Configure | ( | tvm::runtime::threading::ThreadGroup::AffinityMode | mode, |
int | nthreads, | ||
std::vector< unsigned int > | cpus | ||
) |
Configuring the CPU affinity mode for the working threads.
mode | The preferred CPU type (1 = big, -1 = little, -2 = kSpecifyOneCorePerThread, -3 = kSpecifyThreadShareAllCore). |
nthreads | The number of threads to use (0 = use all). |
cpus | A list of CPUs is used to set the 'cpu affinity' for the worker threads. |
int tvm::runtime::threading::MaxConcurrency | ( | ) |
int32_t tvm::runtime::threading::NumThreads | ( | ) |
Get the number of threads being used by the TVM runtime.
void tvm::runtime::threading::ResetThreadPool | ( | ) |
Reset the threads in the pool. All current threads are destroyed and new ones are created.
Note that this does nothing when openmp is used.
void tvm::runtime::threading::SetMaxConcurrency | ( | int | value | ) |
Setting the maximum number of available cores.
void tvm::runtime::threading::Yield | ( | ) |
Platform-agnostic no-op.