From 970841dde30558daac23ae8d3797d433b3512ea2 Mon Sep 17 00:00:00 2001 From: Pranathi Vasireddy Date: Tue, 12 Nov 2024 13:53:59 -0700 Subject: [PATCH] Change order --- lib/Dialect/AIE/IR/AIEDialect.cpp | 6 ++---- lib/Dialect/AIEX/Transforms/AIEDMATasksToNPU.cpp | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Dialect/AIE/IR/AIEDialect.cpp b/lib/Dialect/AIE/IR/AIEDialect.cpp index 97eecc8418..ad21783f35 100644 --- a/lib/Dialect/AIE/IR/AIEDialect.cpp +++ b/lib/Dialect/AIE/IR/AIEDialect.cpp @@ -1883,13 +1883,11 @@ LogicalResult DMABDOp::verify() { if (!dims.has_value()) return emitOpError() << "Padding requires n-d data layouts expressed as" << " wrap(s) and stride(s)."; - if(!paddims.has_value()) - return emitOpError() << "Padding requires n-d padding layouts."; + if (!targetModel.isMemTile(parentTileId.col, parentTileId.row)) + return emitOpError() << "Padding is only supported by memtile dma bds."; if (dims->size() != paddims->size()) return emitOpError() << "Mismatch number of dimensions between padding(s)" << " and wrap(s) and stride(s)."; - if (!targetModel.isMemTile(parentTileId.col, parentTileId.row)) - return emitOpError() << "Padding is only supported by memtile dma bds."; int actuallen = 1; for (unsigned i = 0; i < paddims->size(); i++) { auto dim = (*dims)[i]; diff --git a/lib/Dialect/AIEX/Transforms/AIEDMATasksToNPU.cpp b/lib/Dialect/AIEX/Transforms/AIEDMATasksToNPU.cpp index 47e084fc96..898d5dfb44 100644 --- a/lib/Dialect/AIEX/Transforms/AIEDMATasksToNPU.cpp +++ b/lib/Dialect/AIEX/Transforms/AIEDMATasksToNPU.cpp @@ -287,6 +287,10 @@ struct AIEDMATasksToNPUPass : AIEDMATasksToNPUBase { padBefore[i] = (*padDims)[j].getConstPadBefore(); padAfter[i] = (*padDims)[j].getConstPadAfter(); } + for (size_t i = padDims->size(); i < dims->size(); i++) { + padBefore[i] = 0; + padAfter[i] = 0; + } } else if (padDims) { return bd_op->emitOpError() << "supports padding only for MM2S direction on MemTiles.";