28 #define GEN_PASS_DEF_TOSATOLINALGNAMED
29 #include "mlir/Conversion/Passes.h.inc"
35 struct TosaToLinalgNamed
36 :
public impl::TosaToLinalgNamedBase<TosaToLinalgNamed> {
38 TosaToLinalgNamed(
const TosaToLinalgNamedOptions &
options)
39 : impl::TosaToLinalgNamedBase<TosaToLinalgNamed>(
options) {}
43 .
insert<arith::ArithDialect, linalg::LinalgDialect, math::MathDialect,
44 tensor::TensorDialect, scf::SCFDialect>();
47 void runOnOperation()
override {
54 tensor::TensorDialect, scf::SCFDialect>();
67 FunctionOpInterface func = getOperation();
68 TosaToLinalgNamedOptions
options;
69 options.preferConv2DKernelLayoutHWCF = preferConv2DKernelLayoutHWCF;
80 return std::make_unique<TosaToLinalgNamed>(
options);
static MLIRContext * getContext(OpFoldResult val)
static llvm::ManagedStatic< PassManagerOptions > options
This class describes a specific conversion target.
void addLegalDialect(StringRef name, Names... names)
Register the operations of the given dialects as legal.
void markUnknownOpDynamicallyLegal(const DynamicLegalityCallbackFn &fn)
Register unknown operations as dynamically legal.
void addIllegalOp(OperationName op)
Register the given operation as illegal, i.e.
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
Operation is the basic unit of execution within MLIR.
std::unique_ptr< Pass > createTosaToLinalgNamed(const TosaToLinalgNamedOptions &options=TosaToLinalgNamedOptions())
void populateTosaTypeConversion(TypeConverter &converter)
void populateTosaToLinalgNamedConversionPatterns(const TypeConverter &converter, RewritePatternSet *patterns, const TosaToLinalgNamedOptions &options)
Populates conversion passes from TOSA dialect to Linalg named operations.
Include the generated interface declarations.
LogicalResult applyFullConversion(ArrayRef< Operation * > ops, const ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
Apply a complete conversion on the given operations, and all nested operations.
const FrozenRewritePatternSet & patterns