null_tile_window.hpp Source File

null_tile_window.hpp Source File#

Composable Kernel: null_tile_window.hpp Source File
null_tile_window.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.
3
4#pragma once
5
13
14namespace ck_tile {
15
16// placeholder type if we want to opt-out a tile window parameter
17template <typename WindowLengths_>
19{
22
23 using BottomTensorIndex = array<index_t, WindowLengths::size()>;
24
25 CK_TILE_DEVICE constexpr null_tile_window() = default;
26
27 CK_TILE_DEVICE constexpr null_tile_window(const WindowLengths& window_lengths)
28 : window_lengths_{window_lengths}
29 {
30 }
31
32 CK_TILE_DEVICE constexpr auto get_window_lengths() const { return window_lengths_; }
33
34 CK_TILE_DEVICE constexpr auto get_bottom_tensor_view() const { return null_tensor_view{}; }
35
36 CK_TILE_DEVICE constexpr auto get_window_origin() const { return BottomTensorIndex{}; }
37
39
41};
42
43// utility to check if this is a Null Tile Window
44namespace impl {
45template <typename>
46struct is_null_tile_window : public std::false_type
47{
48};
49
50template <typename T>
51struct is_null_tile_window<null_tile_window<T>> : public std::true_type
52{
53};
54} // namespace impl
55
56template <typename T>
58
59template <typename T>
64
65template <typename WindowLengths>
66CK_TILE_DEVICE constexpr auto make_null_tile_window(const WindowLengths& window_lengths)
67{
69 "wrong! lengths should be static");
70
72}
73
74template <typename WindowLengths, typename... Ts>
76 const WindowLengths& window_lengths,
77 const multi_index<WindowLengths::size()>& /*origin*/,
78 Ts&&...)
79{
81 "wrong! lengths should be static");
82
84}
85
86template <typename WindowLengths, typename StaticTileDistribution>
88 const StaticTileDistribution&)
89{
90 return t;
91}
92
93template <typename WindowLengths>
99
100} // namespace ck_tile
#define CK_TILE_DEVICE
Definition config.hpp:41
Definition tile/core/arch/amd_buffer_addressing.hpp:110
Definition tile/core/algorithm/cluster_descriptor.hpp:13
remove_cv_t< std::remove_reference_t< T > > remove_cvref_t
Definition type_traits.hpp:21
CK_TILE_DEVICE constexpr auto is_null_tile_window(const T &)
Definition null_tile_window.hpp:60
CK_TILE_DEVICE constexpr auto make_tile_window(null_tensor_view, const WindowLengths &window_lengths, const multi_index< WindowLengths::size()> &, Ts &&...)
Definition null_tile_window.hpp:75
array< index_t, N > multi_index
Definition tile/core/container/multi_index.hpp:17
constexpr bool is_null_tile_window_v
Definition null_tile_window.hpp:57
CK_TILE_DEVICE constexpr auto make_null_tile_window(const WindowLengths &window_lengths)
Definition null_tile_window.hpp:66
CK_TILE_DEVICE void move_tile_window(null_tile_window< WindowLengths > &, const typename null_tile_window< WindowLengths >::BottomTensorIndex &)
Definition null_tile_window.hpp:95
int32_t index_t
Definition integer.hpp:9
const GenericPointer< typename T::ValueType > T2 value
Definition pointer.h:1697
A fixed-size array container similar to std::array with additional utilities.
Definition tile/core/container/array.hpp:43
Definition null_tile_window.hpp:47
static constexpr bool value
Definition type_traits.hpp:77
Definition tensor_view.hpp:444
Definition null_tile_window.hpp:19
remove_cvref_t< WindowLengths_ > WindowLengths
Definition null_tile_window.hpp:21
CK_TILE_DEVICE constexpr auto get_bottom_tensor_view() const
Definition null_tile_window.hpp:34
CK_TILE_DEVICE constexpr null_tile_window(const WindowLengths &window_lengths)
Definition null_tile_window.hpp:27
CK_TILE_DEVICE constexpr auto get_window_lengths() const
Definition null_tile_window.hpp:32
null_tensor_view BottomTensorView
Definition null_tile_window.hpp:20
array< index_t, WindowLengths::size()> BottomTensorIndex
Definition null_tile_window.hpp:23
CK_TILE_DEVICE constexpr null_tile_window()=default
WindowLengths window_lengths_
Definition null_tile_window.hpp:40
CK_TILE_DEVICE void init_raw()
Definition null_tile_window.hpp:38
CK_TILE_DEVICE constexpr auto get_window_origin() const
Definition null_tile_window.hpp:36