SpECTRE Documentation Coverage Report
Current view: top level - __w/spectre/spectre/docs/DevGuide - GpuSupport.md Hit Total Coverage
Commit: 923cd4a8ea30f5a5589baa60b0a93e358ca9f8e8 Lines: 0 1 0.0 %
Date: 2025-11-07 19:37:56
Legend: Lines: hit not hit

          Line data    Source code
       1           0 : \cond NEVER
       2             : Distributed under the MIT License.
       3             : See LICENSE.txt for details.
       4             : \endcond
       5             : 
       6             : # GPU support {#gpu_support}
       7             : 
       8             : \tableofcontents
       9             : 
      10             : # Overview
      11             : 
      12             : \warning GPU support is experimental and this page will be updated as the
      13             : implementation matures.
      14             : 
      15             : SpECTRE supports GPU acceleration through the [Kokkos](https://github.com/kokkos/kokkos)
      16             : library.
      17             : 
      18             : ## Build configuration
      19             : 
      20             : To enable GPU support, set the CMake option `-D SPECTRE_KOKKOS=ON` when
      21             : configuring the build. Either point CMake to a Kokkos installation with
      22             : `-D Kokkos_ROOT=path/to/kokkos` or set `-D SPECTRE_FETCH_MISSING_DEPS=ON` to
      23             : fetch Kokkos automatically and build it as part of SpECTRE. You also have to
      24             : select a parallelization backend for Kokkos and possibly more configuration
      25             : options like the GPU architecture to build for. Read the
      26             : [Kokkos documentation](https://kokkos.org/kokkos-core-wiki/get-started/configuration-guide.html)
      27             : for details on how to configure Kokkos. Here's an example for fetching Kokkos
      28             : automatically and building it as part of SpECTRE with the CUDA backend:
      29             : 
      30             : ```sh
      31             : cmake -D SPECTRE_KOKKOS=ON \
      32             :       -D SPECTRE_FETCH_MISSING_DEPS=ON \
      33             :       -D Kokkos_ENABLE_CUDA=ON \
      34             :       ...
      35             : ```
      36             : 
      37             : Here's an example for using an existing Kokkos installation:
      38             : 
      39             : ```sh
      40             : cmake -D SPECTRE_KOKKOS=ON \
      41             :       -D Kokkos_ROOT=path/to/kokkos/build \
      42             :       -D CMAKE_CXX_COMPILER=path/to/kokkos/bin/nvcc_wrapper \
      43             :       ...
      44             : ```
      45             : 
      46             : When building Kokkos separately with the CUDA backend, you have to set the
      47             : following configuration options:
      48             : 
      49             : - `Kokkos_ENABLE_CUDA_CONSTEXPR=ON`
      50             : - `Kokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE`

Generated by: LCOV version 1.14