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 + mlir/unittests/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 6b44156..f37f578 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 bb95402..583dbd4 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; -- 2.7.4