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
7
#include "
alpaka/core/Interface.hpp
"
8
#include "
alpaka/core/Positioning.hpp
"
9
#include "
alpaka/idx/Traits.hpp
"
10
#include "
alpaka/vec/Vec.hpp
"
11
12
namespace
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
{
42
return
Vec<TDim, TIdx>::zeros
();
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
Interface.hpp
Positioning.hpp
Vec.hpp
alpaka::Vec
A n-dimensional vector.
Definition
Vec.hpp:38
alpaka::Vec::zeros
ALPAKA_NO_HOST_ACC_WARNING static ALPAKA_FN_HOST_ACC constexpr auto zeros() -> Vec< TDim, TVal >
Zero value constructor.
Definition
Vec.hpp:99
alpaka::bt::IdxBtZero
A zero block thread index provider.
Definition
IdxBtZero.hpp:19
ALPAKA_FN_HOST
#define ALPAKA_FN_HOST
Definition
Common.hpp:43
Traits.hpp
alpaka
The alpaka accelerator library.
Definition
AccCpuOmp2Blocks.hpp:52
alpaka::interface::Implements
Tag used in class inheritance hierarchies that describes that a specific interface (TInterface) is im...
Definition
Interface.hpp:15
alpaka::trait::DimType< bt::IdxBtZero< TDim, TIdx > >::type
TDim type
Definition
IdxBtZero.hpp:29
alpaka::trait::DimType
The dimension getter type trait.
Definition
Traits.hpp:14
alpaka::trait::GetIdx< bt::IdxBtZero< TDim, TIdx >, origin::Block, unit::Threads >::getIdx
static ALPAKA_FN_HOST auto getIdx(bt::IdxBtZero< TDim, TIdx > const &, TWorkDiv const &) -> Vec< TDim, TIdx >
Definition
IdxBtZero.hpp:38
alpaka::trait::GetIdx
The index get trait.
Definition
Traits.hpp:42
alpaka::trait::IdxType< bt::IdxBtZero< TDim, TIdx > >::type
TIdx type
Definition
IdxBtZero.hpp:50
alpaka::trait::IdxType
The idx type trait.
Definition
Traits.hpp:25
include
alpaka
idx
bt
IdxBtZero.hpp
Generated on Tue Sep 22 2026 12:51:58 for alpaka by
1.12.0