/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|*                                                                            *|
|* AttrDef Definitions                                                        *|
|*                                                                            *|
|* Automatically generated file, do not edit!                                 *|
|*                                                                            *|
\*===----------------------------------------------------------------------===*/

#ifdef GET_ATTRDEF_LIST
#undef GET_ATTRDEF_LIST

::fir::FortranVariableFlagsAttr,
::fir::CUDADataAttributeAttr,
::fir::CUDAProcAttributeAttr,
::fir::CUDALaunchBoundsAttr,
::fir::CUDAClusterDimsAttr

#endif  // GET_ATTRDEF_LIST

#ifdef GET_ATTRDEF_CLASSES
#undef GET_ATTRDEF_CLASSES

static ::mlir::OptionalParseResult generatedAttributeParser(::mlir::AsmParser &parser, ::llvm::StringRef *mnemonic, ::mlir::Type type, ::mlir::Attribute &value) {
  return ::mlir::AsmParser::KeywordSwitch<::mlir::OptionalParseResult>(parser)
    .Case(::fir::FortranVariableFlagsAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
      value = ::fir::FortranVariableFlagsAttr::parse(parser, type);
      return ::mlir::success(!!value);
    })
    .Case(::fir::CUDADataAttributeAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
      value = ::fir::CUDADataAttributeAttr::parse(parser, type);
      return ::mlir::success(!!value);
    })
    .Case(::fir::CUDAProcAttributeAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
      value = ::fir::CUDAProcAttributeAttr::parse(parser, type);
      return ::mlir::success(!!value);
    })
    .Case(::fir::CUDALaunchBoundsAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
      value = ::fir::CUDALaunchBoundsAttr::parse(parser, type);
      return ::mlir::success(!!value);
    })
    .Case(::fir::CUDAClusterDimsAttr::getMnemonic(), [&](llvm::StringRef, llvm::SMLoc) {
      value = ::fir::CUDAClusterDimsAttr::parse(parser, type);
      return ::mlir::success(!!value);
    })
    .Default([&](llvm::StringRef keyword, llvm::SMLoc) {
      *mnemonic = keyword;
      return std::nullopt;
    });
}

static ::mlir::LogicalResult generatedAttributePrinter(::mlir::Attribute def, ::mlir::AsmPrinter &printer) {
  return ::llvm::TypeSwitch<::mlir::Attribute, ::mlir::LogicalResult>(def)    .Case<::fir::FortranVariableFlagsAttr>([&](auto t) {
      printer << ::fir::FortranVariableFlagsAttr::getMnemonic();
t.print(printer);
      return ::mlir::success();
    })
    .Case<::fir::CUDADataAttributeAttr>([&](auto t) {
      printer << ::fir::CUDADataAttributeAttr::getMnemonic();
t.print(printer);
      return ::mlir::success();
    })
    .Case<::fir::CUDAProcAttributeAttr>([&](auto t) {
      printer << ::fir::CUDAProcAttributeAttr::getMnemonic();
t.print(printer);
      return ::mlir::success();
    })
    .Case<::fir::CUDALaunchBoundsAttr>([&](auto t) {
      printer << ::fir::CUDALaunchBoundsAttr::getMnemonic();
t.print(printer);
      return ::mlir::success();
    })
    .Case<::fir::CUDAClusterDimsAttr>([&](auto t) {
      printer << ::fir::CUDAClusterDimsAttr::getMnemonic();
t.print(printer);
      return ::mlir::success();
    })
    .Default([](auto) { return ::mlir::failure(); });
}

namespace fir {
namespace detail {
struct FortranVariableFlagsAttrStorage : public ::mlir::AttributeStorage {
  using KeyTy = std::tuple<FortranVariableFlagsEnum>;
  FortranVariableFlagsAttrStorage(FortranVariableFlagsEnum flags) : flags(std::move(flags)) {}

  KeyTy getAsKey() const {
    return KeyTy(flags);
  }

  bool operator==(const KeyTy &tblgenKey) const {
    return (flags == std::get<0>(tblgenKey));
  }

  static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
    return ::llvm::hash_combine(std::get<0>(tblgenKey));
  }

  static FortranVariableFlagsAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, KeyTy &&tblgenKey) {
    auto flags = std::move(std::get<0>(tblgenKey));
    return new (allocator.allocate<FortranVariableFlagsAttrStorage>()) FortranVariableFlagsAttrStorage(std::move(flags));
  }

  FortranVariableFlagsEnum flags;
};
} // namespace detail
FortranVariableFlagsAttr FortranVariableFlagsAttr::get(::mlir::MLIRContext *context, FortranVariableFlagsEnum flags) {
  return Base::get(context, std::move(flags));
}

FortranVariableFlagsEnum FortranVariableFlagsAttr::getFlags() const {
  return getImpl()->flags;
}

} // namespace fir
MLIR_DEFINE_EXPLICIT_TYPE_ID(::fir::FortranVariableFlagsAttr)
namespace fir {
namespace detail {
struct CUDADataAttributeAttrStorage : public ::mlir::AttributeStorage {
  using KeyTy = std::tuple<::fir::CUDADataAttribute>;
  CUDADataAttributeAttrStorage(::fir::CUDADataAttribute value) : value(std::move(value)) {}

  KeyTy getAsKey() const {
    return KeyTy(value);
  }

  bool operator==(const KeyTy &tblgenKey) const {
    return (value == std::get<0>(tblgenKey));
  }

  static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
    return ::llvm::hash_combine(std::get<0>(tblgenKey));
  }

  static CUDADataAttributeAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, KeyTy &&tblgenKey) {
    auto value = std::move(std::get<0>(tblgenKey));
    return new (allocator.allocate<CUDADataAttributeAttrStorage>()) CUDADataAttributeAttrStorage(std::move(value));
  }

  ::fir::CUDADataAttribute value;
};
} // namespace detail
CUDADataAttributeAttr CUDADataAttributeAttr::get(::mlir::MLIRContext *context, ::fir::CUDADataAttribute value) {
  return Base::get(context, std::move(value));
}

::mlir::Attribute CUDADataAttributeAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
  ::mlir::Builder odsBuilder(odsParser.getContext());
  ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
  (void) odsLoc;
  ::mlir::FailureOr<::fir::CUDADataAttribute> _result_value;
  // Parse literal '<'
  if (odsParser.parseLess()) return {};

  // Parse variable 'value'
  _result_value = [&]() -> ::mlir::FailureOr<::fir::CUDADataAttribute> {
      auto loc = odsParser.getCurrentLocation();
      ::llvm::StringRef enumKeyword;
      if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
        return ::mlir::failure();
      auto maybeEnum = ::fir::symbolizeCUDADataAttribute(enumKeyword);
      if (maybeEnum)
        return *maybeEnum;
      return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::fir::CUDADataAttribute" << " to be one of: " << "constant" << ", " << "device" << ", " << "managed" << ", " << "pinned" << ", " << "shared" << ", " << "unified")};
    }();
  if (::mlir::failed(_result_value)) {
    odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse fir_CUDADataAttributeAttr parameter 'value' which is to be a `::fir::CUDADataAttribute`");
    return {};
  }
  // Parse literal '>'
  if (odsParser.parseGreater()) return {};
  assert(::mlir::succeeded(_result_value));
  return CUDADataAttributeAttr::get(odsParser.getContext(),
      ::fir::CUDADataAttribute((*_result_value)));
}

void CUDADataAttributeAttr::print(::mlir::AsmPrinter &odsPrinter) const {
  ::mlir::Builder odsBuilder(getContext());
  odsPrinter << "<";
  odsPrinter << stringifyCUDADataAttribute(getValue());
  odsPrinter << ">";
}

::fir::CUDADataAttribute CUDADataAttributeAttr::getValue() const {
  return getImpl()->value;
}

} // namespace fir
MLIR_DEFINE_EXPLICIT_TYPE_ID(::fir::CUDADataAttributeAttr)
namespace fir {
namespace detail {
struct CUDAProcAttributeAttrStorage : public ::mlir::AttributeStorage {
  using KeyTy = std::tuple<::fir::CUDAProcAttribute>;
  CUDAProcAttributeAttrStorage(::fir::CUDAProcAttribute value) : value(std::move(value)) {}

  KeyTy getAsKey() const {
    return KeyTy(value);
  }

  bool operator==(const KeyTy &tblgenKey) const {
    return (value == std::get<0>(tblgenKey));
  }

  static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
    return ::llvm::hash_combine(std::get<0>(tblgenKey));
  }

  static CUDAProcAttributeAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, KeyTy &&tblgenKey) {
    auto value = std::move(std::get<0>(tblgenKey));
    return new (allocator.allocate<CUDAProcAttributeAttrStorage>()) CUDAProcAttributeAttrStorage(std::move(value));
  }

  ::fir::CUDAProcAttribute value;
};
} // namespace detail
CUDAProcAttributeAttr CUDAProcAttributeAttr::get(::mlir::MLIRContext *context, ::fir::CUDAProcAttribute value) {
  return Base::get(context, std::move(value));
}

::mlir::Attribute CUDAProcAttributeAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
  ::mlir::Builder odsBuilder(odsParser.getContext());
  ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
  (void) odsLoc;
  ::mlir::FailureOr<::fir::CUDAProcAttribute> _result_value;
  // Parse literal '<'
  if (odsParser.parseLess()) return {};

  // Parse variable 'value'
  _result_value = [&]() -> ::mlir::FailureOr<::fir::CUDAProcAttribute> {
      auto loc = odsParser.getCurrentLocation();
      ::llvm::StringRef enumKeyword;
      if (::mlir::failed(odsParser.parseKeyword(&enumKeyword)))
        return ::mlir::failure();
      auto maybeEnum = ::fir::symbolizeCUDAProcAttribute(enumKeyword);
      if (maybeEnum)
        return *maybeEnum;
      return {(::mlir::LogicalResult)(odsParser.emitError(loc) << "expected " << "::fir::CUDAProcAttribute" << " to be one of: " << "host" << ", " << "device" << ", " << "host_device" << ", " << "global" << ", " << "grid_global")};
    }();
  if (::mlir::failed(_result_value)) {
    odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse fir_CUDAProcAttributeAttr parameter 'value' which is to be a `::fir::CUDAProcAttribute`");
    return {};
  }
  // Parse literal '>'
  if (odsParser.parseGreater()) return {};
  assert(::mlir::succeeded(_result_value));
  return CUDAProcAttributeAttr::get(odsParser.getContext(),
      ::fir::CUDAProcAttribute((*_result_value)));
}

void CUDAProcAttributeAttr::print(::mlir::AsmPrinter &odsPrinter) const {
  ::mlir::Builder odsBuilder(getContext());
  odsPrinter << "<";
  odsPrinter << stringifyCUDAProcAttribute(getValue());
  odsPrinter << ">";
}

::fir::CUDAProcAttribute CUDAProcAttributeAttr::getValue() const {
  return getImpl()->value;
}

} // namespace fir
MLIR_DEFINE_EXPLICIT_TYPE_ID(::fir::CUDAProcAttributeAttr)
namespace fir {
namespace detail {
struct CUDALaunchBoundsAttrStorage : public ::mlir::AttributeStorage {
  using KeyTy = std::tuple<mlir::IntegerAttr, mlir::IntegerAttr, mlir::IntegerAttr>;
  CUDALaunchBoundsAttrStorage(mlir::IntegerAttr maxTPB, mlir::IntegerAttr minBPM, mlir::IntegerAttr upperBoundClusterSize) : maxTPB(std::move(maxTPB)), minBPM(std::move(minBPM)), upperBoundClusterSize(std::move(upperBoundClusterSize)) {}

  KeyTy getAsKey() const {
    return KeyTy(maxTPB, minBPM, upperBoundClusterSize);
  }

  bool operator==(const KeyTy &tblgenKey) const {
    return (maxTPB == std::get<0>(tblgenKey)) && (minBPM == std::get<1>(tblgenKey)) && (upperBoundClusterSize == std::get<2>(tblgenKey));
  }

  static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
    return ::llvm::hash_combine(std::get<0>(tblgenKey), std::get<1>(tblgenKey), std::get<2>(tblgenKey));
  }

  static CUDALaunchBoundsAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, KeyTy &&tblgenKey) {
    auto maxTPB = std::move(std::get<0>(tblgenKey));
    auto minBPM = std::move(std::get<1>(tblgenKey));
    auto upperBoundClusterSize = std::move(std::get<2>(tblgenKey));
    return new (allocator.allocate<CUDALaunchBoundsAttrStorage>()) CUDALaunchBoundsAttrStorage(std::move(maxTPB), std::move(minBPM), std::move(upperBoundClusterSize));
  }

  mlir::IntegerAttr maxTPB;
  mlir::IntegerAttr minBPM;
  mlir::IntegerAttr upperBoundClusterSize;
};
} // namespace detail
CUDALaunchBoundsAttr CUDALaunchBoundsAttr::get(::mlir::MLIRContext *context, mlir::IntegerAttr maxTPB, mlir::IntegerAttr minBPM, mlir::IntegerAttr upperBoundClusterSize) {
  return Base::get(context, std::move(maxTPB), std::move(minBPM), std::move(upperBoundClusterSize));
}

::mlir::Attribute CUDALaunchBoundsAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
  ::mlir::Builder odsBuilder(odsParser.getContext());
  ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
  (void) odsLoc;
  ::mlir::FailureOr<mlir::IntegerAttr> _result_maxTPB;
  ::mlir::FailureOr<mlir::IntegerAttr> _result_minBPM;
  ::mlir::FailureOr<mlir::IntegerAttr> _result_upperBoundClusterSize;
  // Parse literal '<'
  if (odsParser.parseLess()) return {};
  // Parse parameter struct
  bool _seen_maxTPB = false;
  bool _seen_minBPM = false;
  bool _seen_upperBoundClusterSize = false;
  {
    const auto _loop_body = [&](::llvm::StringRef _paramKey) -> bool {
      // Parse literal '='
      if (odsParser.parseEqual()) return {};
      if (!_seen_maxTPB && _paramKey == "maxTPB") {
        _seen_maxTPB = true;

        // Parse variable 'maxTPB'
        _result_maxTPB = ::mlir::FieldParser<mlir::IntegerAttr>::parse(odsParser);
        if (::mlir::failed(_result_maxTPB)) {
          odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse fir_CUDALaunchBoundsAttr parameter 'maxTPB' which is to be a `mlir::IntegerAttr`");
          return {};
        }
      } else if (!_seen_minBPM && _paramKey == "minBPM") {
        _seen_minBPM = true;

        // Parse variable 'minBPM'
        _result_minBPM = ::mlir::FieldParser<mlir::IntegerAttr>::parse(odsParser);
        if (::mlir::failed(_result_minBPM)) {
          odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse fir_CUDALaunchBoundsAttr parameter 'minBPM' which is to be a `mlir::IntegerAttr`");
          return {};
        }
      } else if (!_seen_upperBoundClusterSize && _paramKey == "upperBoundClusterSize") {
        _seen_upperBoundClusterSize = true;

        // Parse variable 'upperBoundClusterSize'
        _result_upperBoundClusterSize = ::mlir::FieldParser<mlir::IntegerAttr>::parse(odsParser);
        if (::mlir::failed(_result_upperBoundClusterSize)) {
          odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse fir_CUDALaunchBoundsAttr parameter 'upperBoundClusterSize' which is to be a `mlir::IntegerAttr`");
          return {};
        }
      } else {
        odsParser.emitError(odsParser.getCurrentLocation(), "duplicate or unknown struct parameter name: ") << _paramKey;
        return {};
      }
      return true;
    };
    do {
      ::llvm::StringRef _paramKey;
      if (odsParser.parseKeyword(&_paramKey)) {
        odsParser.emitError(odsParser.getCurrentLocation(),
                           "expected a parameter name in struct");
        return {};
      }
      if (!_loop_body(_paramKey)) return {};
    } while(!odsParser.parseOptionalComma());
    if (!_seen_maxTPB) {
      odsParser.emitError(odsParser.getCurrentLocation(), "struct is missing required parameter: ") << "maxTPB";
      return {};
    }
    if (!_seen_minBPM) {
      odsParser.emitError(odsParser.getCurrentLocation(), "struct is missing required parameter: ") << "minBPM";
      return {};
    }
  }
  // Parse literal '>'
  if (odsParser.parseGreater()) return {};
  assert(::mlir::succeeded(_result_maxTPB));
  assert(::mlir::succeeded(_result_minBPM));
  return CUDALaunchBoundsAttr::get(odsParser.getContext(),
      mlir::IntegerAttr((*_result_maxTPB)),
      mlir::IntegerAttr((*_result_minBPM)),
      mlir::IntegerAttr((_result_upperBoundClusterSize.value_or(mlir::IntegerAttr()))));
}

void CUDALaunchBoundsAttr::print(::mlir::AsmPrinter &odsPrinter) const {
  ::mlir::Builder odsBuilder(getContext());
  odsPrinter << "<";
  {
    bool _firstPrinted = true;
    if (!_firstPrinted) odsPrinter << ", ";
    _firstPrinted = false;
    odsPrinter << "maxTPB = ";
    odsPrinter.printStrippedAttrOrType(getMaxTPB());
    if (!_firstPrinted) odsPrinter << ", ";
    _firstPrinted = false;
    odsPrinter << "minBPM = ";
    odsPrinter.printStrippedAttrOrType(getMinBPM());
    if (!(getUpperBoundClusterSize() == mlir::IntegerAttr())) {
      if (!_firstPrinted) odsPrinter << ", ";
      _firstPrinted = false;
      odsPrinter << "upperBoundClusterSize = ";
      if (!(getUpperBoundClusterSize() == mlir::IntegerAttr())) {
        odsPrinter.printStrippedAttrOrType(getUpperBoundClusterSize());
      }
    }
  }
  odsPrinter << ">";
}

mlir::IntegerAttr CUDALaunchBoundsAttr::getMaxTPB() const {
  return getImpl()->maxTPB;
}

mlir::IntegerAttr CUDALaunchBoundsAttr::getMinBPM() const {
  return getImpl()->minBPM;
}

mlir::IntegerAttr CUDALaunchBoundsAttr::getUpperBoundClusterSize() const {
  return getImpl()->upperBoundClusterSize;
}

} // namespace fir
MLIR_DEFINE_EXPLICIT_TYPE_ID(::fir::CUDALaunchBoundsAttr)
namespace fir {
namespace detail {
struct CUDAClusterDimsAttrStorage : public ::mlir::AttributeStorage {
  using KeyTy = std::tuple<mlir::IntegerAttr, mlir::IntegerAttr, mlir::IntegerAttr>;
  CUDAClusterDimsAttrStorage(mlir::IntegerAttr x, mlir::IntegerAttr y, mlir::IntegerAttr z) : x(std::move(x)), y(std::move(y)), z(std::move(z)) {}

  KeyTy getAsKey() const {
    return KeyTy(x, y, z);
  }

  bool operator==(const KeyTy &tblgenKey) const {
    return (x == std::get<0>(tblgenKey)) && (y == std::get<1>(tblgenKey)) && (z == std::get<2>(tblgenKey));
  }

  static ::llvm::hash_code hashKey(const KeyTy &tblgenKey) {
    return ::llvm::hash_combine(std::get<0>(tblgenKey), std::get<1>(tblgenKey), std::get<2>(tblgenKey));
  }

  static CUDAClusterDimsAttrStorage *construct(::mlir::AttributeStorageAllocator &allocator, KeyTy &&tblgenKey) {
    auto x = std::move(std::get<0>(tblgenKey));
    auto y = std::move(std::get<1>(tblgenKey));
    auto z = std::move(std::get<2>(tblgenKey));
    return new (allocator.allocate<CUDAClusterDimsAttrStorage>()) CUDAClusterDimsAttrStorage(std::move(x), std::move(y), std::move(z));
  }

  mlir::IntegerAttr x;
  mlir::IntegerAttr y;
  mlir::IntegerAttr z;
};
} // namespace detail
CUDAClusterDimsAttr CUDAClusterDimsAttr::get(::mlir::MLIRContext *context, mlir::IntegerAttr x, mlir::IntegerAttr y, mlir::IntegerAttr z) {
  return Base::get(context, std::move(x), std::move(y), std::move(z));
}

::mlir::Attribute CUDAClusterDimsAttr::parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType) {
  ::mlir::Builder odsBuilder(odsParser.getContext());
  ::llvm::SMLoc odsLoc = odsParser.getCurrentLocation();
  (void) odsLoc;
  ::mlir::FailureOr<mlir::IntegerAttr> _result_x;
  ::mlir::FailureOr<mlir::IntegerAttr> _result_y;
  ::mlir::FailureOr<mlir::IntegerAttr> _result_z;
  // Parse literal '<'
  if (odsParser.parseLess()) return {};
  // Parse parameter struct
  bool _seen_x = false;
  bool _seen_y = false;
  bool _seen_z = false;
  {
    const auto _loop_body = [&](::llvm::StringRef _paramKey) -> bool {
      // Parse literal '='
      if (odsParser.parseEqual()) return {};
      if (!_seen_x && _paramKey == "x") {
        _seen_x = true;

        // Parse variable 'x'
        _result_x = ::mlir::FieldParser<mlir::IntegerAttr>::parse(odsParser);
        if (::mlir::failed(_result_x)) {
          odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse fir_CUDAClusterDimsAttr parameter 'x' which is to be a `mlir::IntegerAttr`");
          return {};
        }
      } else if (!_seen_y && _paramKey == "y") {
        _seen_y = true;

        // Parse variable 'y'
        _result_y = ::mlir::FieldParser<mlir::IntegerAttr>::parse(odsParser);
        if (::mlir::failed(_result_y)) {
          odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse fir_CUDAClusterDimsAttr parameter 'y' which is to be a `mlir::IntegerAttr`");
          return {};
        }
      } else if (!_seen_z && _paramKey == "z") {
        _seen_z = true;

        // Parse variable 'z'
        _result_z = ::mlir::FieldParser<mlir::IntegerAttr>::parse(odsParser);
        if (::mlir::failed(_result_z)) {
          odsParser.emitError(odsParser.getCurrentLocation(), "failed to parse fir_CUDAClusterDimsAttr parameter 'z' which is to be a `mlir::IntegerAttr`");
          return {};
        }
      } else {
        odsParser.emitError(odsParser.getCurrentLocation(), "duplicate or unknown struct parameter name: ") << _paramKey;
        return {};
      }
      return true;
    };
    for (unsigned odsStructIndex = 0; odsStructIndex < 3; ++odsStructIndex) {
      ::llvm::StringRef _paramKey;
      if (odsParser.parseKeyword(&_paramKey)) {
        odsParser.emitError(odsParser.getCurrentLocation(),
                           "expected a parameter name in struct");
        return {};
      }
      if (!_loop_body(_paramKey)) return {};
      if ((odsStructIndex != 3 - 1) && odsParser.parseComma())
        return {};
    }
  }
  // Parse literal '>'
  if (odsParser.parseGreater()) return {};
  assert(::mlir::succeeded(_result_x));
  assert(::mlir::succeeded(_result_y));
  assert(::mlir::succeeded(_result_z));
  return CUDAClusterDimsAttr::get(odsParser.getContext(),
      mlir::IntegerAttr((*_result_x)),
      mlir::IntegerAttr((*_result_y)),
      mlir::IntegerAttr((*_result_z)));
}

void CUDAClusterDimsAttr::print(::mlir::AsmPrinter &odsPrinter) const {
  ::mlir::Builder odsBuilder(getContext());
  odsPrinter << "<";
  {
    bool _firstPrinted = true;
    if (!_firstPrinted) odsPrinter << ", ";
    _firstPrinted = false;
    odsPrinter << "x = ";
    odsPrinter.printStrippedAttrOrType(getX());
    if (!_firstPrinted) odsPrinter << ", ";
    _firstPrinted = false;
    odsPrinter << "y = ";
    odsPrinter.printStrippedAttrOrType(getY());
    if (!_firstPrinted) odsPrinter << ", ";
    _firstPrinted = false;
    odsPrinter << "z = ";
    odsPrinter.printStrippedAttrOrType(getZ());
  }
  odsPrinter << ">";
}

mlir::IntegerAttr CUDAClusterDimsAttr::getX() const {
  return getImpl()->x;
}

mlir::IntegerAttr CUDAClusterDimsAttr::getY() const {
  return getImpl()->y;
}

mlir::IntegerAttr CUDAClusterDimsAttr::getZ() const {
  return getImpl()->z;
}

} // namespace fir
MLIR_DEFINE_EXPLICIT_TYPE_ID(::fir::CUDAClusterDimsAttr)

#endif  // GET_ATTRDEF_CLASSES

