mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
build: add options to build with CUDA support
This commit is contained in:
@@ -60,6 +60,9 @@ set_target_properties(Concrete PROPERTIES IMPORTED_LOCATION ${CONCRETE_FFI_RELEA
|
||||
#--------------------------------------------------------------------------------
|
||||
option(CONCRETELANG_CUDA_SUPPORT "Support Concrete CUDA Execution." OFF)
|
||||
if(CONCRETELANG_CUDA_SUPPORT)
|
||||
if (NOT DEFINED CONCRETE_CORE_PATH)
|
||||
message(FATAL_ERROR "Compiling with CUDA support requires setting CONCRETE_CORE_PATH")
|
||||
endif()
|
||||
message(STATUS "Building with Concrete CUDA execution support")
|
||||
include_directories(${CONCRETE_CORE_PATH}/concrete-cuda/cuda/include)
|
||||
add_library(ConcreteCUDA STATIC IMPORTED)
|
||||
|
||||
@@ -6,6 +6,8 @@ DATAFLOW_EXECUTION_ENABLED=OFF
|
||||
TIMING_ENABLED=OFF
|
||||
CC_COMPILER=
|
||||
CXX_COMPILER=
|
||||
CUDA_SUPPORT=OFF
|
||||
CONCRETE_CORE_PATH?=
|
||||
|
||||
CONCRETE_OPTIMIZER_DIR ?= $(shell pwd)/concrete-optimizer
|
||||
|
||||
@@ -59,6 +61,10 @@ else
|
||||
PYTHON_TESTS_MARKER="not parallel"
|
||||
endif
|
||||
|
||||
ifneq ($(CONCRETE_CORE_PATH),)
|
||||
CONCRETE_CORE_PATH_OPTION=-DCONCRETE_CORE_PATH=$(CONCRETE_CORE_PATH)
|
||||
endif
|
||||
|
||||
all: concretecompiler python-bindings build-tests build-benchmarks build-mlbench doc
|
||||
|
||||
# concrete-core-ffi #######################################
|
||||
@@ -121,7 +127,9 @@ $(BUILD_DIR)/configured.stamp:
|
||||
-DLLVM_EXTERNAL_PROJECTS=concretelang \
|
||||
-DLLVM_EXTERNAL_CONCRETELANG_SOURCE_DIR=. \
|
||||
-DPython3_EXECUTABLE=${Python3_EXECUTABLE} \
|
||||
-DCONCRETE_OPTIMIZER_DIR=${CONCRETE_OPTIMIZER_DIR}
|
||||
-DCONCRETE_OPTIMIZER_DIR=${CONCRETE_OPTIMIZER_DIR} \
|
||||
$(CONCRETE_CORE_PATH_OPTION) \
|
||||
-DCONCRETELANG_CUDA_SUPPORT=${CUDA_SUPPORT}
|
||||
touch $@
|
||||
|
||||
build-initialized: concrete-optimizer-lib concrete-core-ffi $(BUILD_DIR)/configured.stamp
|
||||
|
||||
@@ -23,7 +23,6 @@ if(CONCRETELANG_CUDA_SUPPORT)
|
||||
ConcretelangRuntime
|
||||
PRIVATE
|
||||
ConcreteCUDA
|
||||
-L/usr/local/cuda/lib64
|
||||
cudart
|
||||
)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user