add host core pim codegen

This commit is contained in:
NiccoloN
2026-02-26 17:53:25 +01:00
parent f007b6e574
commit 8bb5385961
2 changed files with 10 additions and 1 deletions

View File

@@ -494,6 +494,15 @@ OnnxMlirCompilerErrorCodes compileModuleToPIMJSON(ModuleOp& moduleOp, std::strin
memoryFileStream.write(memoryBuffer.data(), memoryBuffer.size());
memoryFileStream.close();
auto outputHostCorePath = outputDirPath + "/core_0.json";
llvm::raw_fd_ostream hostFileStream(outputHostCorePath, errorCode);
if (errorCode) {
llvm::errs() << "Error while opening host core file `" << outputHostCorePath << "`: " << errorCode.message() << '\n';
return InvalidOutputFileAccess;
}
hostFileStream << "[]";
hostFileStream.close();
size_t coreCount = 0;
for (auto coreOp : funcOp.getOps<pim::PimCoreOp>()) {
auto coreId = coreOp.getCoreId();

View File

@@ -25,7 +25,7 @@ namespace onnx_mlir {
namespace pim {
void SpatialToPIMPass::runOnOperation() {
coreId = 0;
coreId = 1;
ModuleOp moduleOp = getOperation();
MLIRContext* ctx = moduleOp.getContext();