TT-MLIR
experimental_tilize_llks_generated.h
Go to the documentation of this file.
1 // Auto-generated from /__w/tt-mlir/tt-mlir/include/ttmlir/Target/TTKernel/LLKs/experimental_tilize_llks.h - Do not edit directly
2 static constexpr char experimental_tilize_llks_generated[] = R"TTMLIR_STR_DELIM(
3 // SPDX-FileCopyrightText: (c) 2025 Tenstorrent AI ULC
4 //
5 // SPDX-License-Identifier: Apache-2.0
6 
7 #ifndef TTMLIR_TARGET_TTKERNEL_LLKS_EXPERIMENTAL_TILIZE_LLKS_H
8 #define TTMLIR_TARGET_TTKERNEL_LLKS_EXPERIMENTAL_TILIZE_LLKS_H
9 
10 namespace experimental {
11 using std::uint32_t;
12 
13 #ifdef TRISC_UNPACK
14 ALWI void llk_unpack_tilize(uint32_t operand, uint32_t tile_index,
15  uint32_t block_ct_dim, uint32_t start_tile_index) {
16  const uint32_t operand_id = get_operand_id(operand);
17  const uint32_t page_bytes = get_local_cb_interface(operand_id).fifo_page_size;
18  const uint32_t face_r_dim = get_operand_face_r_dim(operand_id);
19  const uint32_t num_faces = get_operand_num_faces(operand_id);
20  const bool narrow_tile = get_operand_narrow_tile(operand_id);
21 
22  const uint32_t base_address = get_local_cb_interface(operand_id).fifo_rd_ptr -
23  1; // Remove header size added by descriptor
24 
25  WAYPOINT("UPTW");
26  _llk_unpack_tilize_(base_address + (start_tile_index * page_bytes),
27  tile_index, unpack_src_format[operand_id], block_ct_dim,
28  face_r_dim, num_faces, narrow_tile);
29  WAYPOINT("UPTD");
30 }
31 
32 ALWI void llk_unpack_tilize_block(uint32_t operand, uint32_t block_c_tiles,
33  uint32_t start_tile_idx) {
34  for (uint32_t tile_index = 0; tile_index < block_c_tiles; tile_index++) {
35  llk_unpack_tilize(operand, tile_index, block_c_tiles, start_tile_idx);
36  }
37 }
38 #endif // TRISC_UNPACK
39 
40 ALWI void tilize_block(uint32_t icb, uint32_t ocb, uint32_t block_r,
41  uint32_t block_c) {
42  uint32_t start_tile_idx = 0;
43  for (uint32_t i = 0; i < block_r; i++) {
44  UNPACK((llk_unpack_tilize_block(icb, block_c, start_tile_idx)));
45 
46  for (uint32_t t = 0; t < block_c; t++) {
47  // Acquire dst
48  MATH((llk_math_wait_for_dest_available()));
49  PACK((llk_packer_wait_for_math_done()));
50 
51  // Datacopy
52  MATH((llk_math_eltwise_unary_datacopy<A2D, BroadcastType::NONE,
53  DST_ACCUM_MODE, UnpackToDestEn>(
54  0 /*dst index*/)));
55  PACK((llk_pack<false, false>(0 /*tile index*/, ocb)));
56 
57  // Release dest
58  MATH((llk_math_dest_section_done<DST_ACCUM_MODE>()));
59  PACK((llk_pack_dest_section_done<DST_ACCUM_MODE>()));
60  }
61  start_tile_idx += block_c;
62  }
63 }
64 } // namespace experimental
65 
66 #endif // TTMLIR_TARGET_TTKERNEL_LLKS_EXPERIMENTAL_TILIZE_LLKS_H
67 )TTMLIR_STR_DELIM";
static constexpr char experimental_tilize_llks_generated[]
Definition: experimental_tilize_llks_generated.h:2
static constexpr unsigned int experimental_tilize_llks_generated_len
Definition: experimental_tilize_llks_generated.h:68