add host core pim codegen
This commit is contained in:
@@ -494,6 +494,15 @@ OnnxMlirCompilerErrorCodes compileModuleToPIMJSON(ModuleOp& moduleOp, std::strin
|
|||||||
memoryFileStream.write(memoryBuffer.data(), memoryBuffer.size());
|
memoryFileStream.write(memoryBuffer.data(), memoryBuffer.size());
|
||||||
memoryFileStream.close();
|
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;
|
size_t coreCount = 0;
|
||||||
for (auto coreOp : funcOp.getOps<pim::PimCoreOp>()) {
|
for (auto coreOp : funcOp.getOps<pim::PimCoreOp>()) {
|
||||||
auto coreId = coreOp.getCoreId();
|
auto coreId = coreOp.getCoreId();
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace onnx_mlir {
|
|||||||
namespace pim {
|
namespace pim {
|
||||||
|
|
||||||
void SpatialToPIMPass::runOnOperation() {
|
void SpatialToPIMPass::runOnOperation() {
|
||||||
coreId = 0;
|
coreId = 1;
|
||||||
ModuleOp moduleOp = getOperation();
|
ModuleOp moduleOp = getOperation();
|
||||||
MLIRContext* ctx = moduleOp.getContext();
|
MLIRContext* ctx = moduleOp.getContext();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user