mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 12:15:09 -05:00
feat(runtime): enable parallel execution for TestLib when available.
This commit is contained in:
@@ -20,6 +20,12 @@ void compile_and_run(EndToEndDesc desc, LambdaSupport support) {
|
||||
options.v0Parameter = *desc.v0Parameter;
|
||||
}
|
||||
|
||||
/* 0 - Enable parallel testing where required */
|
||||
#ifdef CONCRETELANG_PARALLEL_TESTING_ENABLED
|
||||
options.dataflowParallelize = true;
|
||||
options.loopParallelize = true;
|
||||
#endif
|
||||
|
||||
/* 1 - Compile the program */
|
||||
auto compilationResult = support.compile(desc.program, options);
|
||||
ASSERT_EXPECTED_SUCCESS(compilationResult);
|
||||
|
||||
@@ -16,6 +16,12 @@ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CONCRETELANG_PARALLEL_EXECUTION_ENABLED)
|
||||
add_compile_options(
|
||||
-DCONCRETELANG_PARALLEL_TESTING_ENABLED
|
||||
)
|
||||
endif()
|
||||
|
||||
add_concretecompiler_lib_test(
|
||||
unit_tests_concretelang_testlib
|
||||
testlib_unit_test.cpp
|
||||
|
||||
@@ -40,6 +40,9 @@ compile(std::string outputLib, std::string source,
|
||||
mlir::concretelang::CompilationContext::createShared();
|
||||
mlir::concretelang::CompilerEngine ce{ccx};
|
||||
mlir::concretelang::CompilationOptions options(funcname);
|
||||
#ifdef CONCRETELANG_PARALLEL_TESTING_ENABLED
|
||||
options.autoParallelize = true;
|
||||
#endif
|
||||
ce.setCompilationOptions(options);
|
||||
auto result = ce.compile(sources, outputLib);
|
||||
if (!result) {
|
||||
|
||||
Reference in New Issue
Block a user