mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
feat(test): allow selecting loop/dataflow parallelism independently in tests and enable loop parallelism selection by default.
This commit is contained in:
@@ -17,6 +17,7 @@ target_link_libraries(
|
||||
testlib_unit_test
|
||||
ConcretelangRuntime
|
||||
ConcretelangSupport
|
||||
DFRuntime
|
||||
gtest_main
|
||||
)
|
||||
|
||||
|
||||
@@ -131,17 +131,25 @@ inline llvm::Expected<
|
||||
mlir::concretelang::ClientServer<mlir::concretelang::JitLambdaSupport>>
|
||||
internalCheckedJit(llvm::StringRef src, llvm::StringRef func = "main",
|
||||
bool useDefaultFHEConstraints = false,
|
||||
bool autoParallelize = false) {
|
||||
bool dataflowParallelize = false,
|
||||
bool loopParallelize = false) {
|
||||
|
||||
auto options =
|
||||
mlir::concretelang::CompilationOptions(std::string(func.data()));
|
||||
if (useDefaultFHEConstraints)
|
||||
options.v0FHEConstraints = defaultV0Constraints;
|
||||
|
||||
// Allow loop parallelism in all cases
|
||||
options.loopParallelize = loopParallelize;
|
||||
#ifdef CONCRETELANG_PARALLEL_EXECUTION_ENABLED
|
||||
#ifdef CONCRETELANG_PARALLEL_TESTING_ENABLED
|
||||
options.autoParallelize = true;
|
||||
options.dataflowParallelize = true;
|
||||
options.loopParallelize = true;
|
||||
#else
|
||||
options.autoParallelize = autoParallelize;
|
||||
options.dataflowParallelize = dataflowParallelize;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
auto lambdaOrErr =
|
||||
mlir::concretelang::ClientServer<mlir::concretelang::JitLambdaSupport>::
|
||||
create(src, options, getTestKeySetCache(),
|
||||
|
||||
Reference in New Issue
Block a user