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
11namespace 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 {
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 {
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 {
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
A n-dimensional vector.
Definition Vec.hpp:38
The test specifics.
Definition TestAccs.hpp:27
constexpr auto extentBuf
Definition Extent.hpp:18
constexpr auto extentSubView
Definition Extent.hpp:28
constexpr auto offset
Definition Extent.hpp:38