Skip to content

Commit

Permalink
Add check to ensure complex alignment (#228)
Browse files Browse the repository at this point in the history
* Add check to ensure complex alignment

* fix kokkos_check usage

---------

Co-authored-by: Yuuichi Asahi <y.asahi@nr.titech.ac.jp>
  • Loading branch information
yasahi-hpc and Yuuichi Asahi authored Feb 20, 2025
1 parent 14a90b6 commit 02692b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ if (NOT KokkosFFT_ENABLE_INTERNAL_KOKKOS)
# First check, Kokkos is added as subdirectory or not
if(NOT TARGET Kokkos::kokkos)
find_package(Kokkos ${KOKKOS_REQUIRED_VERSION} REQUIRED)
# Check the alignment of complex numbers
kokkos_check(OPTIONS COMPLEX_ALIGN)
endif()
else ()
add_subdirectory(tpls/kokkos)
Expand Down
6 changes: 6 additions & 0 deletions fft/src/KokkosFFT_default_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

#include <Kokkos_Core.hpp>

#if !defined(KOKKOS_ENABLE_COMPLEX_ALIGN)
static_assert(false,
"KokkosFFT requires option -DKokkos_ENABLE_COMPLEX_ALIGN=ON to "
"build Kokkos");
#endif

#if defined(KOKKOS_ENABLE_CUDA)
#include "KokkosFFT_Cuda_types.hpp"
#elif defined(KOKKOS_ENABLE_HIP)
Expand Down

0 comments on commit 02692b1

Please sign in to comment.