[Mlir-commits] [mlir] [mlir][Tosa] fix fp16/bf16 support for Clamp min/max attributes (PR #69192)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Oct 19 10:02:45 PDT 2023


================
@@ -266,6 +266,32 @@ LogicalResult tosa::AvgPool2dOp::verify() {
   return emitOpError("input/output element types are incompatible.");
 }
 
+LogicalResult tosa::ClampOp::verify() {
+  mlir::Type inputDT =
+      llvm::cast<ShapedType>(getInput().getType()).getElementType();
+  mlir::Type maxFpDT = getMaxFpAttr().getType();
+  mlir::Type minFpDT = getMinFpAttr().getType();
+  mlir::Type outputDT =
+      llvm::cast<ShapedType>(getOutput().getType()).getElementType();
+  unsigned dataTypeBitWidth = inputDT.getIntOrFloatBitWidth();
+
+  if (!(inputDT.getTypeID() == outputDT.getTypeID()))
----------------
fabrizio-indirli wrote:

Fixed

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


More information about the Mlir-commits mailing list