39#ifdef __cpp_lib_format
45#ifdef ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLED
48# error If ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLED is set, the compiler has to support OpenMP 2.0 or higher!
55 template<
typename TDim,
typename TIdx,
typename TKernelFnObj,
typename... TArgs>
56 class TaskKernelCpuOmp2Threads;
62 template<
typename TDim,
typename TIdx>
78# ifdef ALPAKA_DISABLE_VENDOR_RNG
87 sizeof(TIdx) >=
sizeof(int),
88 "Index type is not supported, consider using int or a larger type.");
92 template<
typename TDim2,
typename TIdx2,
typename TKernelFnObj,
typename... TArgs>
93 friend class ::alpaka::TaskKernelCpuOmp2Threads;
101 template<
typename TWorkDiv>
104 , gb::
IdxGbRef<TDim, TIdx>(m_gridBlockIdx)
110 []()
noexcept {
return (::omp_get_thread_num() == 0); })
117 Vec<TDim, TIdx>
mutable m_gridBlockIdx;
123 template<
typename TDim,
typename TIdx>
130 template<
typename TDim,
typename TIdx>
136 template<
typename TDim,
typename TIdx>
142 template<
typename TDim,
typename TIdx>
154 static_cast<TIdx
>(1),
158 std::numeric_limits<TIdx>::max(),
166 std::numeric_limits<TIdx>::max(),
177 template<
typename TDim,
typename TIdx>
182# if ALPAKA_COMP_CLANG
183# pragma clang diagnostic push
184# pragma clang diagnostic ignored "-Wexit-time-destructors"
186 using namespace std::literals;
187 static std::string
const accName =
188# ifdef __cpp_lib_format
195# if ALPAKA_COMP_CLANG
196# pragma clang diagnostic pop
202 template<
typename TDim,
typename TIdx>
209 template<
typename TDim,
typename TIdx>
216 template<
typename TDim,
typename TIdx,
typename TWorkDiv,
typename TKernelFnObj,
typename... TArgs>
220 TWorkDiv
const& workDiv,
221 TKernelFnObj
const& kernelFnObj,
227 std::forward<TArgs>(args)...);
232 template<
typename TDim,
typename TIdx,
typename TWorkDiv,
typename TKernelFnObj,
typename... TArgs>
236 TWorkDiv
const& workDiv,
237 TKernelFnObj
const& kernelFnObj,
241 if(gridBlockExtent.prod() !=
static_cast<TIdx
>(1u))
243 throw std::runtime_error(
"OpenMP 2.0 thread accelerator supports only a single block operation "
244 "with cooperative kernel!\n"
245 "Consider useing a different CPU accelerator.");
251 std::forward<TArgs>(args)...);
256 template<
typename TDim,
typename TIdx>
263 template<
typename TDim,
typename TIdx>
269 template<
typename TDim,
typename TIdx>
275 template<
typename TDim,
typename TIdx>
The CPU OpenMP 2.0 thread accelerator.
AccCpuOmp2Threads(AccCpuOmp2Threads &&)=delete
AccCpuOmp2Threads(AccCpuOmp2Threads const &)=delete
auto operator=(AccCpuOmp2Threads &&) -> AccCpuOmp2Threads &=delete
auto operator=(AccCpuOmp2Threads const &) -> AccCpuOmp2Threads &=delete
Dynamic block shared memory provider using fixed-size member array to allocate memory on the stack or...
auto staticMemBegin() const -> uint8_t *
auto staticMemCapacity() const -> std::uint32_t
The OpenMP barrier block synchronization.
The grid synchronization for OMP accelerators.
The CPU OpenMP 2.0 block memory fence.
The CPU OpenMP 2.0 thread accelerator execution task.
ALPAKA_NO_HOST_ACC_WARNING static ALPAKA_FN_HOST_ACC constexpr auto zeros() -> Vec< TDim, TVal >
Zero value constructor.
ALPAKA_NO_HOST_ACC_WARNING static ALPAKA_FN_HOST_ACC constexpr auto all(TVal const &val) -> Vec< TDim, TVal >
Single value constructor.
A basic class holding the work division as grid block extent, block thread and thread element extent.
The OpenMP accelerator index provider.
A IdxGbRef grid block index.
IdxGbRef(Vec< TDim, TIdx > const &gridBlockIdx)
The standard library math trait specializations.
"Tiny" state mersenne twister implementation
constexpr std::string_view demangled
auto clipCast(V const &val) -> T
The alpaka accelerator library.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getWorkDiv(TWorkDiv const &workDiv) -> Vec< Dim< TWorkDiv >, Idx< TWorkDiv > >
Get the extent requested.
ALPAKA_FN_HOST auto getMemBytes(TDev const &dev) -> std::size_t
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_ACC auto syncBlockThreads(TBlockSync const &blockSync) -> void
Synchronizes all threads within the current block (independently for all blocks).
The acceleration properties on a device.
Tag used in class inheritance hierarchies that describes that a specific interface (TInterface) is im...
The accelerator type trait.
static ALPAKA_FN_HOST auto createTaskCooperativeKernel(TWorkDiv const &workDiv, TKernelFnObj const &kernelFnObj, TArgs &&... args)
The cooperative kernel execution task creation trait.
static ALPAKA_FN_HOST auto createTaskKernel(TWorkDiv const &workDiv, TKernelFnObj const &kernelFnObj, TArgs &&... args)
The kernel execution task creation trait.
The dimension getter type trait.
static ALPAKA_FN_HOST auto getAccDevProps(DevCpu const &dev) -> alpaka::AccDevProps< TDim, TIdx >
The device properties get trait.
static ALPAKA_FN_HOST auto getAccName() -> std::string
The accelerator name trait.
The multi thread accelerator trait.
The single thread accelerator trait.
The single-threaded warp to emulate it on CPUs.