38#ifdef __cpp_lib_format
44#ifdef ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLED
47# error If ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLED is set, the compiler has to support OpenMP 2.0 or higher!
54 template<
typename TDim,
typename TIdx,
typename TKernelFnObj,
typename... TArgs>
55 class TaskKernelCpuOmp2Threads;
61 template<
typename TDim,
typename TIdx>
76# ifdef ALPAKA_DISABLE_VENDOR_RNG
85 sizeof(TIdx) >=
sizeof(
int),
86 "Index type is not supported, consider using int or a larger type.");
90 template<
typename TDim2,
typename TIdx2,
typename TKernelFnObj,
typename... TArgs>
91 friend class ::alpaka::TaskKernelCpuOmp2Threads;
99 template<
typename TWorkDiv>
102 , gb::
IdxGbRef<TDim, TIdx>(m_gridBlockIdx)
108 []()
noexcept {
return (::omp_get_thread_num() == 0); })
109 , m_gridBlockIdx(Vec<TDim, TIdx>::zeros())
115 Vec<TDim, TIdx>
mutable m_gridBlockIdx;
121 template<
typename TDim,
typename TIdx>
122 struct AccType<AccCpuOmp2Threads<TDim, TIdx>>
124 using type = AccCpuOmp2Threads<TDim, TIdx>;
128 template<
typename TDim,
typename TIdx>
129 struct IsSingleThreadAcc<AccCpuOmp2Threads<TDim, TIdx>> : std::false_type
134 template<
typename TDim,
typename TIdx>
135 struct IsMultiThreadAcc<AccCpuOmp2Threads<TDim, TIdx>> : std::true_type
140 template<
typename TDim,
typename TIdx>
141 struct GetAccDevProps<AccCpuOmp2Threads<TDim, TIdx>>
152 static_cast<TIdx
>(1),
154 Vec<TDim, TIdx>::all(std::numeric_limits<TIdx>::max()),
156 std::numeric_limits<TIdx>::max(),
164 std::numeric_limits<TIdx>::max(),
173 template<
typename TDim,
typename TIdx>
174 struct GetAccName<AccCpuOmp2Threads<TDim, TIdx>>
178# if ALPAKA_COMP_CLANG
179# pragma clang diagnostic push
180# pragma clang diagnostic ignored "-Wexit-time-destructors"
182 using namespace std::literals;
183 static std::string
const accName =
184# ifdef __cpp_lib_format
191# if ALPAKA_COMP_CLANG
192# pragma clang diagnostic pop
198 template<
typename TDim,
typename TIdx>
199 struct DevType<AccCpuOmp2Threads<TDim, TIdx>>
205 template<
typename TDim,
typename TIdx>
206 struct DimType<AccCpuOmp2Threads<TDim, TIdx>>
212 template<
typename TDim,
typename TIdx,
typename TWorkDiv,
typename TKernelFnObj,
typename... TArgs>
213 struct CreateTaskKernel<AccCpuOmp2Threads<TDim, TIdx>, TWorkDiv, TKernelFnObj, TArgs...>
216 TWorkDiv
const& workDiv,
217 TKernelFnObj
const& kernelFnObj,
220 return TaskKernelCpuOmp2Threads<TDim, TIdx, TKernelFnObj, TArgs...>(
223 std::forward<TArgs>(args)...);
228 template<
typename TDim,
typename TIdx>
229 struct PlatformType<AccCpuOmp2Threads<TDim, TIdx>>
231 using type = PlatformCpu;
235 template<
typename TDim,
typename TIdx>
236 struct IdxType<AccCpuOmp2Threads<TDim, TIdx>>
241 template<
typename TDim,
typename TIdx>
247 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 CPU OpenMP 2.0 block memory fence.
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
The single-threaded warp to emulate it on CPUs.
auto clipCast(V const &val) -> T
The alpaka accelerator library.
ALPAKA_FN_HOST auto getAccDevProps(TDev const &dev) -> AccDevProps< Dim< TAcc >, Idx< TAcc > >
ALPAKA_FN_HOST auto createTaskKernel(TWorkDiv const &workDiv, TKernelFnObj const &kernelFnObj, TArgs &&... args)
Creates a kernel execution task.
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).
typename trait::AccToTag< TAcc >::type AccToTag
maps an acc type to a tag type
typename trait::TagToAcc< TTag, TDim, TIdx >::type TagToAcc
maps a tag type to an acc type
The acceleration properties on a device.
Tag used in class inheritance hierarchies that describes that a specific interface (TInterface) is im...
static ALPAKA_FN_HOST auto getAccName() -> std::string