cyqlone develop
Fast, parallel and vectorized solver for linear systems with optimal control structure.
Loading...
Searching...
No Matches
cyqlone::parallel::SharedContext Struct Reference

#include <cyqlone/parallel.hpp>

Detailed Description

Abstraction for a parallel execution context: a set of threads that can synchronize and communicate with each other using barriers.

See also
Context

Definition at line 31 of file parallel.hpp.

Public Types

using completion_type = EmptyCompletion
using barrier_type = TreeBarrier<completion_type, uint16_t>

Public Member Functions

template<class F>
void run (F &&)
 Execute the given function in parallel on all threads, blocking until completion.
uint32_t set_barrier_spin_count (uint32_t spin_count)
 Configure the barrier spin count used in parallel synchronization before falling back to a futex wait.

Public Attributes

const index_t num_thr
barrier_type barrier {static_cast<uint32_t>(num_thr), {}}

Member Typedef Documentation

◆ completion_type

◆ barrier_type

Member Function Documentation

◆ run()

template<class F>
void cyqlone::parallel::SharedContext::run ( F && f)

Execute the given function in parallel on all threads, blocking until completion.

The function will be called with a Context that contains the thread index, and that can be used to synchronize and communicate between threads.

Definition at line 191 of file parallel.hpp.

◆ set_barrier_spin_count()

uint32_t cyqlone::parallel::SharedContext::set_barrier_spin_count ( uint32_t spin_count)
inline

Configure the barrier spin count used in parallel synchronization before falling back to a futex wait.

Definition at line 53 of file parallel.hpp.

Member Data Documentation

◆ num_thr

const index_t cyqlone::parallel::SharedContext::num_thr

Definition at line 40 of file parallel.hpp.

◆ barrier

barrier_type cyqlone::parallel::SharedContext::barrier {static_cast<uint32_t>(num_thr), {}}

Definition at line 41 of file parallel.hpp.


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