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

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/docs-6.4.3/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/docs-6.4.3/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-2023, 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>
57 CK_TILE_DEVICE constexpr auto is_null_tile_window(const T&)
58 {
60 }
61 
62 template <typename WindowLengths>
63 CK_TILE_DEVICE constexpr auto make_null_tile_window(const WindowLengths& window_lengths)
64 {
66  "wrong! lengths should be static");
67 
68  return null_tile_window<remove_cvref_t<WindowLengths>>{window_lengths};
69 }
70 
71 template <typename WindowLengths, typename... Ts>
73  const WindowLengths& window_lengths,
74  const multi_index<WindowLengths::size()>& /*origin*/,
75  Ts&&...)
76 {
78  "wrong! lengths should be static");
79 
80  return null_tile_window<remove_cvref_t<WindowLengths>>{window_lengths};
81 }
82 
83 template <typename WindowLengths, typename StaticTileDistribution>
85  const StaticTileDistribution&)
86 {
87  return t;
88 }
89 
90 template <typename WindowLengths>
91 CK_TILE_DEVICE void
94 {
95 }
96 
97 } // namespace ck_tile
#define CK_TILE_DEVICE
Definition: config.hpp:40
Definition: cluster_descriptor.hpp:13
constexpr CK_TILE_DEVICE auto make_null_tile_window(const WindowLengths &window_lengths)
Definition: null_tile_window.hpp:63
int32_t index_t
Definition: integer.hpp:9
remove_cv_t< std::remove_reference_t< T > > remove_cvref_t
Definition: type_traits.hpp:20
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:72
CK_TILE_DEVICE void move_tile_window(null_tile_window< WindowLengths > &, const typename null_tile_window< WindowLengths >::BottomTensorIndex &)
Definition: null_tile_window.hpp:92
constexpr CK_TILE_DEVICE auto is_null_tile_window(const T &)
Definition: null_tile_window.hpp:57
bool_constant< false > false_type
Definition: integral_constant.hpp:55
bool_constant< true > true_type
Definition: integral_constant.hpp:54
Definition: array.hpp:24
Definition: null_tile_window.hpp:47
Definition: type_traits.hpp:75
Definition: tensor_view.hpp:401
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