alpaka
Abstraction Library for Parallel Kernel Acceleration
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  template<typename TDim, typename TVal>
14  inline constexpr auto extentBuf = []
15  {
17  if constexpr(TDim::value > 0)
18  for(TVal i = 0; i < TVal{TDim::value}; i++)
19  v[i] = 11 - i;
20  return v;
21  }();
22 
23  template<typename TDim, typename TVal>
24  inline constexpr auto extentSubView = []
25  {
27  if constexpr(TDim::value > 0)
28  for(TVal i = 0; i < TVal{TDim::value}; i++)
29  v[i] = 8 - i * 2;
30  return v;
31  }();
32 
33  template<typename TDim, typename TVal>
34  inline constexpr auto offset = []
35  {
37  if constexpr(TDim::value > 0)
38  for(TVal i = 0; i < TVal{TDim::value}; i++)
39  v[i] = 2 + i;
40  return v;
41  }();
42 } // namespace alpaka::test
A n-dimensional vector.
Definition: Vec.hpp:38
The test specifics.
Definition: TestAccs.hpp:26
constexpr auto extentBuf
Definition: Extent.hpp:14
constexpr auto extentSubView
Definition: Extent.hpp:24
constexpr auto offset
Definition: Extent.hpp:34