You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use Tosa_I32EnumAttr instead of StringBasedAttr to represent Tosa enumerations.
This PR replaces `StringBasedAttr` with `Tosa_I32EnumAttr` to represent Tosa enumerations as per the specification.
The intent is to make the IR and C++ APIs more type-safe and prevent fragile string comparisons in passes.
Enumerations rewritten are:
- `Tosa_ResizeTypeAttr`
- `Tosa_NanPropagationAttr`
- `Tosa_RoundingTypeAttr`
BREAKING CHANGE:
This commit changes attribute assembly and the C++ API surface for the listed attributes.
Code that previously used `StringAttr` for these fields must now be updated to use the new enum representation.
In `.mlir` files, replace string literals with the enum assembly (e.g. `mode = #tosa.resize_type<BILINEAR>`).
In C++, update call sites to either pass the generated enum (e.g. `::mlir::tosa::RoundingType::SINGLE_ROUND`) into builder overloads or construct the typed attribute with `tosa::RoundingTypeAttr::get(context, /*enum*/)` and pass that.
Change-Id: Ic101ddfc3bef73a08ab2d6f59f54598c8e0dbad8
0 commit comments