mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
fix: CMake dependencies
define CONCRETELANG_PARALLEL_EXECUTION_ENABLED at toplevel and prevent RuntimeContext copy constructors from passing engines map.
This commit is contained in:
@@ -105,6 +105,7 @@ if(CONCRETELANG_PARALLEL_EXECUTION_ENABLED)
|
||||
find_package(HPX REQUIRED CONFIG)
|
||||
include_directories(SYSTEM ${HPX_INCLUDE_DIRS})
|
||||
list(APPEND CMAKE_MODULE_PATH "${HPX_CMAKE_DIR}")
|
||||
add_compile_options(-DCONCRETELANG_PARALLEL_EXECUTION_ENABLED)
|
||||
|
||||
else()
|
||||
message(STATUS "ConcreteLang parallel execution disabled.")
|
||||
|
||||
@@ -30,6 +30,23 @@ typedef struct RuntimeContext {
|
||||
RuntimeContext()
|
||||
#ifndef CONCRETELANG_PARALLEL_EXECUTION_ENABLED
|
||||
: engine(nullptr)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
// Ensure that the engines map is not copied
|
||||
RuntimeContext(const RuntimeContext &ctx)
|
||||
: ksk(ctx.ksk), bsk(ctx.bsk)
|
||||
#ifndef CONCRETELANG_PARALLEL_EXECUTION_ENABLED
|
||||
,
|
||||
engine(nullptr)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
RuntimeContext(const RuntimeContext &&other)
|
||||
: ksk(other.ksk), bsk(other.bsk)
|
||||
#ifndef CONCRETELANG_PARALLEL_EXECUTION_ENABLED
|
||||
,
|
||||
engine(nullptr)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
@@ -43,6 +60,15 @@ typedef struct RuntimeContext {
|
||||
free_engine(engine);
|
||||
#endif
|
||||
}
|
||||
|
||||
RuntimeContext &operator=(const RuntimeContext &rhs) {
|
||||
ksk = rhs.ksk;
|
||||
bsk = rhs.bsk;
|
||||
#ifndef CONCRETELANG_PARALLEL_EXECUTION_ENABLED
|
||||
engine = nullptr;
|
||||
#endif
|
||||
return *this;
|
||||
}
|
||||
} RuntimeContext;
|
||||
|
||||
} // namespace concretelang
|
||||
|
||||
@@ -26,4 +26,5 @@ add_mlir_library(
|
||||
ConcretelangCommon
|
||||
ConcretelangRuntime
|
||||
ConcretelangSupportLib
|
||||
)
|
||||
Concrete
|
||||
)
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
if(CONCRETELANG_PARALLEL_EXECUTION_ENABLED)
|
||||
add_compile_options(-DCONCRETELANG_PARALLEL_EXECUTION_ENABLED)
|
||||
endif()
|
||||
|
||||
add_library(ConcretelangRuntime SHARED
|
||||
context.cpp
|
||||
wrappers.cpp
|
||||
|
||||
@@ -23,5 +23,12 @@ target_link_libraries(
|
||||
gtest_main
|
||||
)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
target_link_libraries(
|
||||
testlib_unit_test
|
||||
Concrete
|
||||
)
|
||||
endif()
|
||||
|
||||
include(GoogleTest)
|
||||
gtest_discover_tests(testlib_unit_test)
|
||||
|
||||
@@ -111,6 +111,40 @@ target_link_libraries(
|
||||
ConcretelangSupport
|
||||
)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
target_link_libraries(
|
||||
end_to_end_jit_test
|
||||
Concrete
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
end_to_end_jit_clear_tensor
|
||||
Concrete
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
end_to_end_jit_encrypted_tensor
|
||||
Concrete
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
end_to_end_jit_fhe
|
||||
Concrete
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
end_to_end_jit_fhelinalg
|
||||
Concrete
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
end_to_end_jit_lambda
|
||||
Concrete
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
include(GoogleTest)
|
||||
gtest_discover_tests(end_to_end_jit_test)
|
||||
gtest_discover_tests(end_to_end_jit_clear_tensor)
|
||||
|
||||
Reference in New Issue
Block a user