alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
Extent.hpp
Go to the documentation of this file.
1
/* Copyright 2022 Benjamin Worpitz, Matthias Werner, Bernhard Manfred Gruber
2
* SPDX-License-Identifier: MPL-2.0
3
*/
4
5
#pragma once
6
7
#include "
alpaka/alpaka.hpp
"
8
9
#include <cstddef>
10
11
namespace
alpaka::test
12
{
13
#if ALPAKA_COMP_CLANG >= ALPAKA_VERSION_NUMBER(21, 0, 0)
14
# pragma clang diagnostic push
15
# pragma clang diagnostic ignored "-Wnrvo"
16
#endif
17
template
<
typename
TDim,
typename
TVal>
18
inline
constexpr
auto
extentBuf
= []
19
{
20
Vec<TDim, TVal>
v;
21
if
constexpr
(TDim::value > 0)
22
for
(TVal i = 0; i < TVal{TDim::value}; i++)
23
v[i] = 11 - i;
24
return
v;
25
}();
26
27
template
<
typename
TDim,
typename
TVal>
28
inline
constexpr
auto
extentSubView
= []
29
{
30
Vec<TDim, TVal>
v;
31
if
constexpr
(TDim::value > 0)
32
for
(TVal i = 0; i < TVal{TDim::value}; i++)
33
v[i] = 8 - i * 2;
34
return
v;
35
}();
36
37
template
<
typename
TDim,
typename
TVal>
38
inline
constexpr
auto
offset
= []
39
{
40
Vec<TDim, TVal>
v;
41
if
constexpr
(TDim::value > 0)
42
for
(TVal i = 0; i < TVal{TDim::value}; i++)
43
v[i] = 2 + i;
44
return
v;
45
}();
46
#if ALPAKA_COMP_CLANG >= ALPAKA_VERSION_NUMBER(21, 0, 0)
47
# pragma clang diagnostic pop
48
#endif
49
}
// namespace alpaka::test
alpaka.hpp
alpaka::Vec
A n-dimensional vector.
Definition
Vec.hpp:38
alpaka::test
The test specifics.
Definition
TestAccs.hpp:27
alpaka::test::extentBuf
constexpr auto extentBuf
Definition
Extent.hpp:18
alpaka::test::extentSubView
constexpr auto extentSubView
Definition
Extent.hpp:28
alpaka::test::offset
constexpr auto offset
Definition
Extent.hpp:38
include
alpaka
test
Extent.hpp
Generated on Tue Jun 9 2026 16:44:32 for alpaka by
1.9.8