[Mlir-commits] [mlir] [mlir][tosa][tosa-to-linalg] Add NaN Mode Lowering (PR #125668)
Georgios Pinitas
llvmlistbot at llvm.org
Wed Feb 19 04:01:14 PST 2025
================
@@ -267,6 +267,26 @@ extractConvZpPair(TosaConvOp op, PatternRewriter &rewriter) {
return std::make_optional<ConvZpPair>(*maybeInputZp, *maybeWeightZp);
}
+
+// Helper function to extract the NaN propagation mode from an operation.
+// Note that the for operations which support NaN mode propagation the attribute
+// is optional and its default value is "PROPAGATE".
+//
+// If the function is called with an operator that doesn't support the NaN mode
+// attribute it will return a std::nullopt.
+inline std::optional<std::string> getNanMode(Operation *op,
----------------
GeorgeARM wrote:
Can't we do it in a more generic way than having to put ops explicitly in here?
https://github.com/llvm/llvm-project/pull/125668
More information about the Mlir-commits
mailing list