Skip to content

Commit

Permalink
Fixup an issue in the input ir where the data movement mount in src a…
Browse files Browse the repository at this point in the history
…nd dst of dma_memcpy_nd mismatches
  • Loading branch information
erwei-xilinx committed Aug 9, 2024
1 parent 3847c33 commit 59864e8
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,21 @@ def segment_body(arg2, arg3):
def herd_body(_tx, _ty, _sx, _sy, c, d):

# Process each subvector individually
for _i in range_(num_subvectors):
for _i in range_(
0, num_subvectors * lineWidthInBytes, lineWidthInBytes
):
# We must allocate a buffer of image size for the input/output
tensor_in = AllocOp(tensor_type, [], [])
tensor_out = AllocOp(tensor_type, [], [])

# Place the input image (a) into the L1 memory region
dma_memcpy_nd(tensor_in, c)
dma_memcpy_nd(
tensor_in,
c,
src_offsets=[_i],
src_sizes=[1024],
src_strides=[1],
)

for j in range_(lineWidthInBytes):
# Load the input value
Expand All @@ -68,7 +76,13 @@ def herd_body(_tx, _ty, _sx, _sy, c, d):
store(val, tensor_out, [j])
yield_([])

dma_memcpy_nd(d, tensor_out)
dma_memcpy_nd(
d,
tensor_out,
dst_offsets=[_i],
dst_sizes=[1024],
dst_strides=[1],
)

# Deallocate our L1 buffers
DeallocOp(tensor_in)
Expand Down

0 comments on commit 59864e8

Please sign in to comment.