[Mlir-commits] [mlir] [mlir][arith] Add neutral element support to arith.maxnumf/arith.minnumf (PR #93278)
donald chen
llvmlistbot at llvm.org
Mon May 27 22:08:04 PDT 2024
================
@@ -407,3 +407,49 @@ module attributes {transform.with_named_sequence} {
transform.yield
}
}
+
+// -----
+
+// Checks we use nan as the neutral element for maxnumf op.
+func.func @generic_split_maxnumf(%in: tensor<32xf32>, %out: tensor<f32>) -> tensor<f32> {
+ %r = linalg.generic {indexing_maps = [affine_map<(d0) -> (d0)>,
+ affine_map<(d0) -> ()>],
+ iterator_types = ["reduction"]}
+ ins(%in : tensor<32xf32>)
+ outs(%out : tensor<f32>) {
+ ^bb0(%arg1: f32, %arg2: f32):
+ %y = arith.maxnumf %arg1, %arg2 : f32
----------------
cxy-1993 wrote:
Sorry, I missed this comment. I have added the tests as your suggestion. @kuhar
https://github.com/llvm/llvm-project/pull/93278
More information about the Mlir-commits
mailing list