Skip to content

Commit

Permalink
Refactor TorchToTosa with separate construction of legal/illegal ops …
Browse files Browse the repository at this point in the history
…and conversion patterns.
  • Loading branch information
sahas3 committed Oct 8, 2024
1 parent 614fcdd commit 49199da
Show file tree
Hide file tree
Showing 2 changed files with 210 additions and 190 deletions.
13 changes: 12 additions & 1 deletion include/torch-mlir/Conversion/TorchToTosa/TorchToTosa.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,23 @@

#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
#include <memory>

namespace mlir {
namespace torch {

/// Collect a set of legal/illegal ops for converting Torch operations to Tosa
/// dialect.
void populateTorchToTosaConversionLegalOps(ConversionTarget &target);
void populateTorchToTosaConversionIllegalOps(ConversionTarget &target);

/// Collect a set of patterns to convert Torch operations to Tosa dialect.
void populateTorchToTosaConversionPatterns(TypeConverter &typeConverter,
RewritePatternSet &patterns);

std::unique_ptr<OperationPass<func::FuncOp>> createConvertTorchToTosaPass();
}
} // namespace torch
} // namespace mlir

#endif // TORCHMLIR_CONVERSION_TORCHTOTOSA_TORCHTOTOSA_H
Loading

0 comments on commit 49199da

Please sign in to comment.