Clean up CUDA CMake files.

- Unify test/CMakeLists.txt and unsupported/test/CMakeLists.txt
- Added `EIGEN_CUDA_FLAGS` that are appended to the set of flags passed
to the cuda compiler (nvcc or clang).

The latter is to support passing custom flags (e.g. `-arch=` to nvcc,
or to disable cuda-specific warnings).
This commit is contained in:
Antonio Sanchez
2021-09-24 14:43:59 -07:00
parent e9e90892fe
commit 7b00e8b186
3 changed files with 30 additions and 39 deletions

View File

@@ -400,7 +400,8 @@ if(EIGEN_TEST_NO_EXCEPTIONS)
message(STATUS "Disabling exceptions in tests/examples")
endif()
set(EIGEN_CUDA_COMPUTE_ARCH 30 CACHE STRING "The CUDA compute architecture level to target when compiling CUDA code")
set(EIGEN_CUDA_FLAGS "" CACHE STRING "Additional flags to pass to the cuda compiler.")
set(EIGEN_CUDA_COMPUTE_ARCH 30 CACHE STRING "The CUDA compute architecture(s) to target when compiling CUDA code")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})