Treelite
Classes | Functions
parallel_for.h File Reference

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>
Include dependency graph for parallel_for.h:
This graph shows which files directly or indirectly include this file:

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)
 

Detailed Description

Implemenation of parallel for loop.

Copyright (c) 2021 by Contributors

Author
Hyunsu Cho

Definition in file parallel_for.h.

Function Documentation

◆ ConfigureThreadConfig()

ThreadConfig treelite::threading_utils::ConfigureThreadConfig ( int  nthread)
inline

Create therad configuration.

Parameters
nthreadNumber of threads to use. If <= 0, use all available threads. This value is validated to ensure that it's in a valid range.
Returns
Thread configuration

Definition at line 46 of file parallel_for.h.