alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
GridSyncBarrierCpuThread.hpp
Go to the documentation of this file.
1/* Copyright 2026 Mykhailo Varvarin
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6
11
12#include <thread>
13
14#ifdef ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLED
15
16namespace alpaka
17{
18 //! The thread id map barrier grid synchronization.
19 template<typename TIdx>
20 class GridSyncBarrierThread : public interface::Implements<ConceptGridSync, GridSyncBarrierThread<TIdx>>
21 {
22 public:
24
25 ALPAKA_FN_HOST GridSyncBarrierThread(TIdx const& blockThreadCount) : m_barrier(blockThreadCount)
26 {
27 }
28
30 };
31
32 namespace trait
33 {
34 template<typename TIdx>
36 {
37 ALPAKA_FN_HOST static auto syncGridThreads(GridSyncBarrierThread<TIdx> const& gridSync) -> void
38 {
39 gridSync.m_barrier.wait();
40 }
41 };
42
43 } // namespace trait
44} // namespace alpaka
45
46#endif
The thread id map barrier grid synchronization.
ALPAKA_FN_HOST GridSyncBarrierThread(TIdx const &blockThreadCount)
#define ALPAKA_FN_HOST
Definition Common.hpp:43
The alpaka accelerator library.
Tag used in class inheritance hierarchies that describes that a specific interface (TInterface) is im...
Definition Interface.hpp:15
static ALPAKA_FN_HOST auto syncGridThreads(GridSyncBarrierThread< TIdx > const &gridSync) -> void
The grid synchronization operation trait.
Definition Traits.hpp:21