mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 12:15:09 -05:00
fix(tests): Define defaultV0Constraints in a single place
The variable `defaultV0Constraints` is defined in multiple source files for unit test, but missing in other tests. Put a single, extern declaration in `globals.h` and the definition in `globals.cc`.
This commit is contained in:
@@ -5,21 +5,25 @@ include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
add_executable(
|
||||
end_to_end_jit_test
|
||||
end_to_end_jit_test.cc
|
||||
globals.cc
|
||||
)
|
||||
|
||||
add_executable(
|
||||
end_to_end_jit_clear_tensor
|
||||
end_to_end_jit_clear_tensor.cc
|
||||
globals.cc
|
||||
)
|
||||
|
||||
add_executable(
|
||||
end_to_end_jit_encrypted_tensor
|
||||
end_to_end_jit_encrypted_tensor.cc
|
||||
globals.cc
|
||||
)
|
||||
|
||||
add_executable(
|
||||
end_to_end_jit_hlfhelinalg
|
||||
end_to_end_jit_hlfhelinalg.cc
|
||||
globals.cc
|
||||
)
|
||||
|
||||
set_source_files_properties(
|
||||
@@ -27,6 +31,7 @@ set_source_files_properties(
|
||||
end_to_end_jit_clear_tensor.cc
|
||||
end_to_end_jit_encrypted_tensor.cc
|
||||
end_to_end_jit_hlfhelinalg.cc
|
||||
globals.cc
|
||||
|
||||
PROPERTIES COMPILE_FLAGS "-fno-rtti"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "end_to_end_jit_test.h"
|
||||
|
||||
const mlir::zamalang::V0FHEConstraint defaultV0Constraints{10, 7};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// 1D tensor //////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
#include "end_to_end_jit_test.h"
|
||||
|
||||
const mlir::zamalang::V0FHEConstraint defaultV0Constraints{10, 7};
|
||||
|
||||
TEST(CompileAndRunHLFHE, add_eint) {
|
||||
mlir::zamalang::JitCompilerEngine::Lambda lambda = checkedJit(R"XXX(
|
||||
func @main(%arg0: !HLFHE.eint<7>, %arg1: !HLFHE.eint<7>) -> !HLFHE.eint<7> {
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
#include "zamalang/Support/CompilerEngine.h"
|
||||
#include "zamalang/Support/JitCompilerEngine.h"
|
||||
|
||||
extern const mlir::zamalang::V0FHEConstraint defaultV0Constraints;
|
||||
#include "globals.h"
|
||||
|
||||
#define ASSERT_LLVM_ERROR(err) \
|
||||
if (err) { \
|
||||
|
||||
3
compiler/tests/unittest/globals.cc
Normal file
3
compiler/tests/unittest/globals.cc
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "globals.h"
|
||||
|
||||
const mlir::zamalang::V0FHEConstraint defaultV0Constraints{10, 7};
|
||||
3
compiler/tests/unittest/globals.h
Normal file
3
compiler/tests/unittest/globals.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#include <zamalang/Conversion/Utils/GlobalFHEContext.h>
|
||||
|
||||
extern const mlir::zamalang::V0FHEConstraint defaultV0Constraints;
|
||||
Reference in New Issue
Block a user