/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Enum Utility Declarations *| |* *| |* Automatically generated file, do not edit! *| |* From: XeVMOps.td *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir::xevm { // Address spaces enum class AddrSpace : uint32_t { PRIVATE = 0, GLOBAL = 1, CONSTANT = 2, SHARED = 3, GENERIC = 4, }; ::std::optional symbolizeAddrSpace(uint32_t); ::llvm::StringRef stringifyAddrSpace(AddrSpace); ::std::optional symbolizeAddrSpace(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForAddrSpace() { return 4; } inline ::llvm::StringRef stringifyEnum(AddrSpace enumValue) { return stringifyAddrSpace(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeAddrSpace(str); } } // namespace mlir::xevm namespace mlir { template struct FieldParser; template<> struct FieldParser { template static FailureOr parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for Address spaces"); // Symbolize the keyword. if (::std::optional attr = mlir::xevm::symbolizeEnum(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [private, global, constant, shared, generic] for Address spaces, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"private", "global", "constant", "shared", "generic"}))) return std::optional{}; // Symbolize the keyword. if (::std::optional attr = mlir::xevm::symbolizeEnum(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [private, global, constant, shared, generic] for Address spaces, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, mlir::xevm::AddrSpace value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const mlir::xevm::AddrSpace &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const mlir::xevm::AddrSpace &lhs, const mlir::xevm::AddrSpace &rhs) { return lhs == rhs; } }; } namespace mlir::xevm { // XeVM element type enum class ElemType : uint32_t { BF16 = 8, F16 = 9, S8 = 10, U8 = 11, S4 = 12, U4 = 13, TF32 = 14, F32 = 15, S32 = 16, E2M1 = 17, BF8 = 18, F8 = 19, }; ::std::optional symbolizeElemType(uint32_t); ::llvm::StringRef stringifyElemType(ElemType); ::std::optional symbolizeElemType(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForElemType() { return 19; } inline ::llvm::StringRef stringifyEnum(ElemType enumValue) { return stringifyElemType(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeElemType(str); } class ElemTypeAttr : public ::mlir::IntegerAttr { public: using ValueType = ElemType; using ::mlir::IntegerAttr::IntegerAttr; static bool classof(::mlir::Attribute attr); static ElemTypeAttr get(::mlir::MLIRContext *context, ElemType val); ElemType getValue() const; }; } // namespace mlir::xevm namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::xevm::ElemType, ::mlir::xevm::ElemType> { template static FailureOr<::mlir::xevm::ElemType> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for XeVM element type"); // Symbolize the keyword. if (::std::optional<::mlir::xevm::ElemType> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ElemType>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [bf16, f16, s8, u8, s4, u4, tf32, f32, s32, e2m1, bf8, f8] for XeVM element type, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::xevm::ElemType>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"bf16", "f16", "s8", "u8", "s4", "u4", "tf32", "f32", "s32", "e2m1", "bf8", "f8"}))) return std::optional<::mlir::xevm::ElemType>{}; // Symbolize the keyword. if (::std::optional<::mlir::xevm::ElemType> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ElemType>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [bf16, f16, s8, u8, s4, u4, tf32, f32, s32, e2m1, bf8, f8] for XeVM element type, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::ElemType value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::xevm::ElemType> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::xevm::ElemType &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::xevm::ElemType &lhs, const ::mlir::xevm::ElemType &rhs) { return lhs == rhs; } }; } namespace mlir::xevm { // Destination element type for xevm.extf enum class ExtfDstElemTypes : uint32_t { F16 = 9, BF16 = 8, }; ::std::optional symbolizeExtfDstElemTypes(uint32_t); ::llvm::StringRef stringifyExtfDstElemTypes(ExtfDstElemTypes); ::std::optional symbolizeExtfDstElemTypes(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForExtfDstElemTypes() { return 9; } inline ::llvm::StringRef stringifyEnum(ExtfDstElemTypes enumValue) { return stringifyExtfDstElemTypes(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeExtfDstElemTypes(str); } class ExtfDstElemTypesAttr : public ::mlir::IntegerAttr { public: using ValueType = ExtfDstElemTypes; using ::mlir::IntegerAttr::IntegerAttr; static bool classof(::mlir::Attribute attr); static ExtfDstElemTypesAttr get(::mlir::MLIRContext *context, ExtfDstElemTypes val); ExtfDstElemTypes getValue() const; }; } // namespace mlir::xevm namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::xevm::ExtfDstElemTypes, ::mlir::xevm::ExtfDstElemTypes> { template static FailureOr<::mlir::xevm::ExtfDstElemTypes> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for Destination element type for xevm.extf"); // Symbolize the keyword. if (::std::optional<::mlir::xevm::ExtfDstElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ExtfDstElemTypes>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [f16, bf16] for Destination element type for xevm.extf, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::xevm::ExtfDstElemTypes>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"f16", "bf16"}))) return std::optional<::mlir::xevm::ExtfDstElemTypes>{}; // Symbolize the keyword. if (::std::optional<::mlir::xevm::ExtfDstElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ExtfDstElemTypes>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [f16, bf16] for Destination element type for xevm.extf, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::ExtfDstElemTypes value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::xevm::ExtfDstElemTypes> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::xevm::ExtfDstElemTypes &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::xevm::ExtfDstElemTypes &lhs, const ::mlir::xevm::ExtfDstElemTypes &rhs) { return lhs == rhs; } }; } namespace mlir::xevm { // Source element type for xevm.extf enum class ExtfSrcElemTypes : uint32_t { BF8 = 18, F8 = 19, E2M1 = 17, }; ::std::optional symbolizeExtfSrcElemTypes(uint32_t); ::llvm::StringRef stringifyExtfSrcElemTypes(ExtfSrcElemTypes); ::std::optional symbolizeExtfSrcElemTypes(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForExtfSrcElemTypes() { return 19; } inline ::llvm::StringRef stringifyEnum(ExtfSrcElemTypes enumValue) { return stringifyExtfSrcElemTypes(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeExtfSrcElemTypes(str); } class ExtfSrcElemTypesAttr : public ::mlir::IntegerAttr { public: using ValueType = ExtfSrcElemTypes; using ::mlir::IntegerAttr::IntegerAttr; static bool classof(::mlir::Attribute attr); static ExtfSrcElemTypesAttr get(::mlir::MLIRContext *context, ExtfSrcElemTypes val); ExtfSrcElemTypes getValue() const; }; } // namespace mlir::xevm namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::xevm::ExtfSrcElemTypes, ::mlir::xevm::ExtfSrcElemTypes> { template static FailureOr<::mlir::xevm::ExtfSrcElemTypes> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for Source element type for xevm.extf"); // Symbolize the keyword. if (::std::optional<::mlir::xevm::ExtfSrcElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ExtfSrcElemTypes>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [bf8, f8, e2m1] for Source element type for xevm.extf, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::xevm::ExtfSrcElemTypes>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"bf8", "f8", "e2m1"}))) return std::optional<::mlir::xevm::ExtfSrcElemTypes>{}; // Symbolize the keyword. if (::std::optional<::mlir::xevm::ExtfSrcElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::ExtfSrcElemTypes>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [bf8, f8, e2m1] for Source element type for xevm.extf, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::ExtfSrcElemTypes value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::xevm::ExtfSrcElemTypes> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::xevm::ExtfSrcElemTypes &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::xevm::ExtfSrcElemTypes &lhs, const ::mlir::xevm::ExtfSrcElemTypes &rhs) { return lhs == rhs; } }; } namespace mlir::xevm { // XeVM load ops cache control enum class LoadCacheControl : uint32_t { USE_DEFAULT = 0, L1UC_L2UC_L3UC = 1, L1UC_L2UC_L3C = 2, L1UC_L2C_L3UC = 3, L1UC_L2C_L3C = 4, L1C_L2UC_L3UC = 5, L1C_L2UC_L3C = 6, L1C_L2C_L3UC = 7, L1C_L2C_L3C = 8, L1S_L2UC_L3UC = 9, L1S_L2UC_L3C = 10, L1S_L2C_L3UC = 11, L1S_L2C_L3C = 12, INVALIDATE_READ = 13, }; ::std::optional symbolizeLoadCacheControl(uint32_t); ::llvm::StringRef stringifyLoadCacheControl(LoadCacheControl); ::std::optional symbolizeLoadCacheControl(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForLoadCacheControl() { return 13; } inline ::llvm::StringRef stringifyEnum(LoadCacheControl enumValue) { return stringifyLoadCacheControl(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeLoadCacheControl(str); } } // namespace mlir::xevm namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::xevm::LoadCacheControl, ::mlir::xevm::LoadCacheControl> { template static FailureOr<::mlir::xevm::LoadCacheControl> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for XeVM load ops cache control"); // Symbolize the keyword. if (::std::optional<::mlir::xevm::LoadCacheControl> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::LoadCacheControl>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [Use_Default, L1uc_L2uc_L3uc, L1uc_L2uc_L3c, L1uc_L2c_L3uc, L1uc_L2c_L3c, L1c_L2uc_L3uc, L1c_L2uc_L3c, L1c_L2c_L3uc, L1c_L2c_L3c, L1s_L2uc_L3uc, L1s_L2uc_L3c, L1s_L2c_L3uc, L1s_L2c_L3c, ir] for XeVM load ops cache control, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::xevm::LoadCacheControl>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"Use_Default", "L1uc_L2uc_L3uc", "L1uc_L2uc_L3c", "L1uc_L2c_L3uc", "L1uc_L2c_L3c", "L1c_L2uc_L3uc", "L1c_L2uc_L3c", "L1c_L2c_L3uc", "L1c_L2c_L3c", "L1s_L2uc_L3uc", "L1s_L2uc_L3c", "L1s_L2c_L3uc", "L1s_L2c_L3c", "ir"}))) return std::optional<::mlir::xevm::LoadCacheControl>{}; // Symbolize the keyword. if (::std::optional<::mlir::xevm::LoadCacheControl> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::LoadCacheControl>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [Use_Default, L1uc_L2uc_L3uc, L1uc_L2uc_L3c, L1uc_L2c_L3uc, L1uc_L2c_L3c, L1c_L2uc_L3uc, L1c_L2uc_L3c, L1c_L2c_L3uc, L1c_L2c_L3c, L1s_L2uc_L3uc, L1s_L2uc_L3c, L1s_L2c_L3uc, L1s_L2c_L3c, ir] for XeVM load ops cache control, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::LoadCacheControl value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::xevm::LoadCacheControl> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::xevm::LoadCacheControl &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::xevm::LoadCacheControl &lhs, const ::mlir::xevm::LoadCacheControl &rhs) { return lhs == rhs; } }; } namespace mlir::xevm { // XeVM memory scope enum class MemScope : uint32_t { LANE = 0, SUBGROUP = 1, WORKGROUP = 2, CLUSTER = 3, DEVICE = 4, SYSTEM = 5, }; ::std::optional symbolizeMemScope(uint32_t); ::llvm::StringRef stringifyMemScope(MemScope); ::std::optional symbolizeMemScope(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForMemScope() { return 5; } inline ::llvm::StringRef stringifyEnum(MemScope enumValue) { return stringifyMemScope(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeMemScope(str); } } // namespace mlir::xevm namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::xevm::MemScope, ::mlir::xevm::MemScope> { template static FailureOr<::mlir::xevm::MemScope> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for XeVM memory scope"); // Symbolize the keyword. if (::std::optional<::mlir::xevm::MemScope> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::MemScope>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [lane, subgroup, workgroup, cluster, device, system] for XeVM memory scope, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::xevm::MemScope>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"lane", "subgroup", "workgroup", "cluster", "device", "system"}))) return std::optional<::mlir::xevm::MemScope>{}; // Symbolize the keyword. if (::std::optional<::mlir::xevm::MemScope> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::MemScope>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [lane, subgroup, workgroup, cluster, device, system] for XeVM memory scope, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::MemScope value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::xevm::MemScope> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::xevm::MemScope &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::xevm::MemScope &lhs, const ::mlir::xevm::MemScope &rhs) { return lhs == rhs; } }; } namespace mlir::xevm { // XeVM store ops cache control enum class StoreCacheControl : uint32_t { USE_DEFAULT = 0, L1UC_L2UC_L3UC = 1, L1UC_L2UC_L3WB = 2, L1UC_L2WB_L3UC = 3, L1UC_L2WB_L3WB = 4, L1WT_L2UC_L3UC = 5, L1WT_L2UC_L3WB = 6, L1WT_L2WB_L3UC = 7, L1WT_L2WB_L3WB = 8, L1S_L2UC_L3UC = 9, L1S_L2UC_L3WB = 10, L1S_L2WB_L3UC = 11, L1S_L2WB_L3WB = 12, L1WB_L2UC_L3UC = 13, L1WB_L2WB_L3UC = 14, L1WB_L2UC_L3WB = 15, }; ::std::optional symbolizeStoreCacheControl(uint32_t); ::llvm::StringRef stringifyStoreCacheControl(StoreCacheControl); ::std::optional symbolizeStoreCacheControl(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForStoreCacheControl() { return 15; } inline ::llvm::StringRef stringifyEnum(StoreCacheControl enumValue) { return stringifyStoreCacheControl(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeStoreCacheControl(str); } } // namespace mlir::xevm namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::xevm::StoreCacheControl, ::mlir::xevm::StoreCacheControl> { template static FailureOr<::mlir::xevm::StoreCacheControl> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for XeVM store ops cache control"); // Symbolize the keyword. if (::std::optional<::mlir::xevm::StoreCacheControl> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::StoreCacheControl>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [Use_Default, L1uc_L2uc_L3uc, L1uc_L2uc_L3wb, L1uc_L2wb_L3uc, L1uc_L2wb_L3wb, L1wt_L2uc_L3uc, L1wt_L2uc_L3wb, L1wt_L2wb_L3uc, L1wt_L2wb_L3wb, L1s_L2uc_L3uc, L1s_L2uc_L3wb, L1s_L2wb_L3uc, L1s_L2wb_L3wb, L1wb_L2uc_L3uc, L1wb_L2wb_L3uc, L1wb_L2uc_L3wb] for XeVM store ops cache control, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::xevm::StoreCacheControl>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"Use_Default", "L1uc_L2uc_L3uc", "L1uc_L2uc_L3wb", "L1uc_L2wb_L3uc", "L1uc_L2wb_L3wb", "L1wt_L2uc_L3uc", "L1wt_L2uc_L3wb", "L1wt_L2wb_L3uc", "L1wt_L2wb_L3wb", "L1s_L2uc_L3uc", "L1s_L2uc_L3wb", "L1s_L2wb_L3uc", "L1s_L2wb_L3wb", "L1wb_L2uc_L3uc", "L1wb_L2wb_L3uc", "L1wb_L2uc_L3wb"}))) return std::optional<::mlir::xevm::StoreCacheControl>{}; // Symbolize the keyword. if (::std::optional<::mlir::xevm::StoreCacheControl> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::StoreCacheControl>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [Use_Default, L1uc_L2uc_L3uc, L1uc_L2uc_L3wb, L1uc_L2wb_L3uc, L1uc_L2wb_L3wb, L1wt_L2uc_L3uc, L1wt_L2uc_L3wb, L1wt_L2wb_L3uc, L1wt_L2wb_L3wb, L1s_L2uc_L3uc, L1s_L2uc_L3wb, L1s_L2wb_L3uc, L1s_L2wb_L3wb, L1wb_L2uc_L3uc, L1wb_L2wb_L3uc, L1wb_L2uc_L3wb] for XeVM store ops cache control, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::StoreCacheControl value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::xevm::StoreCacheControl> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::xevm::StoreCacheControl &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::xevm::StoreCacheControl &lhs, const ::mlir::xevm::StoreCacheControl &rhs) { return lhs == rhs; } }; } namespace mlir::xevm { // Destination element type for xevm.truncf enum class TruncfDstElemTypes : uint32_t { BF8 = 18, F8 = 19, E2M1 = 17, }; ::std::optional symbolizeTruncfDstElemTypes(uint32_t); ::llvm::StringRef stringifyTruncfDstElemTypes(TruncfDstElemTypes); ::std::optional symbolizeTruncfDstElemTypes(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForTruncfDstElemTypes() { return 19; } inline ::llvm::StringRef stringifyEnum(TruncfDstElemTypes enumValue) { return stringifyTruncfDstElemTypes(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeTruncfDstElemTypes(str); } class TruncfDstElemTypesAttr : public ::mlir::IntegerAttr { public: using ValueType = TruncfDstElemTypes; using ::mlir::IntegerAttr::IntegerAttr; static bool classof(::mlir::Attribute attr); static TruncfDstElemTypesAttr get(::mlir::MLIRContext *context, TruncfDstElemTypes val); TruncfDstElemTypes getValue() const; }; } // namespace mlir::xevm namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::xevm::TruncfDstElemTypes, ::mlir::xevm::TruncfDstElemTypes> { template static FailureOr<::mlir::xevm::TruncfDstElemTypes> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for Destination element type for xevm.truncf"); // Symbolize the keyword. if (::std::optional<::mlir::xevm::TruncfDstElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::TruncfDstElemTypes>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [bf8, f8, e2m1] for Destination element type for xevm.truncf, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::xevm::TruncfDstElemTypes>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"bf8", "f8", "e2m1"}))) return std::optional<::mlir::xevm::TruncfDstElemTypes>{}; // Symbolize the keyword. if (::std::optional<::mlir::xevm::TruncfDstElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::TruncfDstElemTypes>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [bf8, f8, e2m1] for Destination element type for xevm.truncf, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::TruncfDstElemTypes value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::xevm::TruncfDstElemTypes> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::xevm::TruncfDstElemTypes &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::xevm::TruncfDstElemTypes &lhs, const ::mlir::xevm::TruncfDstElemTypes &rhs) { return lhs == rhs; } }; } namespace mlir::xevm { // Source element type for xevm.truncf enum class TruncfSrcElemTypes : uint32_t { F16 = 9, BF16 = 8, }; ::std::optional symbolizeTruncfSrcElemTypes(uint32_t); ::llvm::StringRef stringifyTruncfSrcElemTypes(TruncfSrcElemTypes); ::std::optional symbolizeTruncfSrcElemTypes(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForTruncfSrcElemTypes() { return 9; } inline ::llvm::StringRef stringifyEnum(TruncfSrcElemTypes enumValue) { return stringifyTruncfSrcElemTypes(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeTruncfSrcElemTypes(str); } class TruncfSrcElemTypesAttr : public ::mlir::IntegerAttr { public: using ValueType = TruncfSrcElemTypes; using ::mlir::IntegerAttr::IntegerAttr; static bool classof(::mlir::Attribute attr); static TruncfSrcElemTypesAttr get(::mlir::MLIRContext *context, TruncfSrcElemTypes val); TruncfSrcElemTypes getValue() const; }; } // namespace mlir::xevm namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::xevm::TruncfSrcElemTypes, ::mlir::xevm::TruncfSrcElemTypes> { template static FailureOr<::mlir::xevm::TruncfSrcElemTypes> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword))) return parser.emitError(loc, "expected keyword for Source element type for xevm.truncf"); // Symbolize the keyword. if (::std::optional<::mlir::xevm::TruncfSrcElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::TruncfSrcElemTypes>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [f16, bf16] for Source element type for xevm.truncf, got: ") << enumKeyword; } }; /// Support for std::optional, useful in attribute/type definition where the enum is /// used as: /// /// let parameters = (ins OptionalParameter<"std::optional">:$value); template<> struct FieldParser, std::optional<::mlir::xevm::TruncfSrcElemTypes>> { template static FailureOr> parse(ParserT &parser) { // Parse the keyword/string containing the enum. std::string enumKeyword; auto loc = parser.getCurrentLocation(); if (failed(parser.parseOptionalKeywordOrString(&enumKeyword, {"f16", "bf16"}))) return std::optional<::mlir::xevm::TruncfSrcElemTypes>{}; // Symbolize the keyword. if (::std::optional<::mlir::xevm::TruncfSrcElemTypes> attr = ::mlir::xevm::symbolizeEnum<::mlir::xevm::TruncfSrcElemTypes>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [f16, bf16] for Source element type for xevm.truncf, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::xevm::TruncfSrcElemTypes value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::xevm::TruncfSrcElemTypes> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::xevm::TruncfSrcElemTypes &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::xevm::TruncfSrcElemTypes &lhs, const ::mlir::xevm::TruncfSrcElemTypes &rhs) { return lhs == rhs; } }; }