let more integral_constant->constant, and formating

This commit is contained in:
carlushuang
2024-03-13 18:33:10 +00:00
parent b1dbf64c91
commit 616932068d
9 changed files with 36 additions and 30 deletions

View File

@@ -60,7 +60,7 @@ struct sequence
CK_TILE_HOST_DEVICE static constexpr auto get()
{
static_assert(I < size(), "wrong! I too large");
return number<impl::at_index_t<I, integral_constant<value_type, Is>...>{}>{};
return number<impl::at_index_t<I, constant<Is>...>{}>{};
}
template <index_t I>
@@ -81,7 +81,7 @@ struct sequence
CK_TILE_HOST_DEVICE static constexpr auto at()
{
static_assert(I < size(), "wrong! I too large");
return number<impl::at_index_t<I, integral_constant<value_type, Is>...>{}>{};
return number<impl::at_index_t<I, constant<Is>...>{}>{};
}
template <index_t I>
@@ -384,7 +384,7 @@ template <index_t... Ids, index_t... Ns>
struct seq_reverse<sequence<Ids...>, Ns...>
{
template <index_t I>
using element = impl::at_index_t<I, integral_constant<index_t, Ns>...>;
using element = impl::at_index_t<I, constant<Ns>...>;
using type = sequence<element<(sizeof...(Ns) - 1 - Ids)>::value...>;
};
} // namespace impl

View File

@@ -274,6 +274,17 @@ struct tuple : impl::tuple_base<make_index_sequence<sizeof...(T)>, T...>
#undef TP_COM_
};
template <typename>
struct vector_traits;
// specialization for array
template <typename... T>
struct vector_traits<tuple<T...>>
{
using scalar_type = __type_pack_element<0, T...>;
static constexpr index_t vector_size = sizeof...(T);
};
// template <class... T>
// CK_TILE_HOST_DEVICE constexpr
// tuple<T...>