add PIM accelerator

This commit is contained in:
NiccoloN
2026-02-24 15:09:18 +01:00
parent b24a0df8d7
commit a6e928bdd7
67 changed files with 9109 additions and 1 deletions

View File

@@ -0,0 +1,37 @@
#include "mlir/Pass/Pass.h"
#include "src/Compiler/CompilerUtils.hpp"
using namespace mlir;
namespace onnx_mlir {
namespace {
struct MessagePass : public PassWrapper<MessagePass, OperationPass<ModuleOp>> {
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(MessagePass)
StringRef getArgument() const override { return "message-pass"; }
StringRef getDescription() const override {
return "Lower ONNX ops to Spatial ops.";
}
// Make sure that we have a valid default constructor and copy
// constructor to make sure that the options are initialized properly.
MessagePass(std::string message) : message(message) {}
MessagePass(const MessagePass &pass)
: PassWrapper<MessagePass, OperationPass<ModuleOp>>() {}
void runOnOperation() final { showCompilePhase(message); }
private:
std::string message;
};
} // namespace
std::unique_ptr<Pass> createMessagePass(std::string message) {
return std::make_unique<MessagePass>(message);
}
} // namespace onnx_mlir