mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-05 14:11:29 +00:00
Reorganize files, Part 1 (#119)
* delete obselete files * move files * build * update cmake * update cmake * fix build * reorg examples * update cmake for example and test
This commit is contained in:
36
include/ck/utility/sequence_helper.hpp
Normal file
36
include/ck/utility/sequence_helper.hpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef CK_SEQUENCE_HELPER_HPP
|
||||
#define CK_SEQUENCE_HELPER_HPP
|
||||
|
||||
#include "tuple.hpp"
|
||||
|
||||
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{});
|
||||
}
|
||||
|
||||
template <index_t... Is>
|
||||
__host__ __device__ constexpr auto to_sequence(Tuple<Number<Is>...>)
|
||||
{
|
||||
return Sequence<Is...>{};
|
||||
}
|
||||
|
||||
} // namespace ck
|
||||
#endif
|
||||
Reference in New Issue
Block a user