9.1
general documentation
cs_host_context Class Reference

#include <cs_dispatch.h>

+ Inheritance diagram for cs_host_context:
+ Collaboration diagram for cs_host_context:

Public Member Functions

 cs_host_context ()
 
void set_n_min_per_cpu_thread (cs_lnum_t n)
 Set minimum number of elements threshold for CPU multithread execution. More...
 
cs_lnum_t n_min_per_cpu_thread (void)
 Get minimum number of elements threshold for CPU multithread execution. More...
 
void set_n_cpu_threads (int n)
 Set number of threads for CPU multithread execution. More...
 
int n_cpu_threads (void)
 Get number of threads for CPU multithread execution (-1 if automatic) More...
 
template<class F , class... Args>
bool parallel_for (cs_lnum_t n, F &&f, Args &&... args)
 Iterate using a plain omp parallel for. More...
 
template<class M , class F , class... Args>
bool parallel_for_i_faces (const M *m, F &&f, Args &&... args)
 
template<class M , class F , class... Args>
bool parallel_for_b_faces (const M *m, F &&f, Args &&... args)
 
template<class T , class F , class... Args>
bool parallel_for_reduce_sum (cs_lnum_t n, T &sum, F &&f, Args &&... args)
 Plain OpenMP parallel reduction with simple sum. More...
 
template<class T , class R , class F , class... Args>
bool parallel_for_reduce (cs_lnum_t n, T &result, R &reducer, F &&f, Args &&... args)
 OpenMP parallel reduction with general reducer. More...
 
template<class... Args>
bool wait (void)
 Wait upon completion. More...
 
template<class M >
bool try_get_parallel_for_i_faces_sum_type (const M *m, cs_dispatch_sum_type_t &st)
 
template<class M >
bool try_get_parallel_for_b_faces_sum_type (const M *m, cs_dispatch_sum_type_t &st)
 
- Public Member Functions inherited from cs_dispatch_context_mixin< cs_host_context >
decltype(auto) parallel_for (cs_lnum_t n, F &&f, Args &&... args)=delete
 
decltype(auto) parallel_for_i_faces (const M *m, F &&f, Args &&... args)
 
decltype(auto) parallel_for_b_faces (const M *m, F &&f, Args &&... args)
 
decltype(auto) parallel_for_reduce_sum (cs_lnum_t n, T &sum, F &&f, Args &&... args)=delete
 
decltype(auto) parallel_for_reduce (cs_lnum_t n, T &r, R &reducer, F &&f, Args &&... args)=delete
 
decltype(auto) wait (void)=delete
 
bool try_get_parallel_for_i_faces_sum_type (const M *m, cs_dispatch_sum_type_t &st)
 
bool try_get_parallel_for_b_faces_sum_type (const M *m, cs_dispatch_sum_type_t &st)
 

Constructor & Destructor Documentation

◆ cs_host_context()

cs_host_context ( )
inline

Member Function Documentation

◆ n_cpu_threads()

int n_cpu_threads ( void  )
inline

Get number of threads for CPU multithread execution (-1 if automatic)

◆ n_min_per_cpu_thread()

cs_lnum_t n_min_per_cpu_thread ( void  )
inline

Get minimum number of elements threshold for CPU multithread execution.

◆ parallel_for()

bool parallel_for ( cs_lnum_t  n,
F &&  f,
Args &&...  args 
)
inline

Iterate using a plain omp parallel for.

◆ parallel_for_b_faces()

bool parallel_for_b_faces ( const M *  m,
F &&  f,
Args &&...  args 
)
inline

Loop over the boundary faces of a mesh using a specific numbering that avoids conflicts between threads.

◆ parallel_for_i_faces()

bool parallel_for_i_faces ( const M *  m,
F &&  f,
Args &&...  args 
)
inline

Loop over the interior faces of a mesh using a specific numbering that avoids conflicts between threads.

◆ parallel_for_reduce()

bool parallel_for_reduce ( cs_lnum_t  n,
T &  result,
R &  reducer,
F &&  f,
Args &&...  args 
)
inline

OpenMP parallel reduction with general reducer.

◆ parallel_for_reduce_sum()

bool parallel_for_reduce_sum ( cs_lnum_t  n,
T &  sum,
F &&  f,
Args &&...  args 
)
inline

Plain OpenMP parallel reduction with simple sum.

◆ set_n_cpu_threads()

void set_n_cpu_threads ( int  n)
inline

Set number of threads for CPU multithread execution.

◆ set_n_min_per_cpu_thread()

void set_n_min_per_cpu_thread ( cs_lnum_t  n)
inline

Set minimum number of elements threshold for CPU multithread execution.

◆ try_get_parallel_for_b_faces_sum_type()

bool try_get_parallel_for_b_faces_sum_type ( const M *  m,
cs_dispatch_sum_type_t st 
)
inline

◆ try_get_parallel_for_i_faces_sum_type()

bool try_get_parallel_for_i_faces_sum_type ( const M *  m,
cs_dispatch_sum_type_t st 
)
inline

◆ wait()

bool wait ( void  )
inline

Wait upon completion.


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