Download code/tt_sam3/tt/kernels/coord_probe.cpp from changh95/sam3-p150: direct link, hf CLI and curl.
- Browser
- Download file 957 Bytes
-
https://huggingface.co/changh95/sam3-p150/resolve/main/code/tt_sam3/tt/kernels/coord_probe.cpp
- Command line
-
hf download hf://changh95/sam3-p150/code/tt_sam3/tt/kernels/coord_probe.cpp
-
curl -L -o coord_probe.cpp https://huggingface.co/changh95/sam3-p150/resolve/main/code/tt_sam3/tt/kernels/coord_probe.cpp
957 Bytes
| // SPDX-License-Identifier: Apache-2.0 | |
| // Writes this core's NoC coordinates (noc0 x, y, noc1 x, y) as one 32-byte row-major page (page = core index): | |
| // a host-side check of the logical -> NoC coordinate mapping used by the generic_op matmul (tt/mm_fused.py). | |
| constexpr uint32_t cb = get_compile_time_arg_val(0); | |
| constexpr auto t_args = TensorAccessorArgs<1>(); | |
| void kernel_main() { | |
| const uint32_t addr = get_arg_val<uint32_t>(0); | |
| const uint32_t page = get_arg_val<uint32_t>(1); | |
| const auto acc = TensorAccessor(t_args, addr, 32); | |
| cb_reserve_back(cb, 1); | |
| volatile tt_l1_ptr uint32_t* p = reinterpret_cast<volatile tt_l1_ptr uint32_t*>(get_write_ptr(cb)); | |
| p[0] = my_x[0]; p[1] = my_y[0]; p[2] = my_x[1]; p[3] = my_y[1]; | |
| p[4] = page; p[5] = 0xC0DE; p[6] = 0; p[7] = 0; | |
| noc_async_write(get_write_ptr(cb), acc.get_noc_addr(page), 32); | |
| noc_async_write_barrier(); | |
| } | |