mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
feat: setup init/termination of parallel execution in python
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "concretelang-c/Support/CompilerEngine.h"
|
||||
#include "concretelang/ClientLib/KeySetCache.h"
|
||||
#include "concretelang/Runtime/runtime_api.h"
|
||||
#include "concretelang/Support/CompilerEngine.h"
|
||||
#include "concretelang/Support/Jit.h"
|
||||
#include "concretelang/Support/JitCompilerEngine.h"
|
||||
@@ -47,6 +48,24 @@ buildLambda(const char *module, const char *funcName,
|
||||
return std::move(*lambdaOrErr);
|
||||
}
|
||||
|
||||
void initParallelization() {
|
||||
#ifdef CONCRETELANG_PARALLEL_EXECUTION_ENABLED
|
||||
_dfr_pre_main();
|
||||
#else
|
||||
throw std::runtime_error(
|
||||
"This package was built without parallelization support");
|
||||
#endif
|
||||
}
|
||||
|
||||
void terminateParallelization() {
|
||||
#ifdef CONCRETELANG_PARALLEL_EXECUTION_ENABLED
|
||||
_dfr_post_main();
|
||||
#else
|
||||
throw std::runtime_error(
|
||||
"This package was built without parallelization support");
|
||||
#endif
|
||||
}
|
||||
|
||||
lambdaArgument invokeLambda(lambda l, executionArguments args) {
|
||||
mlir::concretelang::JitCompilerEngine::Lambda *lambda_ptr =
|
||||
(mlir::concretelang::JitCompilerEngine::Lambda *)l.ptr;
|
||||
|
||||
Reference in New Issue
Block a user