Skip to content

Commit

Permalink
for test
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhang93 committed Sep 23, 2024
1 parent 326b930 commit a3989a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ static LogicalResult transferDmaAddressing(MLIRContext *ctx,

// Change the source/target addressing of all users from a connection op.
for (Operation *user : connectionOp->getUsers()) {
llvm::outs() << "User " << *user << "\n";
if (auto dmaOp = dyn_cast<AMDAIE::NpuDmaCpyNdOp>(user)) {
SmallVector<OpFoldResult> srcOffsets = dmaOp.getSourceMixedOffsets();
SmallVector<OpFoldResult> srcSizes = dmaOp.getSourceMixedSizes();
Expand Down Expand Up @@ -307,6 +308,10 @@ static LogicalResult transferDmaAddressing(MLIRContext *ctx,
tgtStrides, dmaOp.getTargetBdId(), dmaOp.getSource(), srcOffsets,
srcSizes, srcStrides, dmaOp.getSourceBdId());
}
else{
llvm::outs() << "else " << *user << "\n";
continue;
}
}

// Replace the npu.circular_dma_cpy_nd with the new access pattern.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: iree-opt --pass-pipeline="builtin.module(func.func(iree-amdaie-transfer-strided-access-pattern))" --split-input-file %s --verify-diagnostics | FileCheck %s
// RUN: iree-opt --pass-pipeline="builtin.module(func.func(iree-amdaie-transfer-strided-access-pattern))" --split-input-file %s | FileCheck %s

// CHECK-LABEL: @single_dma_l3_source
// CHECK: %[[APPLY:.+]] = affine.apply
Expand Down Expand Up @@ -58,6 +58,9 @@ module {
#map = affine_map<(d0) -> (d0 * 64)>
module {
func.func @multiple_dma_l3_source(%arg0: !amdaie.logicalobjectfifo<memref<2048xi32, 1 : i32>, 2>, %arg1: !amdaie.logicalobjectfifo<memref<256x128xi32>>) {
%c1 = arith.constant 1 : index
%c0 = arith.constant 0 : index
%c2 = arith.constant 2 : index
amdaie.workgroup {
%0 = amdaie.connection(%arg0, %arg1) : (!amdaie.logicalobjectfifo<memref<2048xi32, 1 : i32>, 2>, !amdaie.logicalobjectfifo<memref<256x128xi32>>)
amdaie.controlcode {
Expand All @@ -66,8 +69,10 @@ module {
%2 = amdaie.npu.circular_dma_cpy_nd %0([0] [2048] [1], [] [] [])
%3 = amdaie.npu.dma_cpy_nd %0([] [] [], [0, 0, %1] [2, 32, 32] [32, 128, 1])
amdaie.npu.dma_wait(%3, MM2S)
%4 = amdaie.npu.dma_cpy_nd %0([] [] [], [0, 224, %1] [2, 32, 32] [32, 128, 1])
amdaie.npu.dma_wait(%4, MM2S)
scf.for %arg4 = %c0 to %c2 step %c1 {
%4 = amdaie.npu.dma_cpy_nd %0([] [] [], [0, 224, %1] [2, 32, 32] [32, 128, 1])
amdaie.npu.dma_wait(%4, MM2S)
}
}
amdaie.end
}
Expand Down

0 comments on commit a3989a1

Please sign in to comment.