Skip to content

Commit

Permalink
add verification to acquire op
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Dec 20, 2023
1 parent 4485703 commit 7bd6f27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/Dialect/AIE/IR/AIEDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,16 @@ LogicalResult ObjectFifoAcquireOp::verify() {
"on non-consumer tile");
}

auto objFifoElem =
getObjectFifo().getElemType().cast<AIEObjectFifoType>().getElementType();
auto objFifoSubviewElem =
getResult().getType().cast<AIEObjectFifoSubviewType>().getElementType();
if (objFifoElem != objFifoSubviewElem)
return emitOpError(
"ObjectFifo element and ObjectFifoSubview elements must match.\n");

return success();

return success();
}

Expand Down
2 changes: 1 addition & 1 deletion test/python/ipu.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ def core_body():
ObjectFifoPort.Consume, "in1", 1, T.memref(8, T.i32())
).acquired_elem()
elem_out = acquire(
ObjectFifoPort.Produce, "out1", 1, T.memref(8, T.i32())
ObjectFifoPort.Produce, "out1", 1, T.memref(16, T.i32())
).acquired_elem()
for i in range_(8):
v0 = memref.load(elem_in, [i])
Expand Down

0 comments on commit 7bd6f27

Please sign in to comment.