Skip to content

Commit 78e7d66

Browse files
committed
Build native arch by default, update rapids-cmake.
1 parent 98d701c commit 78e7d66

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ else()
1111
set(NVBench_TOPLEVEL_PROJECT OFF)
1212
endif()
1313

14+
# Default to native if no cuda arches are specified:
15+
if (NOT (DEFINED CMAKE_CUDA_ARCHITECTURES OR DEFINED ENV{CUDAARCHS}))
16+
set(CMAKE_CUDA_ARCHITECTURES "native")
17+
endif()
18+
1419
include(cmake/NVBenchRapidsCMake.cmake)
15-
nvbench_load_rapids_cmake()
20+
nvbench_load_rapids_cmake(25.12)
1621

1722
project(NVBench
1823
LANGUAGES CUDA CXX

cmake/NVBenchRapidsCMake.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Called before project(...)
2-
macro(nvbench_load_rapids_cmake)
2+
macro(nvbench_load_rapids_cmake version)
33
# - Including directly, see https://github.com/rapidsai/rmm/pull/1886
44
# - Versioned download URL:
55
# https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-XX.YY/RAPIDS.cmake
66
# - This macro is always called before project() in the root CMakeLists.txt, so:
77
# - we can't just use NVBench_SOURCE_DIR, it's not defined yet.
88
# - We can't rely on CMAKE_CURRENT_LIST_DIR because of macro expansion.
99
# - We can fallback to CURRENT_SOURCE_DIR because we know this will be expanded in the root:
10+
set(rapids-cmake-version ${version})
1011
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/RAPIDS.cmake")
1112

1213
include(rapids-cmake)

cmake/RAPIDS.cmake

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
#
1717
# This is the preferred entry point for projects using rapids-cmake
1818
#
19+
# Enforce the minimum required CMake version for all users
20+
cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR)
1921

2022
# Allow users to control which version is used
21-
if(NOT rapids-cmake-version)
22-
# Define a default version if the user doesn't set one
23-
set(rapids-cmake-version 25.04)
23+
if(NOT (rapids-cmake-branch OR rapids-cmake-version))
24+
message(FATAL_ERROR "The CMake variable `rapids-cmake-branch` or `rapids-cmake-version` must be defined"
25+
)
2426
endif()
2527

2628
# Allow users to control which GitHub repo is fetched
@@ -66,26 +68,18 @@ if(NOT rapids-cmake-url)
6668
endif()
6769
endif()
6870

69-
if(POLICY CMP0135)
70-
cmake_policy(PUSH)
71-
cmake_policy(SET CMP0135 NEW)
72-
endif()
7371
include(FetchContent)
7472
if(rapids-cmake-fetch-via-git)
75-
FetchContent_Declare(rapids-cmake
76-
GIT_REPOSITORY "${rapids-cmake-url}"
77-
GIT_TAG "${rapids-cmake-value-to-clone}")
73+
FetchContent_Declare(rapids-cmake GIT_REPOSITORY "${rapids-cmake-url}"
74+
GIT_TAG "${rapids-cmake-value-to-clone}")
7875
else()
7976
string(APPEND rapids-cmake-url "${rapids-cmake-value-to-clone}")
8077
FetchContent_Declare(rapids-cmake URL "${rapids-cmake-url}")
8178
endif()
82-
if(POLICY CMP0135)
83-
cmake_policy(POP)
84-
endif()
8579
FetchContent_GetProperties(rapids-cmake)
8680
if(rapids-cmake_POPULATED)
87-
# Something else has already populated rapids-cmake, only thing
88-
# we need to do is setup the CMAKE_MODULE_PATH
81+
# Something else has already populated rapids-cmake, only thing we need to do is setup the
82+
# CMAKE_MODULE_PATH
8983
if(NOT "${rapids-cmake-dir}" IN_LIST CMAKE_MODULE_PATH)
9084
list(APPEND CMAKE_MODULE_PATH "${rapids-cmake-dir}")
9185
endif()

0 commit comments

Comments
 (0)