30 template<
typename T, T... T_values>
35 template<
typename T, T... T_values>
41 template<
typename T, T... T_values>
44 return std::integer_sequence<T, T_values...>{};
47 template<
typename Int, Int... Is1, Int... Is2>
48 [[nodiscard]]
constexpr auto combine(std::integer_sequence<Int, Is1...>, std::integer_sequence<Int, Is2...>)
50 return std::integer_sequence<Int, Is1..., Is2...>{};
53 template<
typename Last>
59 template<
typename First,
typename... Rest>
60 [[nodiscard]]
constexpr auto concatenate(First first, Rest... rest)
65 template<
bool pred,
typename T, T T_v>
66 using selectValue = std::conditional_t<pred, std::integer_sequence<T>, std::integer_sequence<T, T_v>>;
78 template<
typename T_UnaryOp,
typename T, T... T_values>
79 [[nodiscard]]
constexpr auto filterValues(T_UnaryOp
const op, std::integer_sequence<T, T_values...> _)
93 template<
typename T_Seq>
96 template<
typename T,
template<
typename, T...>
typename T_Seq, T... T_values>
103 return ((value == T_values) || ...);
112 template<
typename T, T... T_values>
119 return ((value == T_values) || ...);
134 template<
typename T, u
int32_t T_dim>
137 using IotaSeq = std::make_integer_sequence<T, T_dim>;
152 template<
typename T, u
int32_t T_dim, T T_val>
155 auto concatCVec = []<T... T_values>(
CVec<T, T_values...>) ->
auto {
return CVec<T, T_values..., T_val>{}; };
157 static_assert(T_dim > 0);
158 if constexpr(T_dim == 1)
172 constexpr auto rightSeq = toIntegerSequence(right);
174 return integerSequenceToCVec(
#define ALPAKA_TYPEOF(...)
Get the type of instance.
Concept to check if a type is a CVector.
std::conditional_t< pred, std::integer_sequence< T >, std::integer_sequence< T, T_v > > selectValue
constexpr auto combine(std::integer_sequence< Int, Is1... >, std::integer_sequence< Int, Is2... >)
constexpr auto filterValues(T_UnaryOp const op, std::integer_sequence< T, T_values... > _)
Return all values of an integer sequence for which a filter returns true.
constexpr auto toIntegerSequence(alpaka::CVec< T, T_values... >)
constexpr auto integerSequenceToCVec(std::integer_sequence< T, T_values... >)
constexpr auto concatenate(Last last)
Vec< T, sizeof...(T_values), detail::CVec< T, T_values... > > CVec
A vector with compile-time known values.
consteval auto fillCVec()
Create and return a CVector of some length, filled with the given value.
consteval auto iotaCVec()
Create and return a CVector of the given length with values 1, 2, ...
constexpr auto filter(concepts::CVector auto left, concepts::CVector auto right)
Filter the left vector with the right vector's values.
constexpr bool operator()(T value) const
constexpr bool operator()(T value) const
A functor that can check for any of the contained values.