forked from Alisah-Ozcan/HEonGPU
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
executable file
·37 lines (32 loc) · 1.41 KB
/
CMakeLists.txt
File metadata and controls
executable file
·37 lines (32 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Copyright 2024-2026 Alişah Özcan
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
# Developer: Alişah Özcan
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BINARY_LOCATION}/examples/mpc)
set(EXECUTABLES
1_multiparty_computation_bfv 1_multiparty_computation_bfv.cpp
2_multiparty_computation_ckks 2_multiparty_computation_ckks.cpp
3_mpc_collective_bootstrapping_bfv 3_mpc_collective_bootstrapping_bfv.cpp
4_mpc_collective_bootstrapping_ckks 4_mpc_collective_bootstrapping_ckks.cpp
)
function(add_example exe source)
add_executable(${exe} ${source})
target_link_libraries(${exe} PRIVATE heongpu CUDA::cudart OpenMP::OpenMP_CXX)
target_compile_options(${exe} PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-fopenmp>)
set_target_properties(${exe} PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
POSITION_INDEPENDENT_CODE ON
CUDA_RUNTIME_LIBRARY Static
CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}"
)
endfunction()
list(LENGTH EXECUTABLES EXECUTABLES_LENGTH)
math(EXPR EXECUTABLES_COUNT "${EXECUTABLES_LENGTH} / 2")
math(EXPR EXECUTABLES_COUNT_LOOP "${EXECUTABLES_COUNT} - 1")
foreach(i RANGE 0 ${EXECUTABLES_COUNT_LOOP})
math(EXPR index1 "${i} * 2")
math(EXPR index2 "${i} * 2 + 1")
list(GET EXECUTABLES ${index1} exe)
list(GET EXECUTABLES ${index2} source)
add_example(${exe} ${source})
endforeach()