From fc81516c3d38fb024452b3204d1355db8fbec3ff Mon Sep 17 00:00:00 2001 From: Thomas Padioleau Date: Fri, 7 Mar 2025 12:18:21 +0100 Subject: [PATCH] Ensure the alignment is not too big --- include/ddc/kokkos_allocator.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/ddc/kokkos_allocator.hpp b/include/ddc/kokkos_allocator.hpp index f58b334b4..cd6701c9a 100644 --- a/include/ddc/kokkos_allocator.hpp +++ b/include/ddc/kokkos_allocator.hpp @@ -15,6 +15,12 @@ namespace ddc { template class KokkosAllocator { + // Kokkos natively supports alignment for any scalar type that can be represented by the type `std::max_align_t` + static_assert( + alignof(T) + <= std::max(alignof(std::max_align_t), alignof(Kokkos::complex)), + "Alignment not supported"); + public: using value_type = T;