/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Enum Utility Declarations *| |* *| |* Automatically generated file, do not edit! *| |* From: StructuredOpsUtils.td *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir::utils { // Iterator type enum class IteratorType : uint32_t { parallel = 0, reduction = 1, }; ::std::optional symbolizeIteratorType(uint32_t); ::llvm::StringRef stringifyIteratorType(IteratorType); ::std::optional symbolizeIteratorType(::llvm::StringRef); inline constexpr unsigned getMaxEnumValForIteratorType() { return 1; } inline ::llvm::StringRef stringifyEnum(IteratorType enumValue) { return stringifyIteratorType(enumValue); } template ::std::optional symbolizeEnum(::llvm::StringRef); template <> inline ::std::optional symbolizeEnum(::llvm::StringRef str) { return symbolizeIteratorType(str); } } // namespace mlir::utils namespace mlir { template struct FieldParser; template<> struct FieldParser<::mlir::utils::IteratorType, ::mlir::utils::IteratorType> { template static FailureOr<::mlir::utils::IteratorType> 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 Iterator type"); // Symbolize the keyword. if (::std::optional<::mlir::utils::IteratorType> attr = ::mlir::utils::symbolizeEnum<::mlir::utils::IteratorType>(enumKeyword)) return *attr; return parser.emitError(loc, "expected one of [parallel, reduction] for Iterator 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::utils::IteratorType>> { 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, {"parallel", "reduction"}))) return std::optional<::mlir::utils::IteratorType>{}; // Symbolize the keyword. if (::std::optional<::mlir::utils::IteratorType> attr = ::mlir::utils::symbolizeEnum<::mlir::utils::IteratorType>(enumKeyword)) return attr; return parser.emitError(loc, "expected one of [parallel, reduction] for Iterator type, got: ") << enumKeyword; } }; } // namespace mlir namespace llvm { inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::utils::IteratorType value) { auto valueStr = stringifyEnum(value); return p << valueStr; } } // namespace llvm namespace llvm { template<> struct DenseMapInfo<::mlir::utils::IteratorType> { using StorageInfo = ::llvm::DenseMapInfo; static unsigned getHashValue(const ::mlir::utils::IteratorType &val) { return StorageInfo::getHashValue(static_cast(val)); } static bool isEqual(const ::mlir::utils::IteratorType &lhs, const ::mlir::utils::IteratorType &rhs) { return lhs == rhs; } }; }