37#ifdef __cpp_lib_format
43#ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED
47 template<
typename TDim,
typename TIdx,
typename TKernelFnObj,
typename... TArgs>
48 class TaskKernelCpuSerial;
54 template<
typename TDim,
typename TIdx>
69# ifdef ALPAKA_DISABLE_VENDOR_RNG
78 sizeof(TIdx) >=
sizeof(
int),
79 "Index type is not supported, consider using int or a larger type.");
83 template<
typename TDim2,
typename TIdx2,
typename TKernelFnObj,
typename... TArgs>
84 friend class ::alpaka::TaskKernelCpuSerial;
92 template<
typename TWorkDiv>
95 , gb::
IdxGbRef<TDim, TIdx>(m_gridBlockIdx)
98 , m_gridBlockIdx(
Vec<TDim, TIdx>::zeros())
110 template<
typename TDim,
typename TIdx>
111 struct AccType<AccCpuSerial<TDim, TIdx>>
113 using type = AccCpuSerial<TDim, TIdx>;
117 template<
typename TDim,
typename TIdx>
118 struct IsSingleThreadAcc<AccCpuSerial<TDim, TIdx>> : std::true_type
123 template<
typename TDim,
typename TIdx>
124 struct IsMultiThreadAcc<AccCpuSerial<TDim, TIdx>> : std::false_type
129 template<
typename TDim,
typename TIdx>
130 struct GetAccDevProps<AccCpuSerial<TDim, TIdx>>
135 static_cast<TIdx
>(1),
137 Vec<TDim, TIdx>::all(std::numeric_limits<TIdx>::max()),
139 std::numeric_limits<TIdx>::max(),
143 static_cast<TIdx
>(1),
145 Vec<TDim, TIdx>::all(std::numeric_limits<TIdx>::max()),
147 std::numeric_limits<TIdx>::max(),
156 template<
typename TDim,
typename TIdx>
157 struct GetAccName<AccCpuSerial<TDim, TIdx>>
161# if ALPAKA_COMP_CLANG
162# pragma clang diagnostic push
163# pragma clang diagnostic ignored "-Wexit-time-destructors"
165 using namespace std::literals;
166 static std::string
const accName =
167# ifdef __cpp_lib_format
173# if ALPAKA_COMP_CLANG
174# pragma clang diagnostic pop
180 template<
typename TDim,
typename TIdx>
181 struct DevType<AccCpuSerial<TDim, TIdx>>
187 template<
typename TDim,
typename TIdx>
188 struct DimType<AccCpuSerial<TDim, TIdx>>
194 template<
typename TDim,
typename TIdx,
typename TWorkDiv,
typename TKernelFnObj,
typename... TArgs>
195 struct CreateTaskKernel<AccCpuSerial<TDim, TIdx>, TWorkDiv, TKernelFnObj, TArgs...>
198 TWorkDiv
const& workDiv,
199 TKernelFnObj
const& kernelFnObj,
202 if(workDiv.m_blockThreadExtent.prod() !=
static_cast<TIdx
>(1u))
204 throw std::runtime_error(
205 "The given work division is not valid for a single thread Acc: "
206 +
getAccName<AccCpuSerial<TDim, TIdx>>() +
". Threads per block should be 1!");
209 return TaskKernelCpuSerial<TDim, TIdx, TKernelFnObj, TArgs...>(
212 std::forward<TArgs>(args)...);
217 template<
typename TDim,
typename TIdx>
218 struct PlatformType<AccCpuSerial<TDim, TIdx>>
220 using type = PlatformCpu;
224 template<
typename TDim,
typename TIdx>
225 struct IdxType<AccCpuSerial<TDim, TIdx>>
230 template<
typename TDim,
typename TIdx>
236 template<
typename TDim,
typename TIdx>
The CPU serial accelerator.
auto operator=(AccCpuSerial &&) -> AccCpuSerial &=delete
auto operator=(AccCpuSerial const &) -> AccCpuSerial &=delete
AccCpuSerial(AccCpuSerial &&)=delete
AccCpuSerial(AccCpuSerial const &)=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 serial CPU memory fence.
ALPAKA_NO_HOST_ACC_WARNING static ALPAKA_FN_HOST_ACC constexpr auto ones() -> Vec< TDim, TVal >
One 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
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_FN_HOST auto getAccName() -> std::string
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
Tag used in class inheritance hierarchies that describes that a specific interface (TInterface) is im...
static ALPAKA_FN_HOST auto getAccName() -> std::string