Use Tuple and vector_type instead of Array for holding tensor data (#30)

* replacing array with tuple and vector for tensor data

[ROCm/composable_kernel commit: d075adf126]
This commit is contained in:
Chao Liu
2021-04-28 13:10:33 -05:00
committed by GitHub
parent 2501a44530
commit c67332b930
16 changed files with 1307 additions and 652 deletions

View File

@@ -5,11 +5,26 @@
namespace ck {
template <index_t... Is>
__host__ __device__ constexpr auto make_sequence(Number<Is>...)
{
return Sequence<Is...>{};
}
// F returns index_t
template <typename F, index_t N>
__host__ __device__ constexpr auto generate_sequence(F, Number<N>)
{
return typename sequence_gen<N, F>::type{};
}
// F returns Number<>
template <typename F, index_t N>
__host__ __device__ constexpr auto generate_sequence_v2(F&& f, Number<N>)
{
return unpack([&f](auto&&... xs) { return make_sequence(f(xs)...); },
typename arithmetic_sequence_gen<0, N, 1>::type{});
}
} // namespace ck
#endif