Skip to content

Commit

Permalink
Only include SetGPUArchs in the top-level CMakeLists.txt (#713)
Browse files Browse the repository at this point in the history
Fixes an issue seen when building both tests and benchmarks:
```
######################
# Configuring librmm #
######################
...
-- RMM: Building tests with GPU Architectures: 60-real;70-real;75-real;80
...
-- RMM: Building benchmarks with GPU Architectures: 60-real-real;70-real-real;75-real-real;80
-- Configuring done
CMake Error in benchmarks/CMakeLists.txt:
  Uknown CUDA architecture specifier "real-real".
```

Authors:
  - Paul Taylor (@trxcllnt)
  - Keith Kraus (@kkraus14)

Approvers:
  - Jake Hemstad (@jrhemstad)
  - Keith Kraus (@kkraus14)

URL: #713
  • Loading branch information
trxcllnt authored Feb 22, 2021
1 parent 69a7541 commit 47680ec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ set_property(CACHE RMM_LOGGING_LEVEL PROPERTY STRINGS "TRACE" "DEBUG" "INFO" "WA
"CRITICAL" "OFF")
message(STATUS "RMM: RMM_LOGGING_LEVEL = '${RMM_LOGGING_LEVEL}'")

if(BUILD_TESTS OR BUILD_BENCHMARKS)
# Auto-detect available GPU compute architectures
include(${RMM_SOURCE_DIR}/cmake/Modules/SetGPUArchs.cmake)
message(STATUS "RMM: Building benchmarks with GPU Architectures: ${CMAKE_CUDA_ARCHITECTURES}")
# Only enable the CUDA language after including SetGPUArchs.cmake
enable_language(CUDA)
endif()

# optionally build tests

if(BUILD_TESTS)
Expand Down
7 changes: 0 additions & 7 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ CPMFindPackage(
GIT_SHALLOW TRUE
OPTIONS "BENCHMARK_ENABLE_TESTING OFF" "BENCHMARK_ENABLE_INSTALL OFF")

# Auto-detect available GPU compute architectures

include(${RMM_SOURCE_DIR}/cmake/Modules/SetGPUArchs.cmake)
message(STATUS "RMM: Building benchmarks with GPU Architectures: ${CMAKE_CUDA_ARCHITECTURES}")

# Build options

enable_language(CUDA)

option(DISABLE_DEPRECATION_WARNING "Disable warnings generated from deprecated declarations." OFF)
option(PER_THREAD_DEFAULT_STREAM "Build with per-thread default stream" OFF)

Expand Down
4 changes: 0 additions & 4 deletions cmake/Modules/SetGPUArchs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,3 @@ list(SORT CMAKE_CUDA_ARCHITECTURES ORDER ASCENDING)
list(POP_BACK CMAKE_CUDA_ARCHITECTURES latest_arch)
list(TRANSFORM CMAKE_CUDA_ARCHITECTURES APPEND "-real")
list(APPEND CMAKE_CUDA_ARCHITECTURES ${latest_arch})

set(CMAKE_CUDA_ARCHITECTURES
${CMAKE_CUDA_ARCHITECTURES}
PARENT_SCOPE)
7 changes: 0 additions & 7 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ if(GTest_ADDED)
add_library(GTest::gmock_main ALIAS gmock_main)
endif()

# Auto-detect available GPU compute architectures

include(${RMM_SOURCE_DIR}/cmake/Modules/SetGPUArchs.cmake)
message(STATUS "RMM: Building tests with GPU Architectures: ${CMAKE_CUDA_ARCHITECTURES}")

enable_language(CUDA)

# Build options

option(DISABLE_DEPRECATION_WARNING "Disable warnings generated from deprecated declarations." OFF)
Expand Down

0 comments on commit 47680ec

Please sign in to comment.