/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ops/elementwise/pipeline/elementwise_shape.hpp Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ops/elementwise/pipeline/elementwise_shape.hpp Source File#

Composable Kernel: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/ops/elementwise/pipeline/elementwise_shape.hpp Source File
elementwise_shape.hpp
Go to the documentation of this file.
1 // SPDX-License-Identifier: MIT
2 // Copyright (c) 2025, Advanced Micro Devices, Inc. All rights reserved.
3 
4 #pragma once
5 
7 
8 namespace ck_tile {
9 
10 template <typename BlockWarps, typename BlockTile, typename WarpTile, typename ComputeDataType>
12 {
13  static constexpr index_t kBlockM = BlockTile::at(number<0>{});
14 
15  static constexpr index_t kWarpM = WarpTile::at(number<0>{});
16 
17  static constexpr index_t kVectorM =
18  min(static_cast<index_t>(16 / sizeof(ComputeDataType)), kWarpM / get_warp_size());
19 
20  static constexpr index_t kWarpPerBlockM = BlockWarps::at(number<0>{});
21 
22  static constexpr index_t kThreadPerWarpM = get_warp_size();
23 
25 
26  static constexpr index_t kBlockSize =
27  ck_tile::get_warp_size() * reduce_on_sequence(BlockWarps{}, multiplies{}, number<1>{});
28 };
29 
30 } // namespace ck_tile
Definition: cluster_descriptor.hpp:13
int32_t index_t
Definition: integer.hpp:9
constexpr CK_TILE_HOST_DEVICE index_t reduce_on_sequence(Seq, Reduce f, number< Init >)
Definition: sequence.hpp:979
constexpr CK_TILE_HOST_DEVICE T min(T x)
Definition: math.hpp:210
__host__ constexpr __device__ index_t get_warp_size()
Definition: get_id.hpp:42
Definition: elementwise_shape.hpp:12
static constexpr index_t kRepeatM
Definition: elementwise_shape.hpp:24
static constexpr index_t kWarpPerBlockM
Definition: elementwise_shape.hpp:20
static constexpr index_t kWarpM
Definition: elementwise_shape.hpp:15
static constexpr index_t kBlockSize
Definition: elementwise_shape.hpp:26
static constexpr index_t kBlockM
Definition: elementwise_shape.hpp:13
static constexpr index_t kThreadPerWarpM
Definition: elementwise_shape.hpp:22
static constexpr index_t kVectorM
Definition: elementwise_shape.hpp:17
Definition: integral_constant.hpp:13
Definition: math.hpp:98