Skip to content

Fix compiling using Sacado with a CUDA device compiler and KOKKOS_ENABLE_CUDA=OFF

Created by: masterleinad

@trilinos/kokkos @trilinos/sacado

Description

If a CUDA device compiler and KOKKOS_ENABLE_CUDA=OFF, still define

  • Kokkos::atomic_compare_exchange
  • Kokkos::atomic_exchange
  • Kokkos::atomic_fetch_add
  • Kokkos::atomic_fetch_and
  • Kokkos::atomic_fetch_or
  • Kokkos::atomic_fetch_sub

and don't define Sacado::createGlobalMemoryPool and Sacado::destroyGlobalMemoryPool with a Kokkos::Cuda parameter in that case.

Motivation and Context

Fixes https://github.com/kokkos/kokkos/issues/1607 and https://github.com/dealii/dealii/issues/6423.

How Has This Been Tested?

Compiling Trilinos configured without CUDA support, but with Kokkos and Sacado works. Compiling (deal.II)[https://github.com/dealii/dealii/] with CUDA support and such a Trilinos configuration works and passes deal.IIs test suite.

Checklist

  • My commit messages mention the appropriate GitHub issue numbers.
  • My code follows the code style of the affected package(s).
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the code contribution guidelines for this project.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • No new compiler warnings were introduced.
  • These changes break backwards compatibility.

Merge request reports