alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
Traits.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
7#include <type_traits>
8#include <utility>
9
10namespace alpaka
11{
13 {
14 };
15
17 {
18 };
19
20 //! The idx trait.
21 namespace trait
22 {
23 //! The idx type trait.
24 template<typename T, typename TSfinae = void>
25 struct IdxType;
26 } // namespace trait
27
28 template<typename T>
29 using Idx = typename trait::IdxType<T>::type;
30
31 namespace trait
32 {
33 //! The arithmetic idx type trait specialization.
34 template<typename T>
35 struct IdxType<T, std::enable_if_t<std::is_arithmetic_v<T>>>
36 {
37 using type = std::decay_t<T>;
38 };
39
40 //! The index get trait.
41 template<typename TIdx, typename TOrigin, typename TUnit, typename TSfinae = void>
42 struct GetIdx;
43 } // namespace trait
44} // namespace alpaka
The alpaka accelerator library.
typename trait::IdxType< T >::type Idx
Definition Traits.hpp:29
STL namespace.
The index get trait.
Definition Traits.hpp:42
The idx type trait.
Definition Traits.hpp:25