75 lines
3.3 KiB
C++
75 lines
3.3 KiB
C++
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|
|
|* *|
|
|
|* Dialect Declarations *|
|
|
|* *|
|
|
|* Automatically generated file, do not edit! *|
|
|
|* From: LinalgOps.td *|
|
|
|* *|
|
|
\*===----------------------------------------------------------------------===*/
|
|
|
|
namespace mlir::linalg {
|
|
|
|
/// The `linalg` dialect groups together a set of types, operations and
|
|
/// transformations that are useful to implement a structured abstraction on
|
|
/// buffers and tensors. These abstractions are useful for transformations and
|
|
/// can lower to scalar load/store and other operations or to more general
|
|
/// library calls.
|
|
///
|
|
/// Additional [Linalg Dialect
|
|
/// Documentation](https://mlir.llvm.org/docs/Dialects/Linalg) and a
|
|
/// [Rationale
|
|
/// Document](https://mlir.llvm.org/docs/Rationale/RationaleLinalgDialect) are
|
|
/// are also available and should be read first before going in the details of
|
|
/// the op semantics.
|
|
class LinalgDialect : public ::mlir::Dialect {
|
|
explicit LinalgDialect(::mlir::MLIRContext *context);
|
|
|
|
void initialize();
|
|
friend class ::mlir::MLIRContext;
|
|
public:
|
|
~LinalgDialect() override;
|
|
static constexpr ::llvm::StringLiteral getDialectNamespace() {
|
|
return ::llvm::StringLiteral("linalg");
|
|
}
|
|
|
|
/// Parse an attribute registered to this dialect.
|
|
::mlir::Attribute parseAttribute(::mlir::DialectAsmParser &parser,
|
|
::mlir::Type type) const override;
|
|
|
|
/// Print an attribute registered to this dialect.
|
|
void printAttribute(::mlir::Attribute attr,
|
|
::mlir::DialectAsmPrinter &os) const override;
|
|
|
|
/// Register canonicalization patterns.
|
|
void getCanonicalizationPatterns(
|
|
::mlir::RewritePatternSet &results) const override;
|
|
|
|
/// Materialize a single constant operation from a given attribute value with
|
|
/// the desired resultant type.
|
|
::mlir::Operation *materializeConstant(::mlir::OpBuilder &builder,
|
|
::mlir::Attribute value,
|
|
::mlir::Type type,
|
|
::mlir::Location loc) override;
|
|
|
|
/// Provides a hook for verifying dialect attributes attached to the given
|
|
/// op.
|
|
::llvm::LogicalResult verifyOperationAttribute(
|
|
::mlir::Operation *op, ::mlir::NamedAttribute attribute) override;
|
|
|
|
/// Attribute name used to memoize indexing maps for named ops.
|
|
constexpr const static ::llvm::StringLiteral
|
|
kMemoizedIndexingMapsAttrName = "linalg.memoized_indexing_maps";
|
|
|
|
using RegionBuilderFunType = llvm::function_ref<
|
|
void(ImplicitLocOpBuilder &b, Block &, ArrayRef<NamedAttribute>,
|
|
function_ref<InFlightDiagnostic()>)>;
|
|
RegionBuilderFunType getRegionBuilder(StringRef name) {
|
|
return namedStructuredOpRegionBuilders.lookup(name);
|
|
}
|
|
private:
|
|
llvm::StringMap<RegionBuilderFunType> namedStructuredOpRegionBuilders;
|
|
};
|
|
|
|
} // namespace mlir::linalg
|
|
MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::linalg::LinalgDialect)
|