Treelite
|
Implemenation of parallel for loop. More...
#include <treelite/omp.h>
#include <treelite/logging.h>
#include <treelite/omp_exception.h>
#include <type_traits>
#include <algorithm>
#include <exception>
#include <mutex>
#include <cstddef>
#include <cstdint>
Go to the source code of this file.
Classes | |
struct | ThreadConfig |
Represent thread configuration, to be used with parallel loops. More... | |
struct | ParallelSchedule |
Functions | |
int | OmpGetThreadLimit () |
int | MaxNumThread () |
ThreadConfig | ConfigureThreadConfig (int nthread) |
Create therad configuration. More... | |
template<typename IndexType , typename FuncType > | |
void | ParallelFor (IndexType begin, IndexType end, const ThreadConfig &thread_config, ParallelSchedule sched, FuncType func) |
Implemenation of parallel for loop.
Copyright (c) 2021 by Contributors
Definition in file parallel_for.h.
|
inline |
Create therad configuration.
nthread | Number of threads to use. If <= 0, use all available threads. This value is validated to ensure that it's in a valid range. |
Definition at line 46 of file parallel_for.h.