Skip to content

Commit 45f3137

Browse files
committed
require Kokkos 3.7 with device support
1 parent 089f948 commit 45f3137

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

cmake/modules/FindDEAL_II_KOKKOS.cmake

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,14 @@ if(KOKKOS_FOUND)
124124
set(KOKKOS_VERSION ${Kokkos_VERSION})
125125

126126
if (Kokkos_ENABLE_CUDA OR Kokkos_ENABLE_HIP)
127-
# In version older than 3.7.0, Kokkos::Array::operator[] is not constexpr,
128-
# so we use std::array instead.
129-
if (Kokkos_VERSION VERSION_LESS 3.7.0)
130-
# We are using std::array in device code which calls the host-only function
131-
# __glibcxx_requires_subscript when defining _GLIBCXX_ASSERTIONS
132-
list(REMOVE_ITEM DEAL_II_DEFINITIONS_DEBUG "_GLIBCXX_ASSERTIONS")
133-
endif()
127+
# In versions older than 3.7.0, we would need several workarounds if
128+
# device support is enabled:
129+
# - Kokkos::Array::operator[] is not constexpr
130+
# - std::array uses __glibcxx_requires_subscript (host-only)
131+
# - KOKKOS_IF_ON_DEVICE doesn't exist
132+
#
133+
# So, to simplify our work, require a more modern version:
134+
message(ERROR "Device support (CUDA/HIP) requires Kokkos version 3.7 or newer!")
134135
endif()
135136

136137
if(Kokkos_ENABLE_CUDA)

doc/readme.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,10 @@ <h4>Optional interfaces to other software packages</h4>
654654
<a href="https://github.com/kokkos/kokkos" target="_top">Kokkos</a> implements a programming model in
655655
C++ for writing performance portable applications targeting all major HPC platforms.
656656
To use a self compiled version, pass <code>-DKOKKOS_DIR=/path/to/kokkos</code> to the deal.II CMake
657-
call. We currently require Kokkos version 3.4 or newer (when bundled in Trilinos) or 3.7 or newer when configured separately.<br/>
657+
call. We currently require Kokkos version 3.4 or newer (when bundled in Trilinos) or 3.7 or newer
658+
when configured separately. For device support we require 3.7 or newer (stand-alone or part of Trilinos
659+
16 or newer).
660+
<br/>
658661
The compiler must be able to compile code for all enabled backends. In case CUDA is enabled in Kokkos
659662
and nvcc should be used as device compiler,
660663
it is recommended to use the nvcc_wrapper script that comes with Kokkos as C++ compiler. clang++ or

0 commit comments

Comments
 (0)