cyqlone develop
Fast, parallel and vectorized solver for linear systems with optimal control structure.
Loading...
Searching...
No Matches
cyqlone::TreeBarrier< CompletionFn, PhaseType >::State Struct Reference

Detailed Description

template<typename CompletionFn = EmptyCompletion, class PhaseType = uint32_t>
struct cyqlone::TreeBarrier< CompletionFn, PhaseType >::State

Atomic counters for each level of the combining tree.

Aligned to avoid false sharing.

Definition at line 91 of file barrier.hpp.

Public Types

using atomic_byte = std::atomic<unsigned char>
using atomic_word = std::atomic<uint32_t>
using ticket_t = std::conditional_t<only_word_lock_free, atomic_word, atomic_byte>

Public Attributes

std::array< ticket_t, num_levelstickets {}

Static Public Attributes

static constexpr bool only_word_lock_free
static constexpr size_t num_levels = cache_line_size / sizeof(ticket_t)

Member Typedef Documentation

◆ atomic_byte

template<typename CompletionFn = EmptyCompletion, class PhaseType = uint32_t>
using cyqlone::TreeBarrier< CompletionFn, PhaseType >::State::atomic_byte = std::atomic<unsigned char>

Definition at line 92 of file barrier.hpp.

◆ atomic_word

template<typename CompletionFn = EmptyCompletion, class PhaseType = uint32_t>
using cyqlone::TreeBarrier< CompletionFn, PhaseType >::State::atomic_word = std::atomic<uint32_t>

Definition at line 93 of file barrier.hpp.

◆ ticket_t

template<typename CompletionFn = EmptyCompletion, class PhaseType = uint32_t>
using cyqlone::TreeBarrier< CompletionFn, PhaseType >::State::ticket_t = std::conditional_t<only_word_lock_free, atomic_word, atomic_byte>

Definition at line 98 of file barrier.hpp.

Member Data Documentation

◆ only_word_lock_free

template<typename CompletionFn = EmptyCompletion, class PhaseType = uint32_t>
bool cyqlone::TreeBarrier< CompletionFn, PhaseType >::State::only_word_lock_free
staticconstexpr
Initial value:
=
atomic_word::is_always_lock_free && !atomic_byte::is_always_lock_free

Definition at line 94 of file barrier.hpp.

◆ num_levels

template<typename CompletionFn = EmptyCompletion, class PhaseType = uint32_t>
size_t cyqlone::TreeBarrier< CompletionFn, PhaseType >::State::num_levels = cache_line_size / sizeof(ticket_t)
staticconstexpr

Definition at line 99 of file barrier.hpp.

◆ tickets

template<typename CompletionFn = EmptyCompletion, class PhaseType = uint32_t>
std::array<ticket_t, num_levels> cyqlone::TreeBarrier< CompletionFn, PhaseType >::State::tickets {}

Definition at line 100 of file barrier.hpp.


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