42 #ifdef ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLED
48 template<
typename TDim,
typename TIdx,
typename TKernelFnObj,
typename... TArgs>
49 class TaskKernelCpuTbbBlocks;
52 template<
typename TDim,
typename TIdx>
53 class AccCpuTbbBlocks final
55 ,
public gb::IdxGbRef<TDim, TIdx>
56 ,
public bt::IdxBtZero<TDim, TIdx>
61 ,
public math::MathStdLib
62 ,
public BlockSharedMemDynMember<>
63 ,
public BlockSharedMemStMember<>
64 ,
public BlockSyncNoOp
67 # ifdef ALPAKA_DISABLE_VENDOR_RNG
68 ,
public rand::RandDefault
72 ,
public warp::WarpSingleThread
73 ,
public interface::Implements<ConceptAcc, AccCpuTbbBlocks<TDim, TIdx>>
76 sizeof(TIdx) >=
sizeof(
int),
77 "Index type is not supported, consider using int or a larger type.");
81 template<
typename TDim2,
typename TIdx2,
typename TKernelFnObj,
typename... TArgs>
82 friend class ::alpaka::TaskKernelCpuTbbBlocks;
84 AccCpuTbbBlocks(AccCpuTbbBlocks
const&) =
delete;
85 AccCpuTbbBlocks(AccCpuTbbBlocks&&) =
delete;
86 auto operator=(AccCpuTbbBlocks
const&) -> AccCpuTbbBlocks& =
delete;
87 auto operator=(AccCpuTbbBlocks&&) -> AccCpuTbbBlocks& =
delete;
90 template<
typename TWorkDiv>
91 ALPAKA_FN_HOST AccCpuTbbBlocks(TWorkDiv
const& workDiv, std::size_t
const& blockSharedMemDynSizeBytes)
93 , gb::IdxGbRef<TDim, TIdx>(m_gridBlockIdx)
94 , BlockSharedMemDynMember<>(blockSharedMemDynSizeBytes)
95 , BlockSharedMemStMember<>(staticMemBegin(), staticMemCapacity())
96 , m_gridBlockIdx(
Vec<TDim, TIdx>::zeros())
102 Vec<TDim, TIdx>
mutable m_gridBlockIdx;
108 template<
typename TDim,
typename TIdx>
109 struct AccType<AccCpuTbbBlocks<TDim, TIdx>>
111 using type = AccCpuTbbBlocks<TDim, TIdx>;
115 template<
typename TDim,
typename TIdx>
116 struct IsSingleThreadAcc<AccCpuTbbBlocks<TDim, TIdx>> : std::true_type
121 template<
typename TDim,
typename TIdx>
122 struct IsMultiThreadAcc<AccCpuTbbBlocks<TDim, TIdx>> : std::false_type
127 template<
typename TDim,
typename TIdx>
128 struct GetAccDevProps<AccCpuTbbBlocks<TDim, TIdx>>
133 alpaka::core::clipCast<TIdx>(tbb::this_task_arena::max_concurrency()),
141 static_cast<TIdx
>(1),
147 static_cast<size_t>(AccCpuTbbBlocks<TDim, TIdx>::staticAllocBytes()),
154 template<
typename TDim,
typename TIdx>
155 struct GetAccName<AccCpuTbbBlocks<TDim, TIdx>>
159 return "AccCpuTbbBlocks<" + std::to_string(TDim::value) +
"," + core::demangled<TIdx> +
">";
164 template<
typename TDim,
typename TIdx>
165 struct DevType<AccCpuTbbBlocks<TDim, TIdx>>
171 template<
typename TDim,
typename TIdx>
172 struct DimType<AccCpuTbbBlocks<TDim, TIdx>>
178 template<
typename TDim,
typename TIdx,
typename TWorkDiv,
typename TKernelFnObj,
typename... TArgs>
179 struct CreateTaskKernel<AccCpuTbbBlocks<TDim, TIdx>, TWorkDiv, TKernelFnObj, TArgs...>
182 TWorkDiv
const& workDiv,
183 TKernelFnObj
const& kernelFnObj,
186 if(workDiv.m_blockThreadExtent.prod() !=
static_cast<TIdx
>(1u))
188 throw std::runtime_error(
189 "The given work division is not valid for a single thread Acc: "
190 +
getAccName<AccCpuTbbBlocks<TDim, TIdx>>() +
". Threads per block should be 1!");
193 return TaskKernelCpuTbbBlocks<TDim, TIdx, TKernelFnObj, TArgs...>(
196 std::forward<TArgs>(args)...);
201 template<
typename TDim,
typename TIdx>
202 struct PlatformType<AccCpuTbbBlocks<TDim, TIdx>>
204 using type = PlatformCpu;
208 template<
typename TDim,
typename TIdx>
209 struct IdxType<AccCpuTbbBlocks<TDim, TIdx>>
214 template<
typename TDim,
typename TIdx>
220 template<
typename TDim,
typename TIdx>
223 using type = alpaka::AccCpuTbbBlocks<TDim, TIdx>;
ALPAKA_NO_HOST_ACC_WARNING static constexpr ALPAKA_FN_HOST_ACC auto ones() -> Vec< TDim, TVal >
One value constructor.
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 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...
TinyMersenneTwister RandStdLib
The alpaka accelerator library.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC WorkDivMembers(alpaka::Vec< TDim, TIdx > const &gridBlockExtent, alpaka::Vec< TDim, TIdx > const &blockThreadExtent, alpaka::Vec< TDim, TIdx > const &elemExtent) -> WorkDivMembers< TDim, TIdx >
Deduction guide for the constructor which can be called without explicit template type parameters.
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_ACC Vec(TFirstIndex &&, TRestIndices &&...) -> Vec< DimInt< 1+sizeof...(TRestIndices)>, std::decay_t< TFirstIndex >>
ALPAKA_FN_HOST auto getAccName() -> std::string
alpaka::meta::InheritFromList< alpaka::meta::Unique< std::tuple< TGridAtomic, TBlockAtomic, TThreadAtomic, interface::Implements< ConceptAtomicGrids, TGridAtomic >, interface::Implements< ConceptAtomicBlocks, TBlockAtomic >, interface::Implements< ConceptAtomicThreads, TThreadAtomic > >> > AtomicHierarchy
build a single class to inherit from different atomic implementations
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
static ALPAKA_FN_HOST auto getAccName() -> std::string