|
1 | 1 | # First-order language CUDA requires at least CMake 3.18
|
2 | 2 | cmake_minimum_required(VERSION 3.24)
|
3 | 3 |
|
| 4 | +# Default seletion of CUDA Compute Capabilities. |
| 5 | +# This must be called before project() or cmake sets it to the oldest non-deprecated CC |
| 6 | +# "all" and "all-major" work for Intel and perhaps for ARM with discrete GPUs, but not Tegra and Jetson. |
| 7 | +if(EXISTS "/etc/nv_tegra_release") |
| 8 | + # The CC list for Tegras and Jetson will require manual updates |
| 9 | + set(CMAKE_CUDA_ARCHITECTURES "53;62;72;87" |
| 10 | + CACHE |
| 11 | + STRING "Which CUDA CCs to support: native, all, all-major or an explicit list delimited by semicolons") |
| 12 | +else() |
| 13 | + # The CC list for discrete GPUs will require CMake updates |
| 14 | + set(CMAKE_CUDA_ARCHITECTURES "all-major" |
| 15 | + CACHE |
| 16 | + STRING "Which CUDA CCs to support: native, all, all-major or an explicit list delimited by semicolons") |
| 17 | +endif() |
| 18 | + |
4 | 19 | project(PopSift VERSION 1.0.0 LANGUAGES CXX CUDA)
|
5 | 20 |
|
6 | 21 | # Policy to support CUDA as a first-order language for CMake.
|
7 | 22 | # Since CMake 3.18. See https://cmake.org/cmake/help/latest/policy/CMP0104.html
|
8 | 23 | cmake_policy(SET CMP0104 NEW)
|
9 | 24 |
|
10 |
| -set(CMAKE_CUDA_ARCHITECTURES "all-major" |
11 |
| - CACHE |
12 |
| - STRING "Which CUDA CCs to support: native, all, all-major or an explicit list delimited by semicolons" |
13 |
| - FORCE) |
14 |
| - |
15 | 25 | # Set build path as a folder named as the platform (linux, windows, darwin...) plus the processor type
|
16 | 26 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
17 | 27 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
|
0 commit comments