-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into MSM--acceleration
- Loading branch information
Showing
32 changed files
with
341 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,11 +55,13 @@ endif() | |
set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
|
||
# Build options | ||
option(BUILD_TESTS "Build unit tests. Default=OFF" OFF) | ||
option(BUILD_TESTS "Build unit test2s. Default=OFF" OFF) | ||
# Backends: typically CPU is built into the frontend, the rest are DSOs loaded at runtime from installation | ||
option(CPU_BACKEND "Build CPU backend. Default=ON" ON) | ||
# TODO Yuval: consider decoupling backends from frontend build. Is that worth the effort? | ||
# To enable building backends, use the following options: (note they are in private repos) | ||
option(CUDA_BACKEND "Branch/commit to pull for CUDA backend or `local` if under icicle/backend/cuda. Default=OFF" OFF) | ||
option(METAL_BACKEND "Branch/commit to pull for METAL backend or `local` if under icicle/backend/metal. Default=OFF" OFF) | ||
option(VULKAN_BACKEND "Branch/commit to pull for VULKAN backend or `local` if under icicle/backend/vulkan. Default=OFF" OFF) | ||
|
||
# features that some fields/curves have and some don't. | ||
option(NTT "Build NTT" ON) | ||
|
@@ -130,55 +132,8 @@ if (CPU_BACKEND) | |
add_subdirectory(backend/cpu) | ||
endif() | ||
|
||
if (CUDA_BACKEND) | ||
string(TOLOWER "${CUDA_BACKEND}" CUDA_BACKEND_LOWER) | ||
if (CUDA_BACKEND_LOWER STREQUAL "local") | ||
# CUDA backend is local, no need to pull | ||
message(STATUS "Adding CUDA backend from local path: icicle/backend/cuda") | ||
add_subdirectory(backend/cuda) | ||
|
||
# Set the compile definition for the backend build directory | ||
add_compile_definitions(BACKEND_BUILD_DIR="${CMAKE_BINARY_DIR}/backend") | ||
else() | ||
set(CUDA_BACKEND_URL "[email protected]:ingonyama-zk/icicle-cuda-backend.git") | ||
|
||
include(FetchContent) | ||
message(STATUS "Fetching cuda backend from ${CUDA_BACKEND_URL}:${CUDA_BACKEND}") | ||
FetchContent_Declare( | ||
cuda_backend | ||
GIT_REPOSITORY ${CUDA_BACKEND_URL} | ||
GIT_TAG ${CUDA_BACKEND} | ||
) | ||
FetchContent_MakeAvailable(cuda_backend) | ||
# Set the compile definition for the backend build directory | ||
add_compile_definitions(BACKEND_BUILD_DIR="${CMAKE_BINARY_DIR}/_deps/cuda_backend-build") | ||
endif() | ||
endif() | ||
|
||
if (METAL_BACKEND) | ||
string(TOLOWER "${METAL_BACKEND}" METAL_BACKEND_LOWER) | ||
if (METAL_BACKEND_LOWER STREQUAL "local") | ||
# METAL backend is local, no need to pull | ||
message(STATUS "Adding Metal backend from local path: icicle/backend/metal") | ||
add_subdirectory(backend/metal) | ||
|
||
# Set the compile definition for the backend build directory | ||
add_compile_definitions(BACKEND_BUILD_DIR="${CMAKE_BINARY_DIR}/backend") | ||
else() | ||
set(METAL_BACKEND_URL "[email protected]:ingonyama-zk/icicle-metal-backend.git") | ||
|
||
include(FetchContent) | ||
message(STATUS "Fetching cuda backend from ${METAL_BACKEND_URL}:${METAL_BACKEND}") | ||
FetchContent_Declare( | ||
metal_backend | ||
GIT_REPOSITORY ${METAL_BACKEND_URL} | ||
GIT_TAG ${METAL_BACKEND} | ||
) | ||
FetchContent_MakeAvailable(metal_backend) | ||
# Set the compile definition for the backend build directory | ||
add_compile_definitions(BACKEND_BUILD_DIR="${CMAKE_BINARY_DIR}/_deps/metal_backend-build") | ||
endif() | ||
endif() | ||
# Include and configure (for build) backends based on the backend options | ||
include(cmake/backend_include.cmake) | ||
|
||
if (BUILD_TESTS) | ||
add_subdirectory(tests) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
if (CUDA_BACKEND) | ||
string(TOLOWER "${CUDA_BACKEND}" CUDA_BACKEND_LOWER) | ||
if (CUDA_BACKEND_LOWER STREQUAL "local") | ||
# CUDA backend is local, no need to pull | ||
message(STATUS "Adding CUDA backend from local path: icicle/backend/cuda") | ||
add_subdirectory(backend/cuda) | ||
|
||
# Set the compile definition for the backend build directory | ||
add_compile_definitions(BACKEND_BUILD_DIR="${CMAKE_BINARY_DIR}/backend") | ||
else() | ||
set(CUDA_BACKEND_URL "[email protected]:ingonyama-zk/icicle-cuda-backend.git") | ||
|
||
include(FetchContent) | ||
message(STATUS "Fetching cuda backend from ${CUDA_BACKEND_URL}:${CUDA_BACKEND}") | ||
FetchContent_Declare( | ||
cuda_backend | ||
GIT_REPOSITORY ${CUDA_BACKEND_URL} | ||
GIT_TAG ${CUDA_BACKEND} | ||
) | ||
FetchContent_MakeAvailable(cuda_backend) | ||
# Set the compile definition for the backend build directory | ||
add_compile_definitions(BACKEND_BUILD_DIR="${CMAKE_BINARY_DIR}/_deps/cuda_backend-build") | ||
endif() | ||
endif() | ||
|
||
if (METAL_BACKEND) | ||
string(TOLOWER "${METAL_BACKEND}" METAL_BACKEND_LOWER) | ||
if (METAL_BACKEND_LOWER STREQUAL "local") | ||
# METAL backend is local, no need to pull | ||
message(STATUS "Adding Metal backend from local path: icicle/backend/metal") | ||
add_subdirectory(backend/metal) | ||
|
||
# Set the compile definition for the backend build directory | ||
add_compile_definitions(BACKEND_BUILD_DIR="${CMAKE_BINARY_DIR}/backend") | ||
else() | ||
set(METAL_BACKEND_URL "[email protected]:ingonyama-zk/icicle-metal-backend.git") | ||
|
||
include(FetchContent) | ||
message(STATUS "Fetching cuda backend from ${METAL_BACKEND_URL}:${METAL_BACKEND}") | ||
FetchContent_Declare( | ||
metal_backend | ||
GIT_REPOSITORY ${METAL_BACKEND_URL} | ||
GIT_TAG ${METAL_BACKEND} | ||
) | ||
FetchContent_MakeAvailable(metal_backend) | ||
# Set the compile definition for the backend build directory | ||
add_compile_definitions(BACKEND_BUILD_DIR="${CMAKE_BINARY_DIR}/_deps/metal_backend-build") | ||
endif() | ||
endif() | ||
|
||
if (VULKAN_BACKEND) | ||
string(TOLOWER "${VULKAN_BACKEND}" VULKAN_BACKEND_LOWER) | ||
if (VULKAN_BACKEND_LOWER STREQUAL "local") | ||
# VULKAN backend is local, no need to pull | ||
message(STATUS "Adding Vulkan backend from local path: icicle/backend/vulkan") | ||
add_subdirectory(backend/vulkan) | ||
|
||
# Set the compile definition for the backend build directory | ||
add_compile_definitions(BACKEND_BUILD_DIR="${CMAKE_BINARY_DIR}/backend") | ||
else() | ||
set(VULKAN_BACKEND_URL "[email protected]:ingonyama-zk/icicle-vulkan-backend.git") | ||
|
||
include(FetchContent) | ||
message(STATUS "Fetching cuda backend from ${VULKAN_BACKEND_URL}:${VULKAN_BACKEND}") | ||
FetchContent_Declare( | ||
vulkan_backend | ||
GIT_REPOSITORY ${VULKAN_BACKEND_URL} | ||
GIT_TAG ${VULKAN_BACKEND} | ||
) | ||
FetchContent_MakeAvailable(vulkan_backend) | ||
# Set the compile definition for the backend build directory | ||
add_compile_definitions(BACKEND_BUILD_DIR="${CMAKE_BINARY_DIR}/_deps/vulkan-backend-build") | ||
endif() | ||
endif() |
Oops, something went wrong.