#ifndef CK_INTEGRAL_CONSTANT_HPP #define CK_INTEGRAL_CONSTANT_HPP namespace ck { template struct integral_constant { static constexpr T value = v; typedef T value_type; typedef integral_constant type; __host__ __device__ constexpr operator value_type() const noexcept { return value; } __host__ __device__ constexpr value_type operator()() const noexcept { return value; } }; template struct is_same : public integral_constant { }; template struct is_same : public integral_constant { }; template using Number = integral_constant; template __host__ __device__ constexpr auto operator+(Number, Number) { return Number{}; } template __host__ __device__ constexpr auto operator-(Number, Number) { static_assert(Y <= X, "wrong!"); return Number{}; } template __host__ __device__ constexpr auto operator*(Number, Number) { return Number{}; } template __host__ __device__ constexpr auto operator/(Number, Number) { static_assert(Y > 0, "wrong!"); return Number{}; } template __host__ __device__ constexpr auto operator%(Number, Number) { static_assert(Y > 0, "wrong!"); return Number{}; } #if 0 static constexpr Number<0> 0_c; static constexpr Number<1> 1_c; static constexpr Number<2> 2_c; static constexpr Number<3> 3_c; static constexpr Number<4> 4_c; static constexpr Number<5> 5_c; static constexpr Number<6> 6_c; static constexpr Number<7> 7_c; static constexpr Number<8> 8_c; static constexpr Number<9> 9_c; #endif } // namespace ck #endif