From 2afd16fe725ffa98723abda6dc19ee6d70f60a4d Mon Sep 17 00:00:00 2001 From: Chia-hung Duan Date: Sat, 27 Nov 2021 22:36:42 +0000 Subject: [PATCH] [mlir] Enable MLIRDialectUtilsTests Also remove `TooFewDims` test which tried to create an invalid AffineMap. The creation of an invalid AffineMap is rejected by `willBeValidAffineMap`, as a result we can deprecate the test. Reviewed By: bondhugula Differential Revision: https://reviews.llvm.org/D114657 --- mlir/unittests/Dialect/CMakeLists.txt | 1 + .../Dialect/Utils/StructuredOpsUtilsTest.cpp | 13 ------------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/mlir/unittests/Dialect/CMakeLists.txt b/mlir/unittests/Dialect/CMakeLists.txt index 6b441567b548..f37f578572b8 100644 --- a/mlir/unittests/Dialect/CMakeLists.txt +++ b/mlir/unittests/Dialect/CMakeLists.txt @@ -9,3 +9,4 @@ target_link_libraries(MLIRDialectTests add_subdirectory(Quant) add_subdirectory(SparseTensor) add_subdirectory(SPIRV) +add_subdirectory(Utils) diff --git a/mlir/unittests/Dialect/Utils/StructuredOpsUtilsTest.cpp b/mlir/unittests/Dialect/Utils/StructuredOpsUtilsTest.cpp index bb95402b1ea5..583dbd463b91 100644 --- a/mlir/unittests/Dialect/Utils/StructuredOpsUtilsTest.cpp +++ b/mlir/unittests/Dialect/Utils/StructuredOpsUtilsTest.cpp @@ -110,19 +110,6 @@ TEST(isRowMajorMatmul, TooManyMaps) { EXPECT_THAT(maps, Not(Truly(isRowMajorMatmul))); } -TEST(isRowMajorMatmul, TooFewDims) { - MLIRContext context; - - AffineExpr m, n, k; - bindDims(&context, m, n, k); - auto mapA = AffineMapAttr::get(AffineMap::get(3, 0, {m, k}, &context)); - auto mapB = AffineMapAttr::get(AffineMap::get(2, 0, {k, n}, &context)); - auto mapC = AffineMapAttr::get(AffineMap::get(3, 0, {m, n}, &context)); - auto maps = ArrayAttr::get(&context, {mapA, mapB, mapC}); - - EXPECT_THAT(maps, Not(Truly(isRowMajorMatmul))); -} - TEST(isRowMajorMatmul, TooFewOutputs) { MLIRContext context;