File size: 1,048 Bytes
58ba6df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// SPDX-FileCopyrightText: © 2026 Tenstorrent Inc.
// SPDX-License-Identifier: Apache-2.0
// Round 10: MANO-head cross-op weight prefetch (tt_kernels.hgemv(prefetch=...)).  Runs on the cores of the NEXT hgemv
// (disjoint from this program's GEMV cores): each copies its packed weight column run (one contiguous DRAM run) into
// its shard of a persistent L1 buffer, which the next hgemv uses as its weight CB (HG_WL1).  The next program starts
// only after this one has finished, so no further synchronization is needed.
// runtime: active, w_addr, bank, bank offset, dst (L1), bytes
#include <stdint.h>
#include "api/dataflow/dataflow_api.h"

void kernel_main() {
    if (!get_arg_val<uint32_t>(0)) {
        return;
    }
    const uint32_t w_addr = get_arg_val<uint32_t>(1), bank = get_arg_val<uint32_t>(2), off = get_arg_val<uint32_t>(3);
    const uint32_t dst = get_arg_val<uint32_t>(4), bytes = get_arg_val<uint32_t>(5);
    noc_async_read(get_noc_addr_from_bank_id<true>(bank, w_addr + off), dst, bytes);
    noc_async_read_barrier();
}