|
SpECTRE
v2025.08.19
|
SpECTRE supports GPU acceleration through the Kokkos library.
To enable GPU support, set the CMake option -D SPECTRE_KOKKOS=ON when configuring the build. Either point CMake to a Kokkos installation with -D Kokkos_ROOT=path/to/kokkos or set -D SPECTRE_FETCH_MISSING_DEPS=ON to fetch Kokkos automatically and build it as part of SpECTRE. You also have to select a parallelization backend for Kokkos and possibly more configuration options like the GPU architecture to build for. Read the Kokkos documentation for details on how to configure Kokkos. Here's an example for fetching Kokkos automatically and building it as part of SpECTRE with the CUDA backend:
Here's an example for using an existing Kokkos installation:
When building Kokkos separately with the CUDA backend, you have to set the following configuration options:
Kokkos_ENABLE_CUDA_CONSTEXPR=ONKokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE