// SPDX-FileCopyrightText: © 2026 Tenstorrent Inc. // SPDX-License-Identifier: Apache-2.0 // Unary eltwise writer: cb 16 -> destination pages [start, start+n), one tile at a time. // compile-time: TensorAccessorArgs(dst). runtime: dst_addr, start, n #include #include "api/dataflow/dataflow_api.h" void kernel_main() { const uint32_t dst_addr = get_arg_val(0); const uint32_t start = get_arg_val(1); const uint32_t n = get_arg_val(2); constexpr auto dst_args = TensorAccessorArgs<0>(); constexpr uint32_t cb = 16; const uint32_t page = get_local_cb_interface(cb).fifo_page_size; const auto dst = TensorAccessor(dst_args, dst_addr, page); for (uint32_t i = 0; i < n; ++i) { cb_wait_front(cb, 1); noc_async_write(get_read_ptr(cb), dst.get_noc_addr(start + i), page); noc_async_writes_flushed(); cb_pop_front(cb, 1); } noc_async_write_barrier(); }