Skip to content

Commit

Permalink
Cleanup DMA transpose (#1889)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgmelber authored Oct 30, 2024
1 parent c267c7b commit a2ed6f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions programming_examples/basic/dma_transpose/aie2.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def sequence(A, B, C):
metadata=of_in,
bd_id=1,
mem=A,
sizes=[1, K, M, 1],
strides=[1, 1, K, 1],
sizes=[1, 1, K, M],
strides=[1, 1, 1, K],
issue_token=True,
)
npu_dma_memcpy_nd(metadata=of_out, bd_id=0, mem=C, sizes=[1, 1, 1, N])
Expand Down
10 changes: 5 additions & 5 deletions programming_examples/basic/dma_transpose/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ int main(int argc, const char *argv[]) {
std::vector<uint32_t> refVecA(N);

// Doing a transpose on the source vector to produce a ref vector
for (uint32_t i = 0; i < M; i++) {
for (uint32_t j = 0; j < K; j++) {
uint32_t src_index = i * K + j;
uint32_t dst_index = j * M + i;
refVecA[dst_index] = srcVecA[src_index];
uint32_t dst_index = 0;
for (uint32_t i = 0; i < K; i++) {
for (uint32_t j = 0; j < M; j++) {
uint32_t src_index = j * K + i;
refVecA[dst_index++] = srcVecA[src_index];
}
}

Expand Down

0 comments on commit a2ed6f5

Please sign in to comment.