Skip to content

Commit

Permalink
CMake: remove CMAKE_CUDA_ARCHITECTURES default (#553)
Browse files Browse the repository at this point in the history
Allow CMake to automatically determine `CMAKE_CUDA_ARCHITECTURES` if it
is not set rather than defaulting to `70`
  • Loading branch information
gardner48 authored Aug 15, 2024
1 parent 115914d commit 0b5b2c3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

### New Features and Enhancements

The default value of `CMAKE_CUDA_ARCHITECTURES` is no longer set to `70` and is
now determined automatically by CMake. The previous default was only valid for
Volta GPUs while the automatically selected value will vary across compilers and
compiler versions. As such, users are encouraged to override this value with the
architecture for their system.

### Bug Fixes

Fixed the loading of ARKStep's default first order explicit method.
Expand Down
4 changes: 0 additions & 4 deletions cmake/SundialsTPLOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ sundials_option(ENABLE_PTHREAD BOOL "Enable Pthreads support" OFF)
# -------------------------------------------------------------
sundials_option(ENABLE_CUDA BOOL "Enable CUDA support" OFF)

# CMake 3.18 adds this option.
sundials_option(CMAKE_CUDA_ARCHITECTURES STRING "Target CUDA architecture" "70"
DEPENDS_ON ENABLE_CUDA)

# -------------------------------------------------------------
# Enable HIP support?
# -------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions doc/shared/RecentChanges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

**New Features and Enhancements**

The default value of :cmakeop:`CMAKE_CUDA_ARCHITECTURES` is no longer set to
``70`` and is now determined automatically by CMake. The previous default was
only valid for Volta GPUs while the automatically selected value will vary
across compilers and compiler versions. As such, users are encouraged to
override this value with the architecture for their system.

**Bug Fixes**

Fixed the loading of ARKStep's default first order explicit method.
Expand Down
14 changes: 12 additions & 2 deletions doc/shared/sundials/Install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,19 @@ illustration only.

.. cmakeoption:: CMAKE_CUDA_ARCHITECTURES

Specifies the CUDA architecture to compile for.
Specifies the CUDA architecture to compile for i.e., ``60`` for Pascal,
``70`` Volta, ``80`` for Ampere, ``90`` for Hopper, etc. See the `GPU compute
capability tables <https://developer.nvidia.com/cuda-gpus>`_ on the NVIDIA
webpage and the `GPU Compilation <https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-compilation>`_
section of the CUDA documentation for more information.

Default: ``sm_30``
Default: Determined automatically by CMake. Users are encouraged to override
this value with the architecture for their system as the default varies
across compilers and compiler versions.

.. versionchanged:: x.y.z

In prior versions ``CMAKE_CUDA_ARCHITECTURES`` defaulted to ``70``.

.. cmakeoption:: EXAMPLES_ENABLE_C

Expand Down

0 comments on commit 0b5b2c3

Please sign in to comment.