42 #ifdef ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLED
46 template<
typename TDim,
typename TIdx,
typename TKernelFnObj,
typename... TArgs>
47 class TaskKernelCpuThreads;
53 template<
typename TDim,
typename TIdx>
68 # ifdef ALPAKA_DISABLE_VENDOR_RNG
77 sizeof(TIdx) >=
sizeof(
int),
78 "Index type is not supported, consider using int or a larger type.");
82 template<
typename TDim2,
typename TIdx2,
typename TKernelFnObj,
typename... TArgs>
83 friend class ::alpaka::TaskKernelCpuThreads;
91 template<
typename TWorkDiv>
94 , gb::
IdxGbRef<TDim, TIdx>(m_gridBlockIdx)
101 [
this]() noexcept {
return (m_idMasterThread == std::this_thread::get_id()); })
102 , BlockSyncBarrierThread<TIdx>(getWorkDiv<Block, Threads>(workDiv).prod())
109 std::mutex
mutable m_mtxMapInsert;
110 typename bt::IdxBtRefThreadIdMap<TDim, TIdx>::
111 ThreadIdToIdxMap
mutable m_threadToIndexMap;
112 Vec<TDim, TIdx>
mutable m_gridBlockIdx;
115 std::thread::id
mutable m_idMasterThread;
121 template<
typename TDim,
typename TIdx>
128 template<
typename TDim,
typename TIdx>
134 template<
typename TDim,
typename TIdx>
140 template<
typename TDim,
typename TIdx>
146 auto const blockThreadCountMax =
static_cast<TIdx
>(8);
151 auto const blockThreadCountMax =
std::max(
152 static_cast<TIdx
>(1),
153 alpaka::core::clipCast<TIdx>(std::thread::hardware_concurrency() * 8));
157 static_cast<TIdx
>(1),
178 template<
typename TDim,
typename TIdx>
183 return "AccCpuThreads<" + std::to_string(TDim::value) +
"," + core::demangled<TIdx> +
">";
188 template<
typename TDim,
typename TIdx>
195 template<
typename TDim,
typename TIdx>
202 template<
typename TDim,
typename TIdx,
typename TWorkDiv,
typename TKernelFnObj,
typename... TArgs>
206 TWorkDiv
const& workDiv,
207 TKernelFnObj
const& kernelFnObj,
213 std::forward<TArgs>(args)...);
218 template<
typename TDim,
typename TIdx>
225 template<
typename TDim,
typename TIdx>
231 template<
typename TDim,
typename TIdx>
237 template<
typename TDim,
typename TIdx>
The CPU threads accelerator.
auto operator=(AccCpuThreads const &) -> AccCpuThreads &=delete
AccCpuThreads(AccCpuThreads &&)=delete
AccCpuThreads(AccCpuThreads const &)=delete
auto operator=(AccCpuThreads &&) -> AccCpuThreads &=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 thread id map barrier block synchronization.
The default CPU memory fence.
The CPU threads execution task.
ALPAKA_NO_HOST_ACC_WARNING static constexpr ALPAKA_FN_HOST_ACC auto all(TVal const &val) -> Vec< TDim, TVal >
Single value constructor.
ALPAKA_NO_HOST_ACC_WARNING static constexpr ALPAKA_FN_HOST_ACC auto zeros() -> Vec< TDim, TIdx >
Zero value constructor.
A basic class holding the work division as grid block extent, block thread and thread element extent.
The threads accelerator index provider.
ALPAKA_FN_HOST IdxBtRefThreadIdMap(ThreadIdToIdxMap const &mThreadToIndices)
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.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto max(T const &max_ctx, Tx const &x, Ty const &y)
Returns the larger of two arguments. NaNs are treated as missing data (between a NaN and a numeric va...
The alpaka accelerator library.
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 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) -> 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.