/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/core/tensor/null_tile_window.hpp Source File

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/core/tensor/null_tile_window.hpp Source File#

Composable Kernel: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/develop/include/ck_tile/core/tensor/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 
14 namespace ck_tile {
15 
16 // placeholder type if we want to opt-out a tile window parameter
17 template <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
44 namespace impl {
45 template <typename>
47 {
48 };
49 
50 template <typename T>
52 {
53 };
54 } // namespace impl
55 
56 template <typename T>
58 
59 template <typename T>
60 CK_TILE_DEVICE constexpr auto is_null_tile_window(const T&)
61 {
62  return is_null_tile_window_v<remove_cvref_t<T>>;
63 }
64 
65 template <typename WindowLengths>
66 CK_TILE_DEVICE constexpr auto make_null_tile_window(const WindowLengths& window_lengths)
67 {
69  "wrong! lengths should be static");
70 
71  return null_tile_window<remove_cvref_t<WindowLengths>>{window_lengths};
72 }
73 
74 template <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 
83  return null_tile_window<remove_cvref_t<WindowLengths>>{window_lengths};
84 }
85 
86 template <typename WindowLengths, typename StaticTileDistribution>
88  const StaticTileDistribution&)
89 {
90  return t;
91 }
92 
93 template <typename WindowLengths>
94 CK_TILE_DEVICE void
97 {
98 }
99 
100 } // namespace ck_tile
#define CK_TILE_DEVICE
Definition: config.hpp:41
Definition: cluster_descriptor.hpp:13
constexpr CK_TILE_DEVICE auto make_null_tile_window(const WindowLengths &window_lengths)
Definition: null_tile_window.hpp:66
int32_t index_t
Definition: integer.hpp:9
remove_cv_t< std::remove_reference_t< T > > remove_cvref_t
Definition: type_traits.hpp:21
constexpr bool is_null_tile_window_v
Definition: null_tile_window.hpp:57
constexpr CK_TILE_DEVICE auto make_tile_window(null_tensor_view, const WindowLengths &window_lengths, const multi_index< WindowLengths::size()> &, Ts &&...)
Definition: null_tile_window.hpp:75
CK_TILE_DEVICE void move_tile_window(null_tile_window< WindowLengths > &, const typename null_tile_window< WindowLengths >::BottomTensorIndex &)
Definition: null_tile_window.hpp:95
constexpr CK_TILE_DEVICE auto is_null_tile_window(const T &)
Definition: null_tile_window.hpp:60
bool_constant< false > false_type
Definition: integral_constant.hpp:63
bool_constant< true > true_type
Definition: integral_constant.hpp:62
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1350
A fixed-size array container similar to std::array with additional utilities.
Definition: array.hpp:43
Definition: null_tile_window.hpp:47
Definition: type_traits.hpp:76
Definition: tensor_view.hpp:444
Definition: null_tile_window.hpp:19
remove_cvref_t< WindowLengths_ > WindowLengths
Definition: null_tile_window.hpp:21
constexpr CK_TILE_DEVICE auto get_window_lengths() const
Definition: null_tile_window.hpp:32
constexpr CK_TILE_DEVICE auto get_bottom_tensor_view() const
Definition: null_tile_window.hpp:34
constexpr CK_TILE_DEVICE null_tile_window()=default
constexpr CK_TILE_DEVICE null_tile_window(const WindowLengths &window_lengths)
Definition: null_tile_window.hpp:27
WindowLengths window_lengths_
Definition: null_tile_window.hpp:40
CK_TILE_DEVICE void init_raw()
Definition: null_tile_window.hpp:38
constexpr CK_TILE_DEVICE auto get_window_origin() const
Definition: null_tile_window.hpp:36