alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
Tag.hpp
Go to the documentation of this file.
1/* Copyright 2024 René Widera
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6
7#include <type_traits>
8
9namespace alpaka
10{
11 template<typename T_Id = decltype([]() -> void {})>
12 struct Tag
13 {
14 };
15
16#define ALPAKA_TAG(name) \
17 constexpr Tag<std::integral_constant<size_t, __COUNTER__>> name \
18 { \
19 }
20
21 namespace trait
22 {
23 template<typename T_Object, typename T_Sfinae = void>
24 struct IsTag : std::false_type
25 {
26 };
27
28 template<typename T_Id>
29 struct IsTag<Tag<T_Id>> : std::true_type
30 {
31 };
32
33 template<typename T_Id>
34 constexpr bool isTag_v = IsTag<T_Id>::value;
35
36 } // namespace trait
37
38} // namespace alpaka
constexpr bool isTag_v
Definition Tag.hpp:34
main alpaka namespace.
Definition alpaka.hpp:76