alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
Array.hpp
Go to the documentation of this file.
1/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6#include "alpaka/alpaka.hpp"
7
8#include <cstddef>
9
10namespace alpaka::test
11{
12 template<typename TType, size_t TSize>
13 struct Array
14 {
15 TType m_data[TSize];
16
17 template<typename T_Idx>
18 ALPAKA_FN_HOST_ACC auto operator[](const T_Idx idx) const -> TType const&
19 {
20 return m_data[idx];
21 }
22
23 template<typename TIdx>
24 ALPAKA_FN_HOST_ACC auto operator[](const TIdx idx) -> TType&
25 {
26 return m_data[idx];
27 }
28 };
29} // namespace alpaka::test
#define ALPAKA_FN_HOST_ACC
Definition Common.hpp:39
The test specifics.
Definition TestAccs.hpp:27
TType m_data[TSize]
Definition Array.hpp:15
ALPAKA_FN_HOST_ACC auto operator[](const TIdx idx) -> TType &
Definition Array.hpp:24
ALPAKA_FN_HOST_ACC auto operator[](const T_Idx idx) const -> TType const &
Definition Array.hpp:18