namespace mlir {
namespace linalg {
class AbsOp;
}
}
namespace mlir {
namespace linalg {
class AddOp;
}
}
namespace mlir {
namespace linalg {
class BatchMatmulOp;
}
}
namespace mlir {
namespace linalg {
class BatchMatmulTransposeAOp;
}
}
namespace mlir {
namespace linalg {
class BatchMatmulTransposeBOp;
}
}
namespace mlir {
namespace linalg {
class BatchMatvecOp;
}
}
namespace mlir {
namespace linalg {
class BatchMmt4DOp;
}
}
namespace mlir {
namespace linalg {
class BatchReduceMatmulOp;
}
}
namespace mlir {
namespace linalg {
class BatchVecmatOp;
}
}
namespace mlir {
namespace linalg {
class BroadcastOp;
}
}
namespace mlir {
namespace linalg {
class CeilOp;
}
}
namespace mlir {
namespace linalg {
class Conv1DNcwFcwOp;
}
}
namespace mlir {
namespace linalg {
class Conv1DNwcWcfOp;
}
}
namespace mlir {
namespace linalg {
class Conv1DOp;
}
}
namespace mlir {
namespace linalg {
class Conv2DNchwFchwOp;
}
}
namespace mlir {
namespace linalg {
class Conv2DNgchwFgchwOp;
}
}
namespace mlir {
namespace linalg {
class Conv2DNgchwGfchwOp;
}
}
namespace mlir {
namespace linalg {
class Conv2DNgchwGfchwQOp;
}
}
namespace mlir {
namespace linalg {
class Conv2DNhwcFhwcOp;
}
}
namespace mlir {
namespace linalg {
class Conv2DNhwcFhwcQOp;
}
}
namespace mlir {
namespace linalg {
class Conv2DNhwcHwcfOp;
}
}
namespace mlir {
namespace linalg {
class Conv2DNhwcHwcfQOp;
}
}
namespace mlir {
namespace linalg {
class Conv2DOp;
}
}
namespace mlir {
namespace linalg {
class Conv3DNcdhwFcdhwOp;
}
}
namespace mlir {
namespace linalg {
class Conv3DNdhwcDhwcfOp;
}
}
namespace mlir {
namespace linalg {
class Conv3DNdhwcDhwcfQOp;
}
}
namespace mlir {
namespace linalg {
class Conv3DOp;
}
}
namespace mlir {
namespace linalg {
class CopyOp;
}
}
namespace mlir {
namespace linalg {
class DepthwiseConv1DNcwCwOp;
}
}
namespace mlir {
namespace linalg {
class DepthwiseConv1DNwcWcOp;
}
}
namespace mlir {
namespace linalg {
class DepthwiseConv1DNwcWcmOp;
}
}
namespace mlir {
namespace linalg {
class DepthwiseConv2DNchwChwOp;
}
}
namespace mlir {
namespace linalg {
class DepthwiseConv2DNhwcHwcOp;
}
}
namespace mlir {
namespace linalg {
class DepthwiseConv2DNhwcHwcQOp;
}
}
namespace mlir {
namespace linalg {
class DepthwiseConv2DNhwcHwcmOp;
}
}
namespace mlir {
namespace linalg {
class DepthwiseConv2DNhwcHwcmQOp;
}
}
namespace mlir {
namespace linalg {
class DepthwiseConv3DNcdhwCdhwOp;
}
}
namespace mlir {
namespace linalg {
class DepthwiseConv3DNdhwcDhwcOp;
}
}
namespace mlir {
namespace linalg {
class DepthwiseConv3DNdhwcDhwcmOp;
}
}
namespace mlir {
namespace linalg {
class DivOp;
}
}
namespace mlir {
namespace linalg {
class DivUnsignedOp;
}
}
namespace mlir {
namespace linalg {
class DotOp;
}
}
namespace mlir {
namespace linalg {
class ElemwiseBinaryOp;
}
}
namespace mlir {
namespace linalg {
class ElemwiseUnaryOp;
}
}
namespace mlir {
namespace linalg {
class ErfOp;
}
}
namespace mlir {
namespace linalg {
class ExpOp;
}
}
namespace mlir {
namespace linalg {
class FillOp;
}
}
namespace mlir {
namespace linalg {
class FillRng2DOp;
}
}
namespace mlir {
namespace linalg {
class FloorOp;
}
}
namespace mlir {
namespace linalg {
class GenericOp;
}
}
namespace mlir {
namespace linalg {
class LogOp;
}
}
namespace mlir {
namespace linalg {
class MapOp;
}
}
namespace mlir {
namespace linalg {
class MatmulOp;
}
}
namespace mlir {
namespace linalg {
class MatmulTransposeAOp;
}
}
namespace mlir {
namespace linalg {
class MatmulTransposeBOp;
}
}
namespace mlir {
namespace linalg {
class MatvecOp;
}
}
namespace mlir {
namespace linalg {
class MaxOp;
}
}
namespace mlir {
namespace linalg {
class MinOp;
}
}
namespace mlir {
namespace linalg {
class Mmt4DOp;
}
}
namespace mlir {
namespace linalg {
class MulOp;
}
}
namespace mlir {
namespace linalg {
class NegFOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNchwMaxOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNchwSumOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNcwMaxOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNcwSumOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNdhwcMaxOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNdhwcMinOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNdhwcSumOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNhwcMaxOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNhwcMaxUnsignedOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNhwcMinOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNhwcMinUnsignedOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNhwcSumOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNwcMaxOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNwcMaxUnsignedOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNwcMinOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNwcMinUnsignedOp;
}
}
namespace mlir {
namespace linalg {
class PoolingNwcSumOp;
}
}
namespace mlir {
namespace linalg {
class PowFOp;
}
}
namespace mlir {
namespace linalg {
class QuantizedBatchMatmulOp;
}
}
namespace mlir {
namespace linalg {
class QuantizedMatmulOp;
}
}
namespace mlir {
namespace linalg {
class ReciprocalOp;
}
}
namespace mlir {
namespace linalg {
class ReduceOp;
}
}
namespace mlir {
namespace linalg {
class RoundOp;
}
}
namespace mlir {
namespace linalg {
class RsqrtOp;
}
}
namespace mlir {
namespace linalg {
class SelectOp;
}
}
namespace mlir {
namespace linalg {
class SqrtOp;
}
}
namespace mlir {
namespace linalg {
class SquareOp;
}
}
namespace mlir {
namespace linalg {
class SubOp;
}
}
namespace mlir {
namespace linalg {
class TanhOp;
}
}
namespace mlir {
namespace linalg {
class TransposeOp;
}
}
namespace mlir {
namespace linalg {
class VecmatOp;
}
}
#ifdef GET_OP_CLASSES
#undef GET_OP_CLASSES
namespace mlir {
namespace linalg {
namespace detail {
class AbsOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
AbsOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.abs", odsAttrs.getContext());
}
AbsOpGenericAdaptorBase(AbsOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class AbsOpGenericAdaptor : public detail::AbsOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::AbsOpGenericAdaptorBase;
public:
AbsOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
AbsOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : AbsOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
AbsOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : AbsOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = AbsOp, typename = std::enable_if_t<std::is_same_v<LateInst, AbsOp>>>
AbsOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class AbsOpAdaptor : public AbsOpGenericAdaptor<::mlir::ValueRange> {
public:
using AbsOpGenericAdaptor::AbsOpGenericAdaptor;
AbsOpAdaptor(AbsOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class AbsOp : public ::mlir::Op<AbsOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = AbsOpAdaptor;
template <typename RangeT>
using GenericAdaptor = AbsOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.abs");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::AbsOp)
namespace mlir {
namespace linalg {
namespace detail {
class AddOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
AddOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.add", odsAttrs.getContext());
}
AddOpGenericAdaptorBase(AddOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class AddOpGenericAdaptor : public detail::AddOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::AddOpGenericAdaptorBase;
public:
AddOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
AddOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : AddOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
AddOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : AddOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = AddOp, typename = std::enable_if_t<std::is_same_v<LateInst, AddOp>>>
AddOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class AddOpAdaptor : public AddOpGenericAdaptor<::mlir::ValueRange> {
public:
using AddOpGenericAdaptor::AddOpGenericAdaptor;
AddOpAdaptor(AddOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class AddOp : public ::mlir::Op<AddOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = AddOpAdaptor;
template <typename RangeT>
using GenericAdaptor = AddOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.add");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::AddOp)
namespace mlir {
namespace linalg {
namespace detail {
class BatchMatmulOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
BatchMatmulOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.batch_matmul", odsAttrs.getContext());
}
BatchMatmulOpGenericAdaptorBase(BatchMatmulOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class BatchMatmulOpGenericAdaptor : public detail::BatchMatmulOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::BatchMatmulOpGenericAdaptorBase;
public:
BatchMatmulOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
BatchMatmulOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : BatchMatmulOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
BatchMatmulOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : BatchMatmulOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = BatchMatmulOp, typename = std::enable_if_t<std::is_same_v<LateInst, BatchMatmulOp>>>
BatchMatmulOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class BatchMatmulOpAdaptor : public BatchMatmulOpGenericAdaptor<::mlir::ValueRange> {
public:
using BatchMatmulOpGenericAdaptor::BatchMatmulOpGenericAdaptor;
BatchMatmulOpAdaptor(BatchMatmulOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class BatchMatmulOp : public ::mlir::Op<BatchMatmulOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ContractionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = BatchMatmulOpAdaptor;
template <typename RangeT>
using GenericAdaptor = BatchMatmulOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.batch_matmul");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::BatchMatmulOp)
namespace mlir {
namespace linalg {
namespace detail {
class BatchMatmulTransposeAOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
BatchMatmulTransposeAOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.batch_matmul_transpose_a", odsAttrs.getContext());
}
BatchMatmulTransposeAOpGenericAdaptorBase(BatchMatmulTransposeAOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class BatchMatmulTransposeAOpGenericAdaptor : public detail::BatchMatmulTransposeAOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::BatchMatmulTransposeAOpGenericAdaptorBase;
public:
BatchMatmulTransposeAOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
BatchMatmulTransposeAOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : BatchMatmulTransposeAOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
BatchMatmulTransposeAOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : BatchMatmulTransposeAOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = BatchMatmulTransposeAOp, typename = std::enable_if_t<std::is_same_v<LateInst, BatchMatmulTransposeAOp>>>
BatchMatmulTransposeAOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class BatchMatmulTransposeAOpAdaptor : public BatchMatmulTransposeAOpGenericAdaptor<::mlir::ValueRange> {
public:
using BatchMatmulTransposeAOpGenericAdaptor::BatchMatmulTransposeAOpGenericAdaptor;
BatchMatmulTransposeAOpAdaptor(BatchMatmulTransposeAOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class BatchMatmulTransposeAOp : public ::mlir::Op<BatchMatmulTransposeAOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ContractionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = BatchMatmulTransposeAOpAdaptor;
template <typename RangeT>
using GenericAdaptor = BatchMatmulTransposeAOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.batch_matmul_transpose_a");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::BatchMatmulTransposeAOp)
namespace mlir {
namespace linalg {
namespace detail {
class BatchMatmulTransposeBOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
BatchMatmulTransposeBOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.batch_matmul_transpose_b", odsAttrs.getContext());
}
BatchMatmulTransposeBOpGenericAdaptorBase(BatchMatmulTransposeBOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class BatchMatmulTransposeBOpGenericAdaptor : public detail::BatchMatmulTransposeBOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::BatchMatmulTransposeBOpGenericAdaptorBase;
public:
BatchMatmulTransposeBOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
BatchMatmulTransposeBOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : BatchMatmulTransposeBOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
BatchMatmulTransposeBOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : BatchMatmulTransposeBOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = BatchMatmulTransposeBOp, typename = std::enable_if_t<std::is_same_v<LateInst, BatchMatmulTransposeBOp>>>
BatchMatmulTransposeBOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class BatchMatmulTransposeBOpAdaptor : public BatchMatmulTransposeBOpGenericAdaptor<::mlir::ValueRange> {
public:
using BatchMatmulTransposeBOpGenericAdaptor::BatchMatmulTransposeBOpGenericAdaptor;
BatchMatmulTransposeBOpAdaptor(BatchMatmulTransposeBOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class BatchMatmulTransposeBOp : public ::mlir::Op<BatchMatmulTransposeBOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ContractionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = BatchMatmulTransposeBOpAdaptor;
template <typename RangeT>
using GenericAdaptor = BatchMatmulTransposeBOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.batch_matmul_transpose_b");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::BatchMatmulTransposeBOp)
namespace mlir {
namespace linalg {
namespace detail {
class BatchMatvecOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
BatchMatvecOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.batch_matvec", odsAttrs.getContext());
}
BatchMatvecOpGenericAdaptorBase(BatchMatvecOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class BatchMatvecOpGenericAdaptor : public detail::BatchMatvecOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::BatchMatvecOpGenericAdaptorBase;
public:
BatchMatvecOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
BatchMatvecOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : BatchMatvecOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
BatchMatvecOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : BatchMatvecOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = BatchMatvecOp, typename = std::enable_if_t<std::is_same_v<LateInst, BatchMatvecOp>>>
BatchMatvecOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class BatchMatvecOpAdaptor : public BatchMatvecOpGenericAdaptor<::mlir::ValueRange> {
public:
using BatchMatvecOpGenericAdaptor::BatchMatvecOpGenericAdaptor;
BatchMatvecOpAdaptor(BatchMatvecOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class BatchMatvecOp : public ::mlir::Op<BatchMatvecOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ContractionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = BatchMatvecOpAdaptor;
template <typename RangeT>
using GenericAdaptor = BatchMatvecOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.batch_matvec");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::BatchMatvecOp)
namespace mlir {
namespace linalg {
namespace detail {
class BatchMmt4DOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
BatchMmt4DOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.batch_mmt4d", odsAttrs.getContext());
}
BatchMmt4DOpGenericAdaptorBase(BatchMmt4DOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class BatchMmt4DOpGenericAdaptor : public detail::BatchMmt4DOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::BatchMmt4DOpGenericAdaptorBase;
public:
BatchMmt4DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
BatchMmt4DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : BatchMmt4DOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
BatchMmt4DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : BatchMmt4DOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = BatchMmt4DOp, typename = std::enable_if_t<std::is_same_v<LateInst, BatchMmt4DOp>>>
BatchMmt4DOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class BatchMmt4DOpAdaptor : public BatchMmt4DOpGenericAdaptor<::mlir::ValueRange> {
public:
using BatchMmt4DOpGenericAdaptor::BatchMmt4DOpGenericAdaptor;
BatchMmt4DOpAdaptor(BatchMmt4DOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class BatchMmt4DOp : public ::mlir::Op<BatchMmt4DOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ContractionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = BatchMmt4DOpAdaptor;
template <typename RangeT>
using GenericAdaptor = BatchMmt4DOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.batch_mmt4d");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::BatchMmt4DOp)
namespace mlir {
namespace linalg {
namespace detail {
class BatchReduceMatmulOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
BatchReduceMatmulOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.batch_reduce_matmul", odsAttrs.getContext());
}
BatchReduceMatmulOpGenericAdaptorBase(BatchReduceMatmulOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class BatchReduceMatmulOpGenericAdaptor : public detail::BatchReduceMatmulOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::BatchReduceMatmulOpGenericAdaptorBase;
public:
BatchReduceMatmulOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
BatchReduceMatmulOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : BatchReduceMatmulOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
BatchReduceMatmulOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : BatchReduceMatmulOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = BatchReduceMatmulOp, typename = std::enable_if_t<std::is_same_v<LateInst, BatchReduceMatmulOp>>>
BatchReduceMatmulOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class BatchReduceMatmulOpAdaptor : public BatchReduceMatmulOpGenericAdaptor<::mlir::ValueRange> {
public:
using BatchReduceMatmulOpGenericAdaptor::BatchReduceMatmulOpGenericAdaptor;
BatchReduceMatmulOpAdaptor(BatchReduceMatmulOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class BatchReduceMatmulOp : public ::mlir::Op<BatchReduceMatmulOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ContractionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = BatchReduceMatmulOpAdaptor;
template <typename RangeT>
using GenericAdaptor = BatchReduceMatmulOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.batch_reduce_matmul");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::BatchReduceMatmulOp)
namespace mlir {
namespace linalg {
namespace detail {
class BatchVecmatOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
BatchVecmatOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.batch_vecmat", odsAttrs.getContext());
}
BatchVecmatOpGenericAdaptorBase(BatchVecmatOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class BatchVecmatOpGenericAdaptor : public detail::BatchVecmatOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::BatchVecmatOpGenericAdaptorBase;
public:
BatchVecmatOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
BatchVecmatOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : BatchVecmatOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
BatchVecmatOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : BatchVecmatOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = BatchVecmatOp, typename = std::enable_if_t<std::is_same_v<LateInst, BatchVecmatOp>>>
BatchVecmatOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class BatchVecmatOpAdaptor : public BatchVecmatOpGenericAdaptor<::mlir::ValueRange> {
public:
using BatchVecmatOpGenericAdaptor::BatchVecmatOpGenericAdaptor;
BatchVecmatOpAdaptor(BatchVecmatOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class BatchVecmatOp : public ::mlir::Op<BatchVecmatOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ContractionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = BatchVecmatOpAdaptor;
template <typename RangeT>
using GenericAdaptor = BatchVecmatOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.batch_vecmat");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::BatchVecmatOp)
namespace mlir {
namespace linalg {
namespace detail {
class BroadcastOpGenericAdaptorBase {
public:
struct Properties {
using dimensionsTy = ::mlir::DenseI64ArrayAttr;
dimensionsTy dimensions;
auto getDimensions() {
auto &propStorage = this->dimensions;
return ::llvm::cast<::mlir::DenseI64ArrayAttr>(propStorage);
}
void setDimensions(const ::mlir::DenseI64ArrayAttr &propValue) {
this->dimensions = propValue;
}
bool operator==(const Properties &rhs) const {
return
rhs.dimensions == this->dimensions &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
BroadcastOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.broadcast", odsAttrs.getContext());
}
BroadcastOpGenericAdaptorBase(BroadcastOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
return {index, 1};
}
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseI64ArrayAttr getDimensionsAttr() {
auto attr = ::llvm::cast<::mlir::DenseI64ArrayAttr>(getProperties().dimensions);
return attr;
}
::llvm::ArrayRef<int64_t> getDimensions();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class BroadcastOpGenericAdaptor : public detail::BroadcastOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::BroadcastOpGenericAdaptorBase;
public:
BroadcastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
BroadcastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : BroadcastOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
BroadcastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : BroadcastOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = BroadcastOp, typename = std::enable_if_t<std::is_same_v<LateInst, BroadcastOp>>>
BroadcastOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
ValueT getInput() {
return (*getODSOperands(0).begin());
}
ValueT getInit() {
return (*getODSOperands(1).begin());
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class BroadcastOpAdaptor : public BroadcastOpGenericAdaptor<::mlir::ValueRange> {
public:
using BroadcastOpGenericAdaptor::BroadcastOpGenericAdaptor;
BroadcastOpAdaptor(BroadcastOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class BroadcastOp : public ::mlir::Op<BroadcastOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::OpAsmOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = BroadcastOpAdaptor;
template <typename RangeT>
using GenericAdaptor = BroadcastOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dimensions")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDimensionsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDimensionsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.broadcast");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return {index, 1};
}
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::TypedValue<::mlir::ShapedType> getInput() {
return ::llvm::cast<::mlir::TypedValue<::mlir::ShapedType>>(*getODSOperands(0).begin());
}
::mlir::TypedValue<::mlir::ShapedType> getInit() {
return ::llvm::cast<::mlir::TypedValue<::mlir::ShapedType>>(*getODSOperands(1).begin());
}
::mlir::OpOperand &getInputMutable() {
auto range = getODSOperandIndexAndLength(0);
return getOperation()->getOpOperand(range.first);
}
::mlir::OpOperand &getInitMutable() {
auto range = getODSOperandIndexAndLength(1);
return getOperation()->getOpOperand(range.first);
}
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResult() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseI64ArrayAttr getDimensionsAttr() {
return ::llvm::cast<::mlir::DenseI64ArrayAttr>(getProperties().dimensions);
}
::llvm::ArrayRef<int64_t> getDimensions();
void setDimensionsAttr(::mlir::DenseI64ArrayAttr attr) {
getProperties().dimensions = attr;
}
void setDimensions(::llvm::ArrayRef<int64_t> attrValue);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value input, Value init, DenseI64ArrayAttr dimensions, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value input, Value init, ArrayRef<int64_t> dimensions, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult verify();
static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn);
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 1 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
std::string getLibraryCallName() {
return "op_has_no_registered_library_name";
}
MutableOperandRange getDpsInitsMutable() { return getInitMutable(); }
static void regionBuilder(mlir::ImplicitLocOpBuilder &b, mlir::Block &block,
mlir::ArrayRef<mlir::NamedAttribute>) {
OpBuilder::InsertionGuard guard(b);
b.create<linalg::YieldOp>(b.getLoc(), block.getArgument(0));
}
static std::function<void(mlir::ImplicitLocOpBuilder &, mlir::Block &,
mlir::ArrayRef<mlir::NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::BroadcastOp)
namespace mlir {
namespace linalg {
namespace detail {
class CeilOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
CeilOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.ceil", odsAttrs.getContext());
}
CeilOpGenericAdaptorBase(CeilOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class CeilOpGenericAdaptor : public detail::CeilOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::CeilOpGenericAdaptorBase;
public:
CeilOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
CeilOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : CeilOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
CeilOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : CeilOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = CeilOp, typename = std::enable_if_t<std::is_same_v<LateInst, CeilOp>>>
CeilOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class CeilOpAdaptor : public CeilOpGenericAdaptor<::mlir::ValueRange> {
public:
using CeilOpGenericAdaptor::CeilOpGenericAdaptor;
CeilOpAdaptor(CeilOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class CeilOp : public ::mlir::Op<CeilOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = CeilOpAdaptor;
template <typename RangeT>
using GenericAdaptor = CeilOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.ceil");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::CeilOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv1DNcwFcwOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv1DNcwFcwOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_1d_ncw_fcw", odsAttrs.getContext());
}
Conv1DNcwFcwOpGenericAdaptorBase(Conv1DNcwFcwOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv1DNcwFcwOpGenericAdaptor : public detail::Conv1DNcwFcwOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv1DNcwFcwOpGenericAdaptorBase;
public:
Conv1DNcwFcwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv1DNcwFcwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv1DNcwFcwOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv1DNcwFcwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv1DNcwFcwOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv1DNcwFcwOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv1DNcwFcwOp>>>
Conv1DNcwFcwOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv1DNcwFcwOpAdaptor : public Conv1DNcwFcwOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv1DNcwFcwOpGenericAdaptor::Conv1DNcwFcwOpGenericAdaptor;
Conv1DNcwFcwOpAdaptor(Conv1DNcwFcwOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv1DNcwFcwOp : public ::mlir::Op<Conv1DNcwFcwOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv1DNcwFcwOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv1DNcwFcwOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_1d_ncw_fcw");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv1DNcwFcwOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv1DNwcWcfOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv1DNwcWcfOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_1d_nwc_wcf", odsAttrs.getContext());
}
Conv1DNwcWcfOpGenericAdaptorBase(Conv1DNwcWcfOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv1DNwcWcfOpGenericAdaptor : public detail::Conv1DNwcWcfOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv1DNwcWcfOpGenericAdaptorBase;
public:
Conv1DNwcWcfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv1DNwcWcfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv1DNwcWcfOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv1DNwcWcfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv1DNwcWcfOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv1DNwcWcfOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv1DNwcWcfOp>>>
Conv1DNwcWcfOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv1DNwcWcfOpAdaptor : public Conv1DNwcWcfOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv1DNwcWcfOpGenericAdaptor::Conv1DNwcWcfOpGenericAdaptor;
Conv1DNwcWcfOpAdaptor(Conv1DNwcWcfOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv1DNwcWcfOp : public ::mlir::Op<Conv1DNwcWcfOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv1DNwcWcfOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv1DNwcWcfOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_1d_nwc_wcf");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv1DNwcWcfOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv1DOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv1DOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_1d", odsAttrs.getContext());
}
Conv1DOpGenericAdaptorBase(Conv1DOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv1DOpGenericAdaptor : public detail::Conv1DOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv1DOpGenericAdaptorBase;
public:
Conv1DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv1DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv1DOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv1DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv1DOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv1DOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv1DOp>>>
Conv1DOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv1DOpAdaptor : public Conv1DOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv1DOpGenericAdaptor::Conv1DOpGenericAdaptor;
Conv1DOpAdaptor(Conv1DOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv1DOp : public ::mlir::Op<Conv1DOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv1DOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv1DOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_1d");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv1DOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv2DNchwFchwOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv2DNchwFchwOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_2d_nchw_fchw", odsAttrs.getContext());
}
Conv2DNchwFchwOpGenericAdaptorBase(Conv2DNchwFchwOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv2DNchwFchwOpGenericAdaptor : public detail::Conv2DNchwFchwOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv2DNchwFchwOpGenericAdaptorBase;
public:
Conv2DNchwFchwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv2DNchwFchwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv2DNchwFchwOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv2DNchwFchwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv2DNchwFchwOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv2DNchwFchwOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv2DNchwFchwOp>>>
Conv2DNchwFchwOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv2DNchwFchwOpAdaptor : public Conv2DNchwFchwOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv2DNchwFchwOpGenericAdaptor::Conv2DNchwFchwOpGenericAdaptor;
Conv2DNchwFchwOpAdaptor(Conv2DNchwFchwOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv2DNchwFchwOp : public ::mlir::Op<Conv2DNchwFchwOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv2DNchwFchwOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv2DNchwFchwOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_2d_nchw_fchw");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv2DNchwFchwOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv2DNgchwFgchwOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv2DNgchwFgchwOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_2d_ngchw_fgchw", odsAttrs.getContext());
}
Conv2DNgchwFgchwOpGenericAdaptorBase(Conv2DNgchwFgchwOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv2DNgchwFgchwOpGenericAdaptor : public detail::Conv2DNgchwFgchwOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv2DNgchwFgchwOpGenericAdaptorBase;
public:
Conv2DNgchwFgchwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv2DNgchwFgchwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv2DNgchwFgchwOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv2DNgchwFgchwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv2DNgchwFgchwOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv2DNgchwFgchwOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv2DNgchwFgchwOp>>>
Conv2DNgchwFgchwOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv2DNgchwFgchwOpAdaptor : public Conv2DNgchwFgchwOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv2DNgchwFgchwOpGenericAdaptor::Conv2DNgchwFgchwOpGenericAdaptor;
Conv2DNgchwFgchwOpAdaptor(Conv2DNgchwFgchwOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv2DNgchwFgchwOp : public ::mlir::Op<Conv2DNgchwFgchwOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv2DNgchwFgchwOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv2DNgchwFgchwOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_2d_ngchw_fgchw");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv2DNgchwFgchwOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv2DNgchwGfchwOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv2DNgchwGfchwOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_2d_ngchw_gfchw", odsAttrs.getContext());
}
Conv2DNgchwGfchwOpGenericAdaptorBase(Conv2DNgchwGfchwOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv2DNgchwGfchwOpGenericAdaptor : public detail::Conv2DNgchwGfchwOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv2DNgchwGfchwOpGenericAdaptorBase;
public:
Conv2DNgchwGfchwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv2DNgchwGfchwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv2DNgchwGfchwOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv2DNgchwGfchwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv2DNgchwGfchwOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv2DNgchwGfchwOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv2DNgchwGfchwOp>>>
Conv2DNgchwGfchwOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv2DNgchwGfchwOpAdaptor : public Conv2DNgchwGfchwOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv2DNgchwGfchwOpGenericAdaptor::Conv2DNgchwGfchwOpGenericAdaptor;
Conv2DNgchwGfchwOpAdaptor(Conv2DNgchwGfchwOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv2DNgchwGfchwOp : public ::mlir::Op<Conv2DNgchwGfchwOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv2DNgchwGfchwOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv2DNgchwGfchwOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_2d_ngchw_gfchw");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv2DNgchwGfchwOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv2DNgchwGfchwQOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv2DNgchwGfchwQOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_2d_ngchw_gfchw_q", odsAttrs.getContext());
}
Conv2DNgchwGfchwQOpGenericAdaptorBase(Conv2DNgchwGfchwQOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv2DNgchwGfchwQOpGenericAdaptor : public detail::Conv2DNgchwGfchwQOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv2DNgchwGfchwQOpGenericAdaptorBase;
public:
Conv2DNgchwGfchwQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv2DNgchwGfchwQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv2DNgchwGfchwQOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv2DNgchwGfchwQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv2DNgchwGfchwQOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv2DNgchwGfchwQOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv2DNgchwGfchwQOp>>>
Conv2DNgchwGfchwQOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv2DNgchwGfchwQOpAdaptor : public Conv2DNgchwGfchwQOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv2DNgchwGfchwQOpGenericAdaptor::Conv2DNgchwGfchwQOpGenericAdaptor;
Conv2DNgchwGfchwQOpAdaptor(Conv2DNgchwGfchwQOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv2DNgchwGfchwQOp : public ::mlir::Op<Conv2DNgchwGfchwQOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv2DNgchwGfchwQOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv2DNgchwGfchwQOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_2d_ngchw_gfchw_q");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv2DNgchwGfchwQOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv2DNhwcFhwcOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv2DNhwcFhwcOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_2d_nhwc_fhwc", odsAttrs.getContext());
}
Conv2DNhwcFhwcOpGenericAdaptorBase(Conv2DNhwcFhwcOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv2DNhwcFhwcOpGenericAdaptor : public detail::Conv2DNhwcFhwcOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv2DNhwcFhwcOpGenericAdaptorBase;
public:
Conv2DNhwcFhwcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv2DNhwcFhwcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv2DNhwcFhwcOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv2DNhwcFhwcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv2DNhwcFhwcOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv2DNhwcFhwcOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv2DNhwcFhwcOp>>>
Conv2DNhwcFhwcOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv2DNhwcFhwcOpAdaptor : public Conv2DNhwcFhwcOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv2DNhwcFhwcOpGenericAdaptor::Conv2DNhwcFhwcOpGenericAdaptor;
Conv2DNhwcFhwcOpAdaptor(Conv2DNhwcFhwcOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv2DNhwcFhwcOp : public ::mlir::Op<Conv2DNhwcFhwcOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv2DNhwcFhwcOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv2DNhwcFhwcOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_2d_nhwc_fhwc");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv2DNhwcFhwcOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv2DNhwcFhwcQOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv2DNhwcFhwcQOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_2d_nhwc_fhwc_q", odsAttrs.getContext());
}
Conv2DNhwcFhwcQOpGenericAdaptorBase(Conv2DNhwcFhwcQOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv2DNhwcFhwcQOpGenericAdaptor : public detail::Conv2DNhwcFhwcQOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv2DNhwcFhwcQOpGenericAdaptorBase;
public:
Conv2DNhwcFhwcQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv2DNhwcFhwcQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv2DNhwcFhwcQOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv2DNhwcFhwcQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv2DNhwcFhwcQOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv2DNhwcFhwcQOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv2DNhwcFhwcQOp>>>
Conv2DNhwcFhwcQOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv2DNhwcFhwcQOpAdaptor : public Conv2DNhwcFhwcQOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv2DNhwcFhwcQOpGenericAdaptor::Conv2DNhwcFhwcQOpGenericAdaptor;
Conv2DNhwcFhwcQOpAdaptor(Conv2DNhwcFhwcQOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv2DNhwcFhwcQOp : public ::mlir::Op<Conv2DNhwcFhwcQOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv2DNhwcFhwcQOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv2DNhwcFhwcQOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_2d_nhwc_fhwc_q");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv2DNhwcFhwcQOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv2DNhwcHwcfOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv2DNhwcHwcfOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_2d_nhwc_hwcf", odsAttrs.getContext());
}
Conv2DNhwcHwcfOpGenericAdaptorBase(Conv2DNhwcHwcfOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv2DNhwcHwcfOpGenericAdaptor : public detail::Conv2DNhwcHwcfOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv2DNhwcHwcfOpGenericAdaptorBase;
public:
Conv2DNhwcHwcfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv2DNhwcHwcfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv2DNhwcHwcfOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv2DNhwcHwcfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv2DNhwcHwcfOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv2DNhwcHwcfOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv2DNhwcHwcfOp>>>
Conv2DNhwcHwcfOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv2DNhwcHwcfOpAdaptor : public Conv2DNhwcHwcfOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv2DNhwcHwcfOpGenericAdaptor::Conv2DNhwcHwcfOpGenericAdaptor;
Conv2DNhwcHwcfOpAdaptor(Conv2DNhwcHwcfOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv2DNhwcHwcfOp : public ::mlir::Op<Conv2DNhwcHwcfOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv2DNhwcHwcfOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv2DNhwcHwcfOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_2d_nhwc_hwcf");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv2DNhwcHwcfOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv2DNhwcHwcfQOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv2DNhwcHwcfQOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_2d_nhwc_hwcf_q", odsAttrs.getContext());
}
Conv2DNhwcHwcfQOpGenericAdaptorBase(Conv2DNhwcHwcfQOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv2DNhwcHwcfQOpGenericAdaptor : public detail::Conv2DNhwcHwcfQOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv2DNhwcHwcfQOpGenericAdaptorBase;
public:
Conv2DNhwcHwcfQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv2DNhwcHwcfQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv2DNhwcHwcfQOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv2DNhwcHwcfQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv2DNhwcHwcfQOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv2DNhwcHwcfQOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv2DNhwcHwcfQOp>>>
Conv2DNhwcHwcfQOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv2DNhwcHwcfQOpAdaptor : public Conv2DNhwcHwcfQOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv2DNhwcHwcfQOpGenericAdaptor::Conv2DNhwcHwcfQOpGenericAdaptor;
Conv2DNhwcHwcfQOpAdaptor(Conv2DNhwcHwcfQOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv2DNhwcHwcfQOp : public ::mlir::Op<Conv2DNhwcHwcfQOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv2DNhwcHwcfQOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv2DNhwcHwcfQOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_2d_nhwc_hwcf_q");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv2DNhwcHwcfQOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv2DOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv2DOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_2d", odsAttrs.getContext());
}
Conv2DOpGenericAdaptorBase(Conv2DOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv2DOpGenericAdaptor : public detail::Conv2DOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv2DOpGenericAdaptorBase;
public:
Conv2DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv2DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv2DOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv2DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv2DOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv2DOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv2DOp>>>
Conv2DOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv2DOpAdaptor : public Conv2DOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv2DOpGenericAdaptor::Conv2DOpGenericAdaptor;
Conv2DOpAdaptor(Conv2DOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv2DOp : public ::mlir::Op<Conv2DOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv2DOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv2DOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_2d");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv2DOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv3DNcdhwFcdhwOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv3DNcdhwFcdhwOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_3d_ncdhw_fcdhw", odsAttrs.getContext());
}
Conv3DNcdhwFcdhwOpGenericAdaptorBase(Conv3DNcdhwFcdhwOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv3DNcdhwFcdhwOpGenericAdaptor : public detail::Conv3DNcdhwFcdhwOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv3DNcdhwFcdhwOpGenericAdaptorBase;
public:
Conv3DNcdhwFcdhwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv3DNcdhwFcdhwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv3DNcdhwFcdhwOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv3DNcdhwFcdhwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv3DNcdhwFcdhwOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv3DNcdhwFcdhwOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv3DNcdhwFcdhwOp>>>
Conv3DNcdhwFcdhwOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv3DNcdhwFcdhwOpAdaptor : public Conv3DNcdhwFcdhwOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv3DNcdhwFcdhwOpGenericAdaptor::Conv3DNcdhwFcdhwOpGenericAdaptor;
Conv3DNcdhwFcdhwOpAdaptor(Conv3DNcdhwFcdhwOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv3DNcdhwFcdhwOp : public ::mlir::Op<Conv3DNcdhwFcdhwOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv3DNcdhwFcdhwOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv3DNcdhwFcdhwOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_3d_ncdhw_fcdhw");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv3DNcdhwFcdhwOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv3DNdhwcDhwcfOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv3DNdhwcDhwcfOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_3d_ndhwc_dhwcf", odsAttrs.getContext());
}
Conv3DNdhwcDhwcfOpGenericAdaptorBase(Conv3DNdhwcDhwcfOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv3DNdhwcDhwcfOpGenericAdaptor : public detail::Conv3DNdhwcDhwcfOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv3DNdhwcDhwcfOpGenericAdaptorBase;
public:
Conv3DNdhwcDhwcfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv3DNdhwcDhwcfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv3DNdhwcDhwcfOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv3DNdhwcDhwcfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv3DNdhwcDhwcfOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv3DNdhwcDhwcfOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv3DNdhwcDhwcfOp>>>
Conv3DNdhwcDhwcfOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv3DNdhwcDhwcfOpAdaptor : public Conv3DNdhwcDhwcfOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv3DNdhwcDhwcfOpGenericAdaptor::Conv3DNdhwcDhwcfOpGenericAdaptor;
Conv3DNdhwcDhwcfOpAdaptor(Conv3DNdhwcDhwcfOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv3DNdhwcDhwcfOp : public ::mlir::Op<Conv3DNdhwcDhwcfOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv3DNdhwcDhwcfOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv3DNdhwcDhwcfOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_3d_ndhwc_dhwcf");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv3DNdhwcDhwcfOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv3DNdhwcDhwcfQOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv3DNdhwcDhwcfQOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_3d_ndhwc_dhwcf_q", odsAttrs.getContext());
}
Conv3DNdhwcDhwcfQOpGenericAdaptorBase(Conv3DNdhwcDhwcfQOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv3DNdhwcDhwcfQOpGenericAdaptor : public detail::Conv3DNdhwcDhwcfQOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv3DNdhwcDhwcfQOpGenericAdaptorBase;
public:
Conv3DNdhwcDhwcfQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv3DNdhwcDhwcfQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv3DNdhwcDhwcfQOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv3DNdhwcDhwcfQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv3DNdhwcDhwcfQOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv3DNdhwcDhwcfQOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv3DNdhwcDhwcfQOp>>>
Conv3DNdhwcDhwcfQOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv3DNdhwcDhwcfQOpAdaptor : public Conv3DNdhwcDhwcfQOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv3DNdhwcDhwcfQOpGenericAdaptor::Conv3DNdhwcDhwcfQOpGenericAdaptor;
Conv3DNdhwcDhwcfQOpAdaptor(Conv3DNdhwcDhwcfQOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv3DNdhwcDhwcfQOp : public ::mlir::Op<Conv3DNdhwcDhwcfQOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv3DNdhwcDhwcfQOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv3DNdhwcDhwcfQOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_3d_ndhwc_dhwcf_q");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv3DNdhwcDhwcfQOp)
namespace mlir {
namespace linalg {
namespace detail {
class Conv3DOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
Conv3DOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.conv_3d", odsAttrs.getContext());
}
Conv3DOpGenericAdaptorBase(Conv3DOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class Conv3DOpGenericAdaptor : public detail::Conv3DOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::Conv3DOpGenericAdaptorBase;
public:
Conv3DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
Conv3DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : Conv3DOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
Conv3DOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : Conv3DOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = Conv3DOp, typename = std::enable_if_t<std::is_same_v<LateInst, Conv3DOp>>>
Conv3DOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class Conv3DOpAdaptor : public Conv3DOpGenericAdaptor<::mlir::ValueRange> {
public:
using Conv3DOpGenericAdaptor::Conv3DOpGenericAdaptor;
Conv3DOpAdaptor(Conv3DOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class Conv3DOp : public ::mlir::Op<Conv3DOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = Conv3DOpAdaptor;
template <typename RangeT>
using GenericAdaptor = Conv3DOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.conv_3d");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::Conv3DOp)
namespace mlir {
namespace linalg {
namespace detail {
class CopyOpGenericAdaptorBase {
public:
struct Properties {
using castTy = ::mlir::linalg::TypeFnAttr;
castTy cast;
auto getCast() {
auto &propStorage = this->cast;
return ::llvm::dyn_cast_or_null<::mlir::linalg::TypeFnAttr>(propStorage);
}
void setCast(const ::mlir::linalg::TypeFnAttr &propValue) {
this->cast = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.cast == this->cast &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
CopyOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.copy", odsAttrs.getContext());
}
CopyOpGenericAdaptorBase(CopyOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::linalg::TypeFnAttr getCastAttr();
::mlir::linalg::TypeFn getCast();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class CopyOpGenericAdaptor : public detail::CopyOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::CopyOpGenericAdaptorBase;
public:
CopyOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
CopyOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : CopyOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
CopyOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : CopyOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = CopyOp, typename = std::enable_if_t<std::is_same_v<LateInst, CopyOp>>>
CopyOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class CopyOpAdaptor : public CopyOpGenericAdaptor<::mlir::ValueRange> {
public:
using CopyOpGenericAdaptor::CopyOpGenericAdaptor;
CopyOpAdaptor(CopyOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class CopyOp : public ::mlir::Op<CopyOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = CopyOpAdaptor;
template <typename RangeT>
using GenericAdaptor = CopyOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("cast"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getCastAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getCastAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.copy");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::linalg::TypeFnAttr getCastAttr() {
return ::llvm::dyn_cast_or_null<::mlir::linalg::TypeFnAttr>(getProperties().cast);
}
::mlir::linalg::TypeFn getCast();
void setCastAttr(::mlir::linalg::TypeFnAttr attr) {
getProperties().cast = attr;
}
void setCast(::std::optional<::mlir::linalg::TypeFn> attrValue);
::mlir::Attribute removeCastAttr() {
auto &attr = getProperties().cast;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute cast, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context);
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 1 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::CopyOp)
namespace mlir {
namespace linalg {
namespace detail {
class DepthwiseConv1DNcwCwOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DepthwiseConv1DNcwCwOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.depthwise_conv_1d_ncw_cw", odsAttrs.getContext());
}
DepthwiseConv1DNcwCwOpGenericAdaptorBase(DepthwiseConv1DNcwCwOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DepthwiseConv1DNcwCwOpGenericAdaptor : public detail::DepthwiseConv1DNcwCwOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DepthwiseConv1DNcwCwOpGenericAdaptorBase;
public:
DepthwiseConv1DNcwCwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DepthwiseConv1DNcwCwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DepthwiseConv1DNcwCwOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DepthwiseConv1DNcwCwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DepthwiseConv1DNcwCwOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DepthwiseConv1DNcwCwOp, typename = std::enable_if_t<std::is_same_v<LateInst, DepthwiseConv1DNcwCwOp>>>
DepthwiseConv1DNcwCwOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DepthwiseConv1DNcwCwOpAdaptor : public DepthwiseConv1DNcwCwOpGenericAdaptor<::mlir::ValueRange> {
public:
using DepthwiseConv1DNcwCwOpGenericAdaptor::DepthwiseConv1DNcwCwOpGenericAdaptor;
DepthwiseConv1DNcwCwOpAdaptor(DepthwiseConv1DNcwCwOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DepthwiseConv1DNcwCwOp : public ::mlir::Op<DepthwiseConv1DNcwCwOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DepthwiseConv1DNcwCwOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DepthwiseConv1DNcwCwOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.depthwise_conv_1d_ncw_cw");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DepthwiseConv1DNcwCwOp)
namespace mlir {
namespace linalg {
namespace detail {
class DepthwiseConv1DNwcWcOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DepthwiseConv1DNwcWcOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.depthwise_conv_1d_nwc_wc", odsAttrs.getContext());
}
DepthwiseConv1DNwcWcOpGenericAdaptorBase(DepthwiseConv1DNwcWcOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DepthwiseConv1DNwcWcOpGenericAdaptor : public detail::DepthwiseConv1DNwcWcOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DepthwiseConv1DNwcWcOpGenericAdaptorBase;
public:
DepthwiseConv1DNwcWcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DepthwiseConv1DNwcWcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DepthwiseConv1DNwcWcOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DepthwiseConv1DNwcWcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DepthwiseConv1DNwcWcOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DepthwiseConv1DNwcWcOp, typename = std::enable_if_t<std::is_same_v<LateInst, DepthwiseConv1DNwcWcOp>>>
DepthwiseConv1DNwcWcOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DepthwiseConv1DNwcWcOpAdaptor : public DepthwiseConv1DNwcWcOpGenericAdaptor<::mlir::ValueRange> {
public:
using DepthwiseConv1DNwcWcOpGenericAdaptor::DepthwiseConv1DNwcWcOpGenericAdaptor;
DepthwiseConv1DNwcWcOpAdaptor(DepthwiseConv1DNwcWcOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DepthwiseConv1DNwcWcOp : public ::mlir::Op<DepthwiseConv1DNwcWcOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DepthwiseConv1DNwcWcOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DepthwiseConv1DNwcWcOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.depthwise_conv_1d_nwc_wc");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DepthwiseConv1DNwcWcOp)
namespace mlir {
namespace linalg {
namespace detail {
class DepthwiseConv1DNwcWcmOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DepthwiseConv1DNwcWcmOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.depthwise_conv_1d_nwc_wcm", odsAttrs.getContext());
}
DepthwiseConv1DNwcWcmOpGenericAdaptorBase(DepthwiseConv1DNwcWcmOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DepthwiseConv1DNwcWcmOpGenericAdaptor : public detail::DepthwiseConv1DNwcWcmOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DepthwiseConv1DNwcWcmOpGenericAdaptorBase;
public:
DepthwiseConv1DNwcWcmOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DepthwiseConv1DNwcWcmOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DepthwiseConv1DNwcWcmOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DepthwiseConv1DNwcWcmOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DepthwiseConv1DNwcWcmOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DepthwiseConv1DNwcWcmOp, typename = std::enable_if_t<std::is_same_v<LateInst, DepthwiseConv1DNwcWcmOp>>>
DepthwiseConv1DNwcWcmOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DepthwiseConv1DNwcWcmOpAdaptor : public DepthwiseConv1DNwcWcmOpGenericAdaptor<::mlir::ValueRange> {
public:
using DepthwiseConv1DNwcWcmOpGenericAdaptor::DepthwiseConv1DNwcWcmOpGenericAdaptor;
DepthwiseConv1DNwcWcmOpAdaptor(DepthwiseConv1DNwcWcmOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DepthwiseConv1DNwcWcmOp : public ::mlir::Op<DepthwiseConv1DNwcWcmOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DepthwiseConv1DNwcWcmOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DepthwiseConv1DNwcWcmOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.depthwise_conv_1d_nwc_wcm");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DepthwiseConv1DNwcWcmOp)
namespace mlir {
namespace linalg {
namespace detail {
class DepthwiseConv2DNchwChwOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DepthwiseConv2DNchwChwOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.depthwise_conv_2d_nchw_chw", odsAttrs.getContext());
}
DepthwiseConv2DNchwChwOpGenericAdaptorBase(DepthwiseConv2DNchwChwOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DepthwiseConv2DNchwChwOpGenericAdaptor : public detail::DepthwiseConv2DNchwChwOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DepthwiseConv2DNchwChwOpGenericAdaptorBase;
public:
DepthwiseConv2DNchwChwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DepthwiseConv2DNchwChwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DepthwiseConv2DNchwChwOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DepthwiseConv2DNchwChwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DepthwiseConv2DNchwChwOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DepthwiseConv2DNchwChwOp, typename = std::enable_if_t<std::is_same_v<LateInst, DepthwiseConv2DNchwChwOp>>>
DepthwiseConv2DNchwChwOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DepthwiseConv2DNchwChwOpAdaptor : public DepthwiseConv2DNchwChwOpGenericAdaptor<::mlir::ValueRange> {
public:
using DepthwiseConv2DNchwChwOpGenericAdaptor::DepthwiseConv2DNchwChwOpGenericAdaptor;
DepthwiseConv2DNchwChwOpAdaptor(DepthwiseConv2DNchwChwOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DepthwiseConv2DNchwChwOp : public ::mlir::Op<DepthwiseConv2DNchwChwOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DepthwiseConv2DNchwChwOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DepthwiseConv2DNchwChwOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.depthwise_conv_2d_nchw_chw");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DepthwiseConv2DNchwChwOp)
namespace mlir {
namespace linalg {
namespace detail {
class DepthwiseConv2DNhwcHwcOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DepthwiseConv2DNhwcHwcOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.depthwise_conv_2d_nhwc_hwc", odsAttrs.getContext());
}
DepthwiseConv2DNhwcHwcOpGenericAdaptorBase(DepthwiseConv2DNhwcHwcOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DepthwiseConv2DNhwcHwcOpGenericAdaptor : public detail::DepthwiseConv2DNhwcHwcOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DepthwiseConv2DNhwcHwcOpGenericAdaptorBase;
public:
DepthwiseConv2DNhwcHwcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DepthwiseConv2DNhwcHwcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DepthwiseConv2DNhwcHwcOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DepthwiseConv2DNhwcHwcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DepthwiseConv2DNhwcHwcOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DepthwiseConv2DNhwcHwcOp, typename = std::enable_if_t<std::is_same_v<LateInst, DepthwiseConv2DNhwcHwcOp>>>
DepthwiseConv2DNhwcHwcOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DepthwiseConv2DNhwcHwcOpAdaptor : public DepthwiseConv2DNhwcHwcOpGenericAdaptor<::mlir::ValueRange> {
public:
using DepthwiseConv2DNhwcHwcOpGenericAdaptor::DepthwiseConv2DNhwcHwcOpGenericAdaptor;
DepthwiseConv2DNhwcHwcOpAdaptor(DepthwiseConv2DNhwcHwcOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DepthwiseConv2DNhwcHwcOp : public ::mlir::Op<DepthwiseConv2DNhwcHwcOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DepthwiseConv2DNhwcHwcOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DepthwiseConv2DNhwcHwcOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.depthwise_conv_2d_nhwc_hwc");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DepthwiseConv2DNhwcHwcOp)
namespace mlir {
namespace linalg {
namespace detail {
class DepthwiseConv2DNhwcHwcQOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DepthwiseConv2DNhwcHwcQOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.depthwise_conv_2d_nhwc_hwc_q", odsAttrs.getContext());
}
DepthwiseConv2DNhwcHwcQOpGenericAdaptorBase(DepthwiseConv2DNhwcHwcQOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DepthwiseConv2DNhwcHwcQOpGenericAdaptor : public detail::DepthwiseConv2DNhwcHwcQOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DepthwiseConv2DNhwcHwcQOpGenericAdaptorBase;
public:
DepthwiseConv2DNhwcHwcQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DepthwiseConv2DNhwcHwcQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DepthwiseConv2DNhwcHwcQOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DepthwiseConv2DNhwcHwcQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DepthwiseConv2DNhwcHwcQOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DepthwiseConv2DNhwcHwcQOp, typename = std::enable_if_t<std::is_same_v<LateInst, DepthwiseConv2DNhwcHwcQOp>>>
DepthwiseConv2DNhwcHwcQOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DepthwiseConv2DNhwcHwcQOpAdaptor : public DepthwiseConv2DNhwcHwcQOpGenericAdaptor<::mlir::ValueRange> {
public:
using DepthwiseConv2DNhwcHwcQOpGenericAdaptor::DepthwiseConv2DNhwcHwcQOpGenericAdaptor;
DepthwiseConv2DNhwcHwcQOpAdaptor(DepthwiseConv2DNhwcHwcQOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DepthwiseConv2DNhwcHwcQOp : public ::mlir::Op<DepthwiseConv2DNhwcHwcQOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DepthwiseConv2DNhwcHwcQOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DepthwiseConv2DNhwcHwcQOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.depthwise_conv_2d_nhwc_hwc_q");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DepthwiseConv2DNhwcHwcQOp)
namespace mlir {
namespace linalg {
namespace detail {
class DepthwiseConv2DNhwcHwcmOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DepthwiseConv2DNhwcHwcmOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.depthwise_conv_2d_nhwc_hwcm", odsAttrs.getContext());
}
DepthwiseConv2DNhwcHwcmOpGenericAdaptorBase(DepthwiseConv2DNhwcHwcmOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DepthwiseConv2DNhwcHwcmOpGenericAdaptor : public detail::DepthwiseConv2DNhwcHwcmOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DepthwiseConv2DNhwcHwcmOpGenericAdaptorBase;
public:
DepthwiseConv2DNhwcHwcmOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DepthwiseConv2DNhwcHwcmOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DepthwiseConv2DNhwcHwcmOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DepthwiseConv2DNhwcHwcmOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DepthwiseConv2DNhwcHwcmOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DepthwiseConv2DNhwcHwcmOp, typename = std::enable_if_t<std::is_same_v<LateInst, DepthwiseConv2DNhwcHwcmOp>>>
DepthwiseConv2DNhwcHwcmOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DepthwiseConv2DNhwcHwcmOpAdaptor : public DepthwiseConv2DNhwcHwcmOpGenericAdaptor<::mlir::ValueRange> {
public:
using DepthwiseConv2DNhwcHwcmOpGenericAdaptor::DepthwiseConv2DNhwcHwcmOpGenericAdaptor;
DepthwiseConv2DNhwcHwcmOpAdaptor(DepthwiseConv2DNhwcHwcmOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DepthwiseConv2DNhwcHwcmOp : public ::mlir::Op<DepthwiseConv2DNhwcHwcmOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DepthwiseConv2DNhwcHwcmOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DepthwiseConv2DNhwcHwcmOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.depthwise_conv_2d_nhwc_hwcm");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DepthwiseConv2DNhwcHwcmOp)
namespace mlir {
namespace linalg {
namespace detail {
class DepthwiseConv2DNhwcHwcmQOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DepthwiseConv2DNhwcHwcmQOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.depthwise_conv_2d_nhwc_hwcm_q", odsAttrs.getContext());
}
DepthwiseConv2DNhwcHwcmQOpGenericAdaptorBase(DepthwiseConv2DNhwcHwcmQOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DepthwiseConv2DNhwcHwcmQOpGenericAdaptor : public detail::DepthwiseConv2DNhwcHwcmQOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DepthwiseConv2DNhwcHwcmQOpGenericAdaptorBase;
public:
DepthwiseConv2DNhwcHwcmQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DepthwiseConv2DNhwcHwcmQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DepthwiseConv2DNhwcHwcmQOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DepthwiseConv2DNhwcHwcmQOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DepthwiseConv2DNhwcHwcmQOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DepthwiseConv2DNhwcHwcmQOp, typename = std::enable_if_t<std::is_same_v<LateInst, DepthwiseConv2DNhwcHwcmQOp>>>
DepthwiseConv2DNhwcHwcmQOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DepthwiseConv2DNhwcHwcmQOpAdaptor : public DepthwiseConv2DNhwcHwcmQOpGenericAdaptor<::mlir::ValueRange> {
public:
using DepthwiseConv2DNhwcHwcmQOpGenericAdaptor::DepthwiseConv2DNhwcHwcmQOpGenericAdaptor;
DepthwiseConv2DNhwcHwcmQOpAdaptor(DepthwiseConv2DNhwcHwcmQOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DepthwiseConv2DNhwcHwcmQOp : public ::mlir::Op<DepthwiseConv2DNhwcHwcmQOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DepthwiseConv2DNhwcHwcmQOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DepthwiseConv2DNhwcHwcmQOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.depthwise_conv_2d_nhwc_hwcm_q");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DepthwiseConv2DNhwcHwcmQOp)
namespace mlir {
namespace linalg {
namespace detail {
class DepthwiseConv3DNcdhwCdhwOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DepthwiseConv3DNcdhwCdhwOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.depthwise_conv_3d_ncdhw_cdhw", odsAttrs.getContext());
}
DepthwiseConv3DNcdhwCdhwOpGenericAdaptorBase(DepthwiseConv3DNcdhwCdhwOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DepthwiseConv3DNcdhwCdhwOpGenericAdaptor : public detail::DepthwiseConv3DNcdhwCdhwOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DepthwiseConv3DNcdhwCdhwOpGenericAdaptorBase;
public:
DepthwiseConv3DNcdhwCdhwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DepthwiseConv3DNcdhwCdhwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DepthwiseConv3DNcdhwCdhwOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DepthwiseConv3DNcdhwCdhwOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DepthwiseConv3DNcdhwCdhwOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DepthwiseConv3DNcdhwCdhwOp, typename = std::enable_if_t<std::is_same_v<LateInst, DepthwiseConv3DNcdhwCdhwOp>>>
DepthwiseConv3DNcdhwCdhwOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DepthwiseConv3DNcdhwCdhwOpAdaptor : public DepthwiseConv3DNcdhwCdhwOpGenericAdaptor<::mlir::ValueRange> {
public:
using DepthwiseConv3DNcdhwCdhwOpGenericAdaptor::DepthwiseConv3DNcdhwCdhwOpGenericAdaptor;
DepthwiseConv3DNcdhwCdhwOpAdaptor(DepthwiseConv3DNcdhwCdhwOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DepthwiseConv3DNcdhwCdhwOp : public ::mlir::Op<DepthwiseConv3DNcdhwCdhwOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DepthwiseConv3DNcdhwCdhwOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DepthwiseConv3DNcdhwCdhwOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.depthwise_conv_3d_ncdhw_cdhw");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DepthwiseConv3DNcdhwCdhwOp)
namespace mlir {
namespace linalg {
namespace detail {
class DepthwiseConv3DNdhwcDhwcOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DepthwiseConv3DNdhwcDhwcOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.depthwise_conv_3d_ndhwc_dhwc", odsAttrs.getContext());
}
DepthwiseConv3DNdhwcDhwcOpGenericAdaptorBase(DepthwiseConv3DNdhwcDhwcOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DepthwiseConv3DNdhwcDhwcOpGenericAdaptor : public detail::DepthwiseConv3DNdhwcDhwcOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DepthwiseConv3DNdhwcDhwcOpGenericAdaptorBase;
public:
DepthwiseConv3DNdhwcDhwcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DepthwiseConv3DNdhwcDhwcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DepthwiseConv3DNdhwcDhwcOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DepthwiseConv3DNdhwcDhwcOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DepthwiseConv3DNdhwcDhwcOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DepthwiseConv3DNdhwcDhwcOp, typename = std::enable_if_t<std::is_same_v<LateInst, DepthwiseConv3DNdhwcDhwcOp>>>
DepthwiseConv3DNdhwcDhwcOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DepthwiseConv3DNdhwcDhwcOpAdaptor : public DepthwiseConv3DNdhwcDhwcOpGenericAdaptor<::mlir::ValueRange> {
public:
using DepthwiseConv3DNdhwcDhwcOpGenericAdaptor::DepthwiseConv3DNdhwcDhwcOpGenericAdaptor;
DepthwiseConv3DNdhwcDhwcOpAdaptor(DepthwiseConv3DNdhwcDhwcOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DepthwiseConv3DNdhwcDhwcOp : public ::mlir::Op<DepthwiseConv3DNdhwcDhwcOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DepthwiseConv3DNdhwcDhwcOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DepthwiseConv3DNdhwcDhwcOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.depthwise_conv_3d_ndhwc_dhwc");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DepthwiseConv3DNdhwcDhwcOp)
namespace mlir {
namespace linalg {
namespace detail {
class DepthwiseConv3DNdhwcDhwcmOpGenericAdaptorBase {
public:
struct Properties {
using dilationsTy = ::mlir::DenseIntElementsAttr;
dilationsTy dilations;
auto getDilations() {
auto &propStorage = this->dilations;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setDilations(const ::mlir::DenseIntElementsAttr &propValue) {
this->dilations = propValue;
}
using stridesTy = ::mlir::DenseIntElementsAttr;
stridesTy strides;
auto getStrides() {
auto &propStorage = this->strides;
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(propStorage);
}
void setStrides(const ::mlir::DenseIntElementsAttr &propValue) {
this->strides = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.dilations == this->dilations &&
rhs.strides == this->strides &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DepthwiseConv3DNdhwcDhwcmOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.depthwise_conv_3d_ndhwc_dhwcm", odsAttrs.getContext());
}
DepthwiseConv3DNdhwcDhwcmOpGenericAdaptorBase(DepthwiseConv3DNdhwcDhwcmOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::DenseIntElementsAttr getStridesAttr();
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr();
::mlir::DenseIntElementsAttr getDilations();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DepthwiseConv3DNdhwcDhwcmOpGenericAdaptor : public detail::DepthwiseConv3DNdhwcDhwcmOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DepthwiseConv3DNdhwcDhwcmOpGenericAdaptorBase;
public:
DepthwiseConv3DNdhwcDhwcmOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DepthwiseConv3DNdhwcDhwcmOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DepthwiseConv3DNdhwcDhwcmOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DepthwiseConv3DNdhwcDhwcmOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DepthwiseConv3DNdhwcDhwcmOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DepthwiseConv3DNdhwcDhwcmOp, typename = std::enable_if_t<std::is_same_v<LateInst, DepthwiseConv3DNdhwcDhwcmOp>>>
DepthwiseConv3DNdhwcDhwcmOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DepthwiseConv3DNdhwcDhwcmOpAdaptor : public DepthwiseConv3DNdhwcDhwcmOpGenericAdaptor<::mlir::ValueRange> {
public:
using DepthwiseConv3DNdhwcDhwcmOpGenericAdaptor::DepthwiseConv3DNdhwcDhwcmOpGenericAdaptor;
DepthwiseConv3DNdhwcDhwcmOpAdaptor(DepthwiseConv3DNdhwcDhwcmOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DepthwiseConv3DNdhwcDhwcmOp : public ::mlir::Op<DepthwiseConv3DNdhwcDhwcmOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ConvolutionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DepthwiseConv3DNdhwcDhwcmOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DepthwiseConv3DNdhwcDhwcmOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("dilations"), ::llvm::StringRef("strides"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getDilationsAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getDilationsAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getStridesAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getStridesAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.depthwise_conv_3d_ndhwc_dhwcm");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::DenseIntElementsAttr getStridesAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().strides);
}
::mlir::DenseIntElementsAttr getStrides();
::mlir::DenseIntElementsAttr getDilationsAttr() {
return ::llvm::dyn_cast_or_null<::mlir::DenseIntElementsAttr>(getProperties().dilations);
}
::mlir::DenseIntElementsAttr getDilations();
void setStridesAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().strides = attr;
}
void setDilationsAttr(::mlir::DenseIntElementsAttr attr) {
getProperties().dilations = attr;
}
::mlir::Attribute removeStridesAttr() {
auto &attr = getProperties().strides;
attr = {};
return attr;
}
::mlir::Attribute removeDilationsAttr() {
auto &attr = getProperties().dilations;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute strides, Attribute dilations, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
bool hasDynamicIndexingMaps();
LogicalResult verifyIndexingMapRequiredAttributes();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DepthwiseConv3DNdhwcDhwcmOp)
namespace mlir {
namespace linalg {
namespace detail {
class DivOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DivOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.div", odsAttrs.getContext());
}
DivOpGenericAdaptorBase(DivOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DivOpGenericAdaptor : public detail::DivOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DivOpGenericAdaptorBase;
public:
DivOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DivOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DivOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DivOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DivOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DivOp, typename = std::enable_if_t<std::is_same_v<LateInst, DivOp>>>
DivOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DivOpAdaptor : public DivOpGenericAdaptor<::mlir::ValueRange> {
public:
using DivOpGenericAdaptor::DivOpGenericAdaptor;
DivOpAdaptor(DivOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DivOp : public ::mlir::Op<DivOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DivOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DivOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.div");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DivOp)
namespace mlir {
namespace linalg {
namespace detail {
class DivUnsignedOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DivUnsignedOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.div_unsigned", odsAttrs.getContext());
}
DivUnsignedOpGenericAdaptorBase(DivUnsignedOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DivUnsignedOpGenericAdaptor : public detail::DivUnsignedOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DivUnsignedOpGenericAdaptorBase;
public:
DivUnsignedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DivUnsignedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DivUnsignedOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DivUnsignedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DivUnsignedOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DivUnsignedOp, typename = std::enable_if_t<std::is_same_v<LateInst, DivUnsignedOp>>>
DivUnsignedOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DivUnsignedOpAdaptor : public DivUnsignedOpGenericAdaptor<::mlir::ValueRange> {
public:
using DivUnsignedOpGenericAdaptor::DivUnsignedOpGenericAdaptor;
DivUnsignedOpAdaptor(DivUnsignedOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DivUnsignedOp : public ::mlir::Op<DivUnsignedOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DivUnsignedOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DivUnsignedOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.div_unsigned");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DivUnsignedOp)
namespace mlir {
namespace linalg {
namespace detail {
class DotOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
DotOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.dot", odsAttrs.getContext());
}
DotOpGenericAdaptorBase(DotOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class DotOpGenericAdaptor : public detail::DotOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::DotOpGenericAdaptorBase;
public:
DotOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
DotOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : DotOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
DotOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : DotOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = DotOp, typename = std::enable_if_t<std::is_same_v<LateInst, DotOp>>>
DotOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class DotOpAdaptor : public DotOpGenericAdaptor<::mlir::ValueRange> {
public:
using DotOpGenericAdaptor::DotOpGenericAdaptor;
DotOpAdaptor(DotOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class DotOp : public ::mlir::Op<DotOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait, ::mlir::linalg::ContractionOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = DotOpAdaptor;
template <typename RangeT>
using GenericAdaptor = DotOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.dot");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::DotOp)
namespace mlir {
namespace linalg {
namespace detail {
class ElemwiseBinaryOpGenericAdaptorBase {
public:
struct Properties {
using castTy = ::mlir::linalg::TypeFnAttr;
castTy cast;
auto getCast() {
auto &propStorage = this->cast;
return ::llvm::dyn_cast_or_null<::mlir::linalg::TypeFnAttr>(propStorage);
}
void setCast(const ::mlir::linalg::TypeFnAttr &propValue) {
this->cast = propValue;
}
using funTy = ::mlir::linalg::BinaryFnAttr;
funTy fun;
auto getFun() {
auto &propStorage = this->fun;
return ::llvm::dyn_cast_or_null<::mlir::linalg::BinaryFnAttr>(propStorage);
}
void setFun(const ::mlir::linalg::BinaryFnAttr &propValue) {
this->fun = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.cast == this->cast &&
rhs.fun == this->fun &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
ElemwiseBinaryOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.elemwise_binary", odsAttrs.getContext());
}
ElemwiseBinaryOpGenericAdaptorBase(ElemwiseBinaryOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::linalg::BinaryFnAttr getFunAttr();
::mlir::linalg::BinaryFn getFun();
::mlir::linalg::TypeFnAttr getCastAttr();
::mlir::linalg::TypeFn getCast();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class ElemwiseBinaryOpGenericAdaptor : public detail::ElemwiseBinaryOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::ElemwiseBinaryOpGenericAdaptorBase;
public:
ElemwiseBinaryOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
ElemwiseBinaryOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : ElemwiseBinaryOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
ElemwiseBinaryOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : ElemwiseBinaryOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = ElemwiseBinaryOp, typename = std::enable_if_t<std::is_same_v<LateInst, ElemwiseBinaryOp>>>
ElemwiseBinaryOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class ElemwiseBinaryOpAdaptor : public ElemwiseBinaryOpGenericAdaptor<::mlir::ValueRange> {
public:
using ElemwiseBinaryOpGenericAdaptor::ElemwiseBinaryOpGenericAdaptor;
ElemwiseBinaryOpAdaptor(ElemwiseBinaryOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class ElemwiseBinaryOp : public ::mlir::Op<ElemwiseBinaryOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = ElemwiseBinaryOpAdaptor;
template <typename RangeT>
using GenericAdaptor = ElemwiseBinaryOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("cast"), ::llvm::StringRef("fun"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getCastAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getCastAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getFunAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getFunAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.elemwise_binary");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::linalg::BinaryFnAttr getFunAttr() {
return ::llvm::dyn_cast_or_null<::mlir::linalg::BinaryFnAttr>(getProperties().fun);
}
::mlir::linalg::BinaryFn getFun();
::mlir::linalg::TypeFnAttr getCastAttr() {
return ::llvm::dyn_cast_or_null<::mlir::linalg::TypeFnAttr>(getProperties().cast);
}
::mlir::linalg::TypeFn getCast();
void setFunAttr(::mlir::linalg::BinaryFnAttr attr) {
getProperties().fun = attr;
}
void setFun(::std::optional<::mlir::linalg::BinaryFn> attrValue);
void setCastAttr(::mlir::linalg::TypeFnAttr attr) {
getProperties().cast = attr;
}
void setCast(::std::optional<::mlir::linalg::TypeFn> attrValue);
::mlir::Attribute removeFunAttr() {
auto &attr = getProperties().fun;
attr = {};
return attr;
}
::mlir::Attribute removeCastAttr() {
auto &attr = getProperties().cast;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute fun, Attribute cast, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::ElemwiseBinaryOp)
namespace mlir {
namespace linalg {
namespace detail {
class ElemwiseUnaryOpGenericAdaptorBase {
public:
struct Properties {
using castTy = ::mlir::linalg::TypeFnAttr;
castTy cast;
auto getCast() {
auto &propStorage = this->cast;
return ::llvm::dyn_cast_or_null<::mlir::linalg::TypeFnAttr>(propStorage);
}
void setCast(const ::mlir::linalg::TypeFnAttr &propValue) {
this->cast = propValue;
}
using funTy = ::mlir::linalg::UnaryFnAttr;
funTy fun;
auto getFun() {
auto &propStorage = this->fun;
return ::llvm::dyn_cast_or_null<::mlir::linalg::UnaryFnAttr>(propStorage);
}
void setFun(const ::mlir::linalg::UnaryFnAttr &propValue) {
this->fun = propValue;
}
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.cast == this->cast &&
rhs.fun == this->fun &&
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
ElemwiseUnaryOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.elemwise_unary", odsAttrs.getContext());
}
ElemwiseUnaryOpGenericAdaptorBase(ElemwiseUnaryOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::linalg::UnaryFnAttr getFunAttr();
::mlir::linalg::UnaryFn getFun();
::mlir::linalg::TypeFnAttr getCastAttr();
::mlir::linalg::TypeFn getCast();
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class ElemwiseUnaryOpGenericAdaptor : public detail::ElemwiseUnaryOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::ElemwiseUnaryOpGenericAdaptorBase;
public:
ElemwiseUnaryOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
ElemwiseUnaryOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : ElemwiseUnaryOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
ElemwiseUnaryOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : ElemwiseUnaryOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = ElemwiseUnaryOp, typename = std::enable_if_t<std::is_same_v<LateInst, ElemwiseUnaryOp>>>
ElemwiseUnaryOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class ElemwiseUnaryOpAdaptor : public ElemwiseUnaryOpGenericAdaptor<::mlir::ValueRange> {
public:
using ElemwiseUnaryOpGenericAdaptor::ElemwiseUnaryOpGenericAdaptor;
ElemwiseUnaryOpAdaptor(ElemwiseUnaryOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class ElemwiseUnaryOp : public ::mlir::Op<ElemwiseUnaryOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = ElemwiseUnaryOpAdaptor;
template <typename RangeT>
using GenericAdaptor = ElemwiseUnaryOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("cast"), ::llvm::StringRef("fun"), ::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getCastAttrName() {
return getAttributeNameForIndex(0);
}
static ::mlir::StringAttr getCastAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 0);
}
::mlir::StringAttr getFunAttrName() {
return getAttributeNameForIndex(1);
}
static ::mlir::StringAttr getFunAttrName(::mlir::OperationName name) {
return getAttributeNameForIndex(name, 1);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.elemwise_unary");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
::mlir::linalg::UnaryFnAttr getFunAttr() {
return ::llvm::dyn_cast_or_null<::mlir::linalg::UnaryFnAttr>(getProperties().fun);
}
::mlir::linalg::UnaryFn getFun();
::mlir::linalg::TypeFnAttr getCastAttr() {
return ::llvm::dyn_cast_or_null<::mlir::linalg::TypeFnAttr>(getProperties().cast);
}
::mlir::linalg::TypeFn getCast();
void setFunAttr(::mlir::linalg::UnaryFnAttr attr) {
getProperties().fun = attr;
}
void setFun(::std::optional<::mlir::linalg::UnaryFn> attrValue);
void setCastAttr(::mlir::linalg::TypeFnAttr attr) {
getProperties().cast = attr;
}
void setCast(::std::optional<::mlir::linalg::TypeFn> attrValue);
::mlir::Attribute removeFunAttr() {
auto &attr = getProperties().fun;
attr = {};
return attr;
}
::mlir::Attribute removeCastAttr() {
auto &attr = getProperties().cast;
attr = {};
return attr;
}
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, Attribute fun, Attribute cast, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
assert(index < 2 && "invalid attribute index");
assert(name.getStringRef() == getOperationName() && "invalid operation name");
assert(name.isRegistered() && "Operation isn't registered, missing a "
"dependent dialect loading?");
return name.getAttributeNames()[index];
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::ElemwiseUnaryOp)
namespace mlir {
namespace linalg {
namespace detail {
class ErfOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
ErfOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.erf", odsAttrs.getContext());
}
ErfOpGenericAdaptorBase(ErfOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class ErfOpGenericAdaptor : public detail::ErfOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::ErfOpGenericAdaptorBase;
public:
ErfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
ErfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : ErfOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
ErfOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : ErfOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = ErfOp, typename = std::enable_if_t<std::is_same_v<LateInst, ErfOp>>>
ErfOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class ErfOpAdaptor : public ErfOpGenericAdaptor<::mlir::ValueRange> {
public:
using ErfOpGenericAdaptor::ErfOpGenericAdaptor;
ErfOpAdaptor(ErfOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class ErfOp : public ::mlir::Op<ErfOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = ErfOpAdaptor;
template <typename RangeT>
using GenericAdaptor = ErfOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.erf");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::ErfOp)
namespace mlir {
namespace linalg {
namespace detail {
class ExpOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr odsAttrs;
::std::optional<::mlir::OperationName> odsOpName;
Properties properties;
::mlir::RegionRange odsRegions;
public:
ExpOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
odsOpName.emplace("linalg.exp", odsAttrs.getContext());
}
ExpOpGenericAdaptorBase(ExpOp op);
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
const Properties &getProperties() {
return properties;
}
::mlir::DictionaryAttr getAttributes() {
return odsAttrs;
}
::mlir::Region &getRegion() {
return *odsRegions[0];
}
::mlir::RegionRange getRegions() {
return odsRegions;
}
};
}
template <typename RangeT>
class ExpOpGenericAdaptor : public detail::ExpOpGenericAdaptorBase {
using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
using Base = detail::ExpOpGenericAdaptorBase;
public:
ExpOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
ExpOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : ExpOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
ExpOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : ExpOpGenericAdaptor(values, attrs, Properties{}, {}) {}
template <typename LateInst = ExpOp, typename = std::enable_if_t<std::is_same_v<LateInst, ExpOp>>>
ExpOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
return Base::getODSOperandIndexAndLength(index, odsOperands.size());
}
RangeT getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(odsOperands.begin(), valueRange.first),
std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
}
RangeT getInputs() {
return getODSOperands(0);
}
RangeT getOutputs() {
return getODSOperands(1);
}
RangeT getOperands() {
return odsOperands;
}
private:
RangeT odsOperands;
};
class ExpOpAdaptor : public ExpOpGenericAdaptor<::mlir::ValueRange> {
public:
using ExpOpGenericAdaptor::ExpOpGenericAdaptor;
ExpOpAdaptor(ExpOp op);
::llvm::LogicalResult verify(::mlir::Location loc);
};
class ExpOp : public ::mlir::Op<ExpOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::DestinationStyleOpInterface::Trait, ::mlir::linalg::LinalgOp::Trait, ::mlir::ReifyRankedShapedTypeOpInterface::Trait> {
public:
using Op::Op;
using Op::print;
using Adaptor = ExpOpAdaptor;
template <typename RangeT>
using GenericAdaptor = ExpOpGenericAdaptor<RangeT>;
using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>;
using Properties = FoldAdaptor::Properties;
static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes")};
return ::llvm::ArrayRef(attrNames);
}
::mlir::StringAttr getOperandSegmentSizesAttrName() {
return (*this)->getName().getAttributeNames().back();
}
static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
return name.getAttributeNames().back();
}
static constexpr ::llvm::StringLiteral getOperationName() {
return ::llvm::StringLiteral("linalg.exp");
}
std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
::mlir::Operation::operand_range getODSOperands(unsigned index) {
auto valueRange = getODSOperandIndexAndLength(index);
return {std::next(getOperation()->operand_begin(), valueRange.first),
std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::operand_range getInputs() {
return getODSOperands(0);
}
::mlir::Operation::operand_range getOutputs() {
return getODSOperands(1);
}
::mlir::MutableOperandRange getInputsMutable();
::mlir::MutableOperandRange getOutputsMutable();
std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
::mlir::Operation::result_range getODSResults(unsigned index) {
auto valueRange = getODSResultIndexAndLength(index);
return {std::next(getOperation()->result_begin(), valueRange.first),
std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
}
::mlir::Operation::result_range getResultTensors() {
return getODSResults(0);
}
::mlir::Region &getRegion() {
return (*this)->getRegion(0);
}
static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
static llvm::hash_code computePropertiesHash(const Properties &prop);
static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
void writeProperties(::mlir::DialectBytecodeWriter &writer);
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputs, ArrayRef<NamedAttribute> attributes = {});
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTensorTypes, ValueRange operands, ArrayRef<NamedAttribute> attributes = {});
static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
void print(::mlir::OpAsmPrinter &p);
::llvm::LogicalResult verifyInvariantsImpl();
::llvm::LogicalResult verifyInvariants();
::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results);
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
::mlir::Speculation::Speculatability getSpeculatability();
private:
::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
return getAttributeNameForIndex((*this)->getName(), index);
}
static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
return {};
}
public:
bool hasIndexSemantics() {
return !this->getBody()->getOps<IndexOp>().empty();
}
LogicalResult reifyResultShapes(OpBuilder &b,
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
reifiedReturnShapes);
}
SmallVector<utils::IteratorType> getIteratorTypesArray();
ArrayAttr getIndexingMaps();
static void regionBuilder(ImplicitLocOpBuilder &b,
Block &block, ArrayRef<NamedAttribute> attrs);
static std::function<void(ImplicitLocOpBuilder &,
Block &, ArrayRef<NamedAttribute>)>
getRegionBuilder() {
return regionBuilder;
}
::mlir::MutableOperandRange getDpsInitsMutable() {
return getOutputsMutable();
}
static unsigned getNumRegionArgs();
std::string getLibraryCallName();
};
}
}
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::ExpOp)
namespace mlir {
namespace linalg {
namespace detail {
class FillOpGenericAdaptorBase {
public:
struct Properties {
using operandSegmentSizesTy = std::array<int32_t, 2>;
operandSegmentSizesTy operandSegmentSizes;
::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
auto &propStorage = this->operandSegmentSizes;
return propStorage;
}
void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
auto &propStorage = this->operandSegmentSizes;
::llvm::copy(propValue, propStorage.begin());
}
bool operator==(const Properties &rhs) const {
return
rhs.operandSegmentSizes == this->operandSegmentSizes &&
true;
}
bool operator!=(const Properties &rhs) const {
return !(*this == rhs);
}
};
protected:
::mlir::DictionaryAttr#endif