cluster_descriptor.hpp Source File

cluster_descriptor.hpp Source File#

Composable Kernel: cluster_descriptor.hpp Source File
tile/core/algorithm/cluster_descriptor.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
3
4#pragma once
5
12
13namespace ck_tile {
14
15template <typename Lengths,
16 typename ArrangeOrder = typename arithmetic_sequence_gen<0, Lengths::size(), 1>::type>
18 const Lengths& lengths,
19 ArrangeOrder order = typename arithmetic_sequence_gen<0, Lengths::size(), 1>::type{})
20{
21 constexpr index_t ndim_low = Lengths::size();
22
23 const auto reordered_lengths = container_reorder_given_new2old(lengths, order);
24
25 const auto low_lengths = generate_tuple(
26 [&](auto idim_low) { return reordered_lengths[idim_low]; }, number<ndim_low>{});
27
28 const auto transform = make_merge_transform(low_lengths);
29
30 constexpr auto low_dim_old_top_ids = ArrangeOrder{};
31
32 constexpr auto up_dim_new_top_ids = sequence<0>{};
33
35 make_tuple(transform), make_tuple(low_dim_old_top_ids), make_tuple(up_dim_new_top_ids));
36}
37
38} // namespace ck_tile
#define CK_TILE_HOST_DEVICE
Definition config.hpp:42
auto transform(InputRange &&range, OutputIterator iter, UnaryOperation unary_op) -> decltype(std::transform(std::begin(range), std::end(range), iter, unary_op))
Definition algorithm.hpp:36
Definition tile/core/algorithm/cluster_descriptor.hpp:13
CK_TILE_HOST_DEVICE constexpr auto container_reorder_given_new2old(const array< TData, NSize > &old_array, sequence< IRs... >)
Definition tile/core/container/container_helper.hpp:39
CK_TILE_HOST_DEVICE constexpr auto make_merge_transform(const LowLengths &low_lengths)
Definition coordinate_transform.hpp:1615
CK_TILE_HOST_DEVICE constexpr auto make_single_stage_tensor_adaptor(const Transforms &transforms, LowerDimensionOldTopIdss, UpperDimensionNewTopIdss)
Definition tile/core/tensor/tensor_adaptor.hpp:359
constant< v > number
Definition tile/core/numeric/integral_constant.hpp:37
CK_TILE_HOST_DEVICE constexpr auto generate_tuple(F &&f, number< N >)
Definition tile/core/container/tuple.hpp:429
int32_t index_t
Definition integer.hpp:9
CK_TILE_HOST_DEVICE constexpr auto make_cluster_descriptor(const Lengths &lengths, ArrangeOrder order=typename arithmetic_sequence_gen< 0, Lengths::size(), 1 >::type{})
Definition tile/core/algorithm/cluster_descriptor.hpp:17
CK_TILE_HOST_DEVICE constexpr auto make_tuple(Xs &&... xs)
Definition tile/core/container/tuple.hpp:360
Definition tile/core/container/sequence.hpp:287
Definition tile/core/container/sequence.hpp:49