[Mlir-commits] [mlir] [mlir][linalg] Extend elementwise (PR #124661)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Feb 3 12:00:17 PST 2025


================
@@ -0,0 +1,157 @@
+// RUN: mlir-opt %s -linalg-generalize-named-ops -split-input-file | FileCheck %s
+// CHECK: #[[MAP:.+]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)>
+//
+// CHECK: @unary_exp(%[[A:.+]]: tensor<8x16x32xf32>, %[[B:.+]]: tensor<8x16x32xf32>)
+// CHECK: linalg.generic
+// CHECK-SAME: indexing_maps = [#[[MAP]], #[[MAP]]]
+// CHECK-SAME: iterator_types = ["parallel", "parallel", "parallel"]
+// CHECK-SAME:  ins(%[[A]]
+// CHECK-SAME: outs(%[[B]]
+//
+// CHECK: ^{{.*}}(%[[A_ARG:.+]]: f32, %[[B_ARG:.+]]: f32)
+// CHECK:   %[[EXP:.+]] = math.exp %[[A_ARG]] : f32
+// CHECK:   linalg.yield %[[EXP]] : f32
+//
+func.func @unary_exp(%A : tensor<8x16x32xf32>, %B: tensor<8x16x32xf32>) ->  tensor<8x16x32xf32> {
----------------
banach-space wrote:

There's no clear naming scheme for tests in this file. Here's a suggestion:
* `@arity_kind{_transpose|broadcast_for_op_1}?{_transpose|broadcast_for_op_2}?`

Below I make a suggestion re testing on memrefs.

https://github.com/llvm/llvm-project/pull/124661


More information about the Mlir-commits mailing list