[Mlir-commits] [mlir] 2b882f8 - [mlir][linalg] Explicitly instantiate DownscaleSizeOneWindowed2DConvolution
Benjamin Kramer
llvmlistbot at llvm.org
Mon Sep 12 09:49:30 PDT 2022
Author: Benjamin Kramer
Date: 2022-09-12T18:49:19+02:00
New Revision: 2b882f844e41f02ad0569062d1f1e02d91ad6ba2
URL: https://github.com/llvm/llvm-project/commit/2b882f844e41f02ad0569062d1f1e02d91ad6ba2
DIFF: https://github.com/llvm/llvm-project/commit/2b882f844e41f02ad0569062d1f1e02d91ad6ba2.diff
LOG: [mlir][linalg] Explicitly instantiate DownscaleSizeOneWindowed2DConvolution
It's not possible to use a template with no definition from another
translation unit. Fixes the shared library build.
Added:
Modified:
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
index e6a1b07b21088..958681557702d 100644
--- a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
@@ -776,6 +776,11 @@ struct DownscaleSizeOneWindowed2DConvolution final
LinalgTransformationFilter filter;
};
+extern template struct DownscaleSizeOneWindowed2DConvolution<Conv2DNhwcHwcfOp,
+ Conv1DNwcWcfOp>;
+extern template struct DownscaleSizeOneWindowed2DConvolution<Conv2DNchwFchwOp,
+ Conv1DNcwFcwOp>;
+
/// Rewrites 2-D depthwise convolution ops with size-1 (w, kw) or (h, kh)
/// dimensions into 1-D depthwise convolution ops.
struct DownscaleDepthwiseConv2DNhwcHwcOp final
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
index 1c4ceaaae034f..31136dda7a918 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
@@ -920,6 +920,11 @@ FailureOr<Conv1DOp> DownscaleSizeOneWindowed2DConvolution<Conv2DOp, Conv1DOp>::
return conv1DOp;
}
+template struct linalg::DownscaleSizeOneWindowed2DConvolution<Conv2DNhwcHwcfOp,
+ Conv1DNwcWcfOp>;
+template struct linalg::DownscaleSizeOneWindowed2DConvolution<Conv2DNchwFchwOp,
+ Conv1DNcwFcwOp>;
+
FailureOr<DepthwiseConv1DNwcWcOp>
DownscaleDepthwiseConv2DNhwcHwcOp::returningMatchAndRewrite(
DepthwiseConv2DNhwcHwcOp convOp, PatternRewriter &rewriter) const {
More information about the Mlir-commits
mailing list