Files
TheRock/compiler/amd-llvm/mlir/lib/Target/IRDLToCpp/Templates/PerOperationDecl.txt
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

206 lines
7.0 KiB
Plaintext

R"(
//===----------------------------------------------------------------------===//
// __NAMESPACE_PATH__::__OP_CPP_NAME__ declarations
//===----------------------------------------------------------------------===//
__NAMESPACE_OPEN__
namespace detail {
class __OP_CPP_NAME__GenericAdaptorBase {
public:
struct Properties {
};
public:
__OP_CPP_NAME__GenericAdaptorBase(::mlir::Operation *op)
: odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()),
odsRegions(op->getRegions())
{}
/// Return the unstructured operand index of a structured operand along with
// the amount of unstructured operands it contains.
std::pair<unsigned, unsigned>
getStructuredOperandIndexAndLength (unsigned index,
unsigned odsOperandsSize) {
return {index, 1};
}
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
__OP_REGION_ADAPTER_GETTER_DECLS__
::mlir::RegionRange getRegions() {
return odsRegions;
}
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
};
} // namespace detail
template <typename RangeT>
class __OP_CPP_NAME__GenericAdaptor
: public detail::__OP_CPP_NAME__GenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::__OP_CPP_NAME__GenericAdaptorBase;
public:
__OP_CPP_NAME__GenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs,
::mlir::PropertyRef properties,
::mlir::RegionRange regions = {})
: __OP_CPP_NAME__GenericAdaptor(values, attrs,
(properties ? *properties.as<::mlir::EmptyProperties *>()
: ::mlir::EmptyProperties{}), regions) {}
__OP_CPP_NAME__GenericAdaptor(RangeT values,
const __OP_CPP_NAME__GenericAdaptorBase &base)
: Base(base), odsOperands(values) {}
// This template parameter allows using __OP_CPP_NAME__ which is declared
// later.
template <typename LateInst = __OP_CPP_NAME__,
typename = std::enable_if_t<
std::is_same_v<LateInst, __OP_CPP_NAME__>>>
__OP_CPP_NAME__GenericAdaptor(RangeT values, LateInst op)
: Base(op), odsOperands(values) {}
/// Return the unstructured operand index of a structured operand along with
// the amount of unstructured operands it contains.
std::pair<unsigned, unsigned>
getStructuredOperandIndexAndLength(unsigned index) {
return Base::getStructuredOperandIndexAndLength(index, odsOperands.size());
}
/// Get the n-th structured operand (single value, variadic or optional).
RangeT getStructuredOperands(unsigned index) {
auto valueRange = getStructuredOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(),
valueRange.first + valueRange.second)};
}
RangeT getOperands() {
return odsOperands;
}
__OP_OPERAND_GETTER_DECLS__
private:
RangeT odsOperands;
};
class __OP_CPP_NAME__Adaptor
: public __OP_CPP_NAME__GenericAdaptor<::mlir::ValueRange> {
public:
using __OP_CPP_NAME__GenericAdaptor::__OP_CPP_NAME__GenericAdaptor;
__OP_CPP_NAME__Adaptor(__OP_CPP_NAME__ op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class __OP_CPP_NAME__ : public ::mlir::Op<__OP_TEMPLATE_ARGS__> {
public:
using Op::Op;
using Op::print;
using Adaptor = __OP_CPP_NAME__Adaptor;
template <typename RangeT>
using GenericAdaptor = __OP_CPP_NAME__GenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
return {};
}
::llvm::LogicalResult verifyInvariantsImpl();
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("__DIALECT_NAME__.__OP_NAME__");
}
static ::llvm::ArrayRef<::llvm::StringRef> getOperandNames() {
static ::llvm::StringRef operandNames[] = __OP_OPERAND_INITIALIZER_LIST__;
return operandNames;
}
static ::llvm::StringRef getOperandName(unsigned index) {
assert(index < __OP_OPERAND_COUNT__ && "invalid attribute index");
return getOperandNames()[index];
}
static ::llvm::ArrayRef<::llvm::StringRef> getResultNames() {
static ::llvm::StringRef resultNames[] = __OP_RESULT_INITIALIZER_LIST__;
return resultNames;
}
static ::llvm::StringRef getResultName(unsigned index) {
assert(index < __OP_RESULT_COUNT__ && "invalid attribute index");
return getResultNames()[index];
}
/// Return the unstructured operand index of a structured operand along with
// the amount of unstructured operands it contains.
std::pair<unsigned, unsigned>
getStructuredOperandIndexAndLength(unsigned index) {
return {index, 1};
}
/// Get the n-th structured operand (single value, variadic or optional).
::mlir::Operation::operand_range getStructuredOperands(unsigned index) {
auto valueRange = getStructuredOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(),
valueRange.first + valueRange.second)};
}
/// Return the unstructured result index of a structured result along with
// the amount of unstructured results it contains.
std::pair<unsigned, unsigned>
getStructuredResultIndexAndLength(unsigned index) {
return {index, 1};
}
/// Get the n-th structured result (single value, variadic or optional).
::mlir::Operation::result_range getStructuredResults(unsigned index) {
auto valueRange = getStructuredResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(),
valueRange.first + valueRange.second)};
}
__OP_OPERAND_GETTER_DECLS__
__OP_RESULT_GETTER_DECLS__
__OP_REGION_GETTER_DECLS__
__OP_BUILD_DECLS__
static void build(::mlir::OpBuilder &odsBuilder,
::mlir::OperationState &odsState,
::mlir::TypeRange resultTypes,
::mlir::ValueRange operands,
::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
static __OP_CPP_NAME__ create(::mlir::OpBuilder &odsBuilder,
::mlir::Location location,
::mlir::TypeRange resultTypes,
::mlir::ValueRange operands,
::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
static __OP_CPP_NAME__ create(::mlir::ImplicitLocOpBuilder &odsBuilder,
::mlir::TypeRange resultTypes,
::mlir::ValueRange operands,
::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
};
__NAMESPACE_CLOSE__
MLIR_DECLARE_EXPLICIT_TYPE_ID(__NAMESPACE_PATH__::__OP_CPP_NAME__)
)"