feat: support parallelization in python

This commit is contained in:
youben11
2022-03-09 14:35:05 +01:00
committed by Ayoub Benaissa
parent 14faa4c7df
commit 5b37ec640c
6 changed files with 115 additions and 18 deletions

View File

@@ -15,13 +15,19 @@ using mlir::concretelang::JitCompilerEngine;
mlir::concretelang::JitCompilerEngine::Lambda
buildLambda(const char *module, const char *funcName,
const char *runtimeLibPath, const char *keySetCachePath) {
const char *runtimeLibPath, const char *keySetCachePath,
bool autoParallelize, bool loopParallelize, bool dfParallelize) {
// Set the runtime library path if not nullptr
llvm::Optional<llvm::StringRef> runtimeLibPathOptional = {};
if (runtimeLibPath != nullptr)
runtimeLibPathOptional = runtimeLibPath;
mlir::concretelang::JitCompilerEngine engine;
// Set parallelization flags
engine.setAutoParallelize(autoParallelize);
engine.setLoopParallelize(loopParallelize);
engine.setDataflowParallelize(dfParallelize);
using KeySetCache = mlir::concretelang::KeySetCache;
using optKeySetCache = llvm::Optional<mlir::concretelang::KeySetCache>;
auto cacheOpt = optKeySetCache();