"vscode:/vscode.git/clone" did not exist on "730548d4ecbc4eb7f8c26a44ee849329acee2b91"
integral_constant.hpp 439 Bytes
Newer Older
1
2
3
#ifndef CK_INTEGRAL_CONSTANT_HPP
#define CK_INTEGRAL_CONSTANT_HPP

Chao Liu's avatar
Chao Liu committed
4
namespace ck {
5

Chao Liu's avatar
Chao Liu committed
6
template <class T, T v>
Chao Liu's avatar
Chao Liu committed
7
8
9
10
struct integral_constant
{
    static constexpr T value = v;
    typedef T value_type;
Chao Liu's avatar
Chao Liu committed
11
    typedef integral_constant type;
Chao Liu's avatar
Chao Liu committed
12
    __host__ __device__ constexpr operator value_type() const noexcept { return value; }
Chao Liu's avatar
Chao Liu committed
13
    __host__ __device__ constexpr value_type operator()() const noexcept { return value; }
Chao Liu's avatar
Chao Liu committed
14
};
15

16
17
} // namespace ck
#endif