Skip to content

Commit 90946f3

Browse files
lhutton1smallp-o-p
authored and
smallp-o-p
committed
[TOSA] Remove i64 from valid element datatypes in validation (llvm#113380)
Align the validation pass valid element datatypes check more closely to the specification by removing i64 as a supported datatype. The spec does not currently support it. Signed-off-by: Luke Hutton <[email protected]>
1 parent eac7d9d commit 90946f3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,6 @@ bool TosaValidation::isValidElementType(Type type) {
543543
case 16:
544544
case 32:
545545
case 48:
546-
case 64:
547546
return true;
548547
default:
549548
return false;

mlir/test/Dialect/Tosa/invalid.mlir

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,3 +618,13 @@ func.func @test_mul_invalid_shift(%arg0: tensor<13x21x3xf32>, %arg1: tensor<13x1
618618
%0 = tosa.mul %arg0, %arg1 {shift = 1 : i8} : (tensor<13x21x3xf32>, tensor<13x1x3xf32>) -> tensor<13x21x3xf32>
619619
return %0 : tensor<13x21x3xf32>
620620
}
621+
622+
// -----
623+
624+
// CHECK-LABEL: test_unsupported_int64_data_type
625+
func.func @test_unsupported_int64_data_type(%arg0: tensor<1x13x13x5xf32>) -> tensor<1x13x13xi64> {
626+
// expected-error@+1 {{'tosa.argmax' op is not profile-aligned: element type 'i64' is not legal}}
627+
%0 = tosa.argmax %arg0 {axis = 3 : i32} : (tensor<1x13x13x5xf32>) -> tensor<1x13x13xi64>
628+
// expected-error@+1 {{'func.return' op is not profile-aligned: element type 'i64' is not legal}}
629+
return %0 : tensor<1x13x13xi64>
630+
}

0 commit comments

Comments
 (0)