[Mlir-commits] [mlir] [mlir][tosa] Convert TOSA enumerations from `StringBasedAttr` to `Tosa_I32EnumAttr` (PR #152856)

Luke Hutton llvmlistbot at llvm.org
Fri Aug 15 02:00:59 PDT 2025


================
@@ -381,6 +381,34 @@ class Extension<list<I32EnumAttrCase> extensions> : Availability {
   let instance = "ref";
 }
 
+//===----------------------------------------------------------------------===//
+// Iterable attributes.
+//===----------------------------------------------------------------------===//
+// Defined in `section 3. Enumerations` of the TOSA specification.
+
+def Tosa_RESIZE_NEAREST_NEIGHBOR          : I32EnumAttrCase<"NEAREST_NEIGHBOR", 1>;
+def Tosa_RESIZE_BILINEAR                  : I32EnumAttrCase<"BILINEAR", 2>;
+
+def Tosa_ResizeTypeAttr
+    : Tosa_I32EnumAttr<"ResizeType", "Supported resize/upsampling strategies", "resize_type",
----------------
lhutton1 wrote:

Would it be possible to align these names to the ones in the specification, e.g. `ResizeType` becomes `ResizeMode`, `resize_type` becomes `resize_mode`? I appreciate these names aren't new and they were used previously, but it seems a good time to align them. The names are listed here: https://mltech.ml.arm.com/spec/tosa/nightly-stable/tosa_spec.html#_resize_mode_t

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


More information about the Mlir-commits mailing list