-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
56 lines (47 loc) · 1.86 KB
/
Copy pathCMakeLists.txt
File metadata and controls
56 lines (47 loc) · 1.86 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# ======================================
# == ERYN project base configuration ==
# ======================================
# TODO:
# - check cmake_minimum_required range
# - check if project-specific CMake function are needed
# ---- CMake related definitions ----
cmake_minimum_required(VERSION 3.23...3.31)
# ---- Main project definition ----
project(eryn VERSION ${SKBUILD_PROJECT_VERSION})
message(STATUS "The value of SKBUILD_PROJECT_VERSION is: ${SKBUILD_PROJECT_VERSION}")
# ---- Find required dependencies ----
find_package(Python COMPONENTS Interpreter Development.Module NumPy REQUIRED)
# ---- Define project specific options ----
# ERYN_WITH_GPU controls the activation of both GPU and CPU backend compilations.
# Its allowed values are:
#
# * AUTO: enable CPU backend, and enable GPU backend if CUDA toolchain is found
# in environment, otherwise disable it
# * ON: enable CPU backend, and enable GPU backend, fail if CUDA toolchain is
# not available
# * OFF: enable CPU backend and disable GPU backend
# * ONLY: disable CPU backend and enable GPU backend (used in plugin wheel build
# process)
# * BARE: disable both CPU and GPU backends
set(
ERYN_WITH_GPU "AUTO" CACHE
STRING "Whether to compile GPU backend"
)
set_property(
CACHE ERYN_WITH_GPU PROPERTY
STRINGS "AUTO" "ON" "OFF" "ONLY" "BARE"
)
# ERYN_CUDA_ARCH will be passed as the CUDA_ARCHITECTURES property for the CUDA
# backend if it is compiled. See the documentation of CUDA_ARCHITECTURES:
# https://cmake.org/cmake/help/latest/prop_tgt/CUDA_ARCHITECTURES.html
set(
ERYN_CUDA_ARCH "native"
CACHE STRING "CUDA Architecture targetted for ERYN compilation (see doc of \
CMAKE_CUDA_ARCHITECTURES)."
)
set(
ERYN_MARCH "native"
CACHE STRING "Value of the -march compiler option if supported by compiler"
)
# ---- Phony target for project specific properties ----
add_library(eryn INTERFACE)