Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaumanTT committed Dec 17, 2024
1 parent dc96a4f commit 02a91ff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tt_metal/impl/dispatch/kernels/cq_dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,9 @@ void process_write_packed(
uint32_t writes = 0;
uint32_t mcasts = 0;
auto wait_for_barrier = [&]() {
if (!mcast) {
return;
}
noc_nonposted_writes_num_issued[noc_index] += writes;
noc_nonposted_writes_acked[noc_index] += mcasts;
writes = 0;
Expand Down Expand Up @@ -757,7 +760,6 @@ void process_write_packed_large(
wait_for_barrier();
cq_noc_async_write_with_state_any_len(data_ptr, dst_addr, xfer_size, num_dests);
must_barrier = false;
writes += div_up(xfer_size, NOC_MAX_BURST_SIZE);
} else {
xfer_size = length;
if (unlink) {
Expand All @@ -769,16 +771,15 @@ void process_write_packed_large(
uint32_t data_offset = xfer_size - rem_xfer_size;
cq_noc_async_write_with_state<CQ_NOC_SnDL, CQ_NOC_wait>(
data_ptr + data_offset, dst_addr + data_offset, rem_xfer_size, num_dests);
writes += div_up(xfer_size, NOC_MAX_BURST_SIZE);
must_barrier = true;
// Later writes must barrier.
} else {
wait_for_barrier();
cq_noc_async_write_with_state_any_len(data_ptr, dst_addr, xfer_size, num_dests);
must_barrier = false;
writes++;
}
}
writes += div_up(xfer_size, NOC_MAX_BURST_SIZE);
length -= xfer_size;
data_ptr += xfer_size;
dst_addr += xfer_size;
Expand Down

0 comments on commit 02a91ff

Please sign in to comment.