alpaka
Abstraction Library for Parallel Kernel Acceleration
Traits.hpp
Go to the documentation of this file.
1 /* Copyright 2024 Aurora Perego
2  * SPDX-License-Identifier: MPL-2.0
3  */
4 
5 #pragma once
6 
7 #include "alpaka/acc/Tag.hpp"
8 #include "alpaka/core/Common.hpp"
10 
11 namespace alpaka
12 {
13 
14  namespace detail
15  {
16  template<concepts::Tag TTag, typename T>
18  {
19  // does not make use of TTag
20  using Type = std::remove_const_t<T>;
21  Type value; // backend specific value
22 
24  {
25  return &value;
26  }
27 
29  {
30  return value;
31  }
32  };
33 
34  template<concepts::Tag TTag, typename T>
36  {
38 
39  static_assert(IsImplementedFor, "Error: device global variables are not implemented for the given Tag");
40  };
41  } // namespace detail
42 
43  template<typename TAcc, typename T>
45 } // namespace alpaka
#define ALPAKA_FN_HOST_ACC
Definition: Common.hpp:39
The alpaka accelerator library.
typename detail::DevGlobalTrait< typename alpaka::trait::AccToTag< TAcc >::type, T >::Type DevGlobal
Definition: Traits.hpp:44
ALPAKA_FN_HOST_ACC T * operator&()
Definition: Traits.hpp:23
ALPAKA_FN_HOST_ACC T & get()
Definition: Traits.hpp:28
std::remove_const_t< T > Type
Definition: Traits.hpp:20
static constexpr bool const IsImplementedFor
Definition: Traits.hpp:37
A false_type being dependent on a ignored template parameter. This allows to use static_assert in uni...