mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 05:06:45 +00:00
[mlir][opeancc] Update acc.update verifier for dataOperands
Data operands associated with acc.update should comes from acc data entry/exit operations or acc.getdeviceptr. Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D149990
This commit is contained in:
parent
127b00b25c
commit
78a09cbd3e
@ -16,7 +16,6 @@ subroutine acc_update
|
||||
! CHECK: acc.update dataOperands(%[[DEVPTR_A]] : !fir.ref<!fir.array<10x10xf32>>){{$}}
|
||||
! CHECK: acc.update_host accPtr(%[[DEVPTR_A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) to varPtr(%[[A]] : !fir.ref<!fir.array<10x10xf32>>) {name = "a", structured = false}
|
||||
|
||||
|
||||
!$acc update host(a) if(.true.)
|
||||
! CHECK: %[[DEVPTR_A:.*]] = acc.getdeviceptr varPtr(%[[A]] : !fir.ref<!fir.array<10x10xf32>>) bounds(%{{.*}}, %{{.*}}) -> !fir.ref<!fir.array<10x10xf32>> {dataClause = 17 : i64, name = "a", structured = false}
|
||||
! CHECK: %[[IF1:.*]] = arith.constant true
|
||||
|
@ -655,6 +655,12 @@ LogicalResult acc::UpdateOp::verify() {
|
||||
if (getWaitDevnum() && getWaitOperands().empty())
|
||||
return emitError("wait_devnum cannot appear without waitOperands");
|
||||
|
||||
for (mlir::Value operand : getDataClauseOperands())
|
||||
if (!mlir::isa<acc::UpdateDeviceOp, acc::UpdateHostOp, acc::GetDevicePtrOp>(
|
||||
operand.getDefiningOp()))
|
||||
return emitError("expect data entry/exit operation or acc.getdeviceptr "
|
||||
"as defining op");
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
|
@ -219,3 +219,8 @@ acc.enter_data dataOperands(%value : memref<10xf32>)
|
||||
// expected-error@+1 {{operand #0 must be integer or index, but got 'f32'}}
|
||||
%1 = acc.bounds lowerbound(%0 : f32)
|
||||
|
||||
// -----
|
||||
|
||||
%value = memref.alloc() : memref<10xf32>
|
||||
// expected-error@+1 {{expect data entry/exit operation or acc.getdeviceptr as defining op}}
|
||||
acc.update dataOperands(%value : memref<10xf32>)
|
||||
|
Loading…
x
Reference in New Issue
Block a user