fix output paths
add gemm test
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#include "mlir/Pass/Pass.h"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include "Compiler/PimCompilerOptions.hpp"
|
||||
#include "Common/PIMCommon.hpp"
|
||||
#include "Compiler/PimCompilerUtils.hpp"
|
||||
|
||||
using namespace mlir;
|
||||
@@ -19,20 +17,13 @@ struct EmitPimJsonPass : PassWrapper<EmitPimJsonPass, OperationPass<ModuleOp>> {
|
||||
EmitPimJsonPass() {}
|
||||
EmitPimJsonPass(const EmitPimJsonPass& pass) {}
|
||||
|
||||
void runOnOperation() final {
|
||||
void runOnOperation() override {
|
||||
ModuleOp moduleOp = getOperation();
|
||||
|
||||
std::filesystem::path pimDir(pimOutputDir.data());
|
||||
std::string pimDir = getOutputDir() + "/pim";
|
||||
createDirectory(pimDir);
|
||||
|
||||
std::error_code error_code;
|
||||
std::filesystem::create_directories(pimDir, error_code);
|
||||
if (error_code) {
|
||||
moduleOp.emitError("Failed to create PIM output directory: " + error_code.message());
|
||||
signalPassFailure();
|
||||
return;
|
||||
}
|
||||
|
||||
int compiler_error_code = compileModuleToPIMJSON(moduleOp, pimOutputDir);
|
||||
int compiler_error_code = compileModuleToPIMJSON(moduleOp, pimDir);
|
||||
if (compiler_error_code != CompilerSuccess)
|
||||
signalPassFailure();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "mlir/Pass/Pass.h"
|
||||
|
||||
#include "src/Compiler/CompilerUtils.hpp"
|
||||
|
||||
using namespace mlir;
|
||||
@@ -7,21 +8,15 @@ namespace onnx_mlir {
|
||||
|
||||
namespace {
|
||||
|
||||
struct MessagePass : public PassWrapper<MessagePass, OperationPass<ModuleOp>> {
|
||||
|
||||
struct MessagePass : PassWrapper<MessagePass, OperationPass<ModuleOp>> {
|
||||
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(MessagePass)
|
||||
|
||||
StringRef getArgument() const override { return "message-pass"; }
|
||||
StringRef getDescription() const override { return "Print compilation status"; }
|
||||
|
||||
StringRef getDescription() const override {
|
||||
return "Lower ONNX ops to Spatial ops.";
|
||||
}
|
||||
MessagePass(std::string message)
|
||||
: message(message) {}
|
||||
MessagePass(const MessagePass& pass) {}
|
||||
|
||||
// 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:
|
||||
@@ -30,8 +25,6 @@ private:
|
||||
|
||||
} // namespace
|
||||
|
||||
std::unique_ptr<Pass> createMessagePass(std::string message) {
|
||||
return std::make_unique<MessagePass>(message);
|
||||
}
|
||||
std::unique_ptr<Pass> createMessagePass(std::string message) { return std::make_unique<MessagePass>(message); }
|
||||
|
||||
} // namespace onnx_mlir
|
||||
} // namespace onnx_mlir
|
||||
|
||||
Reference in New Issue
Block a user