41#ifdef __cpp_lib_format
47#ifdef ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLED
50# error If ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLED is set, the compiler has to support OpenMP 2.0 or higher!
55 template<
typename TDim,
typename TIdx,
typename TKernelFnObj,
bool TCooperative,
typename... TArgs>
63 template<
typename TDim,
typename TIdx>
79# ifdef ALPAKA_DISABLE_VENDOR_RNG
88 sizeof(TIdx) >=
sizeof(int),
89 "Index type is not supported, consider using int or a larger type.");
93 template<
typename TDim2,
typename TIdx2,
typename TKernelFnObj,
bool TCooperative,
typename... TArgs>
94 friend class ::alpaka::TaskKernelCpuOmp2Blocks;
102 template<
typename TWorkDiv>
105 , gb::
IdxGbRef<TDim, TIdx>(m_gridBlockIdx)
108 , m_gridBlockIdx(
Vec<TDim, TIdx>::zeros())
120 template<
typename TDim,
typename TIdx>
127 template<
typename TDim,
typename TIdx>
133 template<
typename TDim,
typename TIdx>
139 template<
typename TDim,
typename TIdx>
149 std::numeric_limits<TIdx>::max(),
153 static_cast<TIdx
>(1),
157 std::numeric_limits<TIdx>::max(),
168 template<
typename TDim,
typename TIdx>
173# if ALPAKA_COMP_CLANG
174# pragma clang diagnostic push
175# pragma clang diagnostic ignored "-Wexit-time-destructors"
177 using namespace std::literals;
178 static std::string
const accName =
179# ifdef __cpp_lib_format
186# if ALPAKA_COMP_CLANG
187# pragma clang diagnostic pop
193 template<
typename TDim,
typename TIdx>
200 template<
typename TDim,
typename TIdx>
207 template<
typename TDim,
typename TIdx,
typename TWorkDiv,
typename TKernelFnObj,
typename... TArgs>
211 TWorkDiv
const& workDiv,
212 TKernelFnObj
const& kernelFnObj,
215 if(workDiv.m_blockThreadExtent.prod() !=
static_cast<TIdx
>(1u))
217 throw std::runtime_error(
218 "The given work division is not valid for a single thread Acc: "
225 std::forward<TArgs>(args)...);
230 template<
typename TDim,
typename TIdx,
typename TWorkDiv,
typename TKernelFnObj,
typename... TArgs>
234 TWorkDiv
const& workDiv,
235 TKernelFnObj
const& kernelFnObj,
239 auto const maxBlocks = omp_get_max_threads();
240 if(gridBlockExtent.prod() >
static_cast<TIdx
>(maxBlocks))
242 throw std::runtime_error(
243 "The number of requested blocks is larger than maximuma of the device for OpenMP 2.0 blocks "
244 "accelerator. Requested: "
245 + std::to_string(gridBlockExtent.prod()) +
", maximum allowed: " + std::to_string(maxBlocks)
246 +
". Use getMaxActiveBlocks().");
252 std::forward<TArgs>(args)...);
257 template<
typename TDim,
typename TIdx>
264 template<
typename TDim,
typename TIdx>
270 template<
typename TDim,
typename TIdx>
276 template<
typename TDim,
typename TIdx>
The CPU OpenMP 2.0 block accelerator.
AccCpuOmp2Blocks(AccCpuOmp2Blocks const &)=delete
auto operator=(AccCpuOmp2Blocks const &) -> AccCpuOmp2Blocks &=delete
AccCpuOmp2Blocks(AccCpuOmp2Blocks &&)=delete
auto operator=(AccCpuOmp2Blocks &&) -> AccCpuOmp2Blocks &=delete
Dynamic block shared memory provider using fixed-size member array to allocate memory on the stack or...
static constexpr auto staticAllocBytes() -> std::uint32_t
auto staticMemBegin() const -> uint8_t *
auto staticMemCapacity() const -> std::uint32_t
Static block shared memory provider using a pointer to externally allocated fixed-size memory,...
The no op block synchronization.
The grid synchronization for OMP accelerators.
The CPU OpenMP 2.0 block memory fence.
The CPU OpenMP 2.0 block accelerator execution task.
ALPAKA_NO_HOST_ACC_WARNING static ALPAKA_FN_HOST_ACC constexpr auto ones() -> Vec< TDim, TVal >
One 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.
A zero block thread 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_FN_HOST auto getAccName() -> std::string
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 auto createTaskCooperativeKernel(TWorkDiv const &workDiv, TKernelFnObj const &kernelFnObj, TArgs &&... args)
The cooperative kernel execution task creation trait.
static auto createTaskKernel(TWorkDiv const &workDiv, TKernelFnObj const &kernelFnObj, TArgs &&... args)
The kernel execution task creation trait.
The dimension getter type trait.
static auto getAccDevProps(DevCpu const &dev) -> alpaka::AccDevProps< TDim, TIdx >
The device properties get trait.
static 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.