alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
IdxBtZero.hpp
Go to the documentation of this file.
1/* Copyright 2022 Axel Huebl, Benjamin Worpitz, Matthias Werner, Jan Stephan, Bernhard Manfred Gruber
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6
10#include "alpaka/vec/Vec.hpp"
11
12namespace alpaka
13{
14 namespace bt
15 {
16 //! A zero block thread index provider.
17 template<typename TDim, typename TIdx>
18 class IdxBtZero : public interface::Implements<ConceptIdxBt, IdxBtZero<TDim, TIdx>>
19 {
20 };
21 } // namespace bt
22
23 namespace trait
24 {
25 //! The zero block thread index provider dimension get trait specialization.
26 template<typename TDim, typename TIdx>
27 struct DimType<bt::IdxBtZero<TDim, TIdx>>
28 {
29 using type = TDim;
30 };
31
32 //! The zero block thread index provider block thread index get trait specialization.
33 template<typename TDim, typename TIdx>
34 struct GetIdx<bt::IdxBtZero<TDim, TIdx>, origin::Block, unit::Threads>
35 {
36 //! \return The index of the current thread in the block.
37 template<typename TWorkDiv>
38 ALPAKA_FN_HOST static auto getIdx(
39 bt::IdxBtZero<TDim, TIdx> const& /* idx */,
40 TWorkDiv const& /* workDiv */) -> Vec<TDim, TIdx>
41 {
43 }
44 };
45
46 //! The zero block thread index idx type trait specialization.
47 template<typename TDim, typename TIdx>
48 struct IdxType<bt::IdxBtZero<TDim, TIdx>>
49 {
50 using type = TIdx;
51 };
52 } // namespace trait
53} // namespace alpaka
ALPAKA_NO_HOST_ACC_WARNING static ALPAKA_FN_HOST_ACC constexpr auto zeros() -> Vec< TDim, TVal >
Zero value constructor.
Definition Vec.hpp:99
A zero block thread index provider.
Definition IdxBtZero.hpp:19
#define ALPAKA_FN_HOST
Definition Common.hpp:40
The alpaka accelerator library.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getIdx(TIdx const &idx, TWorkDiv const &workDiv) -> Vec< Dim< TWorkDiv >, Idx< TIdx > >
Get the indices requested.
Definition Accessors.hpp:23
Tag used in class inheritance hierarchies that describes that a specific interface (TInterface) is im...
Definition Interface.hpp:15