summaryrefslogtreecommitdiffstats
path: root/mlir/examples/Linalg/Linalg3/Execution.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/examples/Linalg/Linalg3/Execution.cpp')
-rw-r--r--mlir/examples/Linalg/Linalg3/Execution.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/mlir/examples/Linalg/Linalg3/Execution.cpp b/mlir/examples/Linalg/Linalg3/Execution.cpp
index 00d571cbc99..94b233a56b0 100644
--- a/mlir/examples/Linalg/Linalg3/Execution.cpp
+++ b/mlir/examples/Linalg/Linalg3/Execution.cpp
@@ -37,26 +37,26 @@ using namespace linalg;
using namespace linalg::common;
using namespace linalg::intrinsics;
-Function *makeFunctionWithAMatmulOp(Module &module, StringRef name) {
+Function makeFunctionWithAMatmulOp(Module &module, StringRef name) {
MLIRContext *context = module.getContext();
auto dynamic2DMemRefType = floatMemRefType<2>(context);
- mlir::Function *f = linalg::common::makeFunction(
+ mlir::Function f = linalg::common::makeFunction(
module, name,
{dynamic2DMemRefType, dynamic2DMemRefType, dynamic2DMemRefType}, {});
- mlir::OpBuilder builder(f->getBody());
- ScopedContext scope(builder, f->getLoc());
+ mlir::OpBuilder builder(f.getBody());
+ ScopedContext scope(builder, f.getLoc());
// clang-format off
ValueHandle
- M = dim(f->getArgument(0), 0),
- N = dim(f->getArgument(2), 1),
- K = dim(f->getArgument(0), 1),
+ M = dim(f.getArgument(0), 0),
+ N = dim(f.getArgument(2), 1),
+ K = dim(f.getArgument(0), 1),
rM = range(constant_index(0), M, constant_index(1)),
rN = range(constant_index(0), N, constant_index(1)),
rK = range(constant_index(0), K, constant_index(1)),
- vA = view(f->getArgument(0), {rM, rK}),
- vB = view(f->getArgument(1), {rK, rN}),
- vC = view(f->getArgument(2), {rM, rN});
+ vA = view(f.getArgument(0), {rM, rK}),
+ vB = view(f.getArgument(1), {rK, rN}),
+ vC = view(f.getArgument(2), {rM, rN});
matmul(vA, vB, vC);
ret();
// clang-format on
@@ -110,7 +110,7 @@ TEST_FUNC(execution) {
// dialect through partial conversions.
MLIRContext context;
Module module(&context);
- mlir::Function *f = makeFunctionWithAMatmulOp(module, "matmul_as_loops");
+ mlir::Function f = makeFunctionWithAMatmulOp(module, "matmul_as_loops");
lowerToLoops(f);
convertLinalg3ToLLVM(module);
OpenPOWER on IntegriCloud