Skip to content

Commit

Permalink
Workaround for misaligned address in Clang+Cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Jan 10, 2025
1 parent 70f7b99 commit 563d976
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/spatial/detail/ArborX_Predicates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ struct PredicateWithAttachment : Predicate
: Predicate(std::forward<Predicate>(pred))
, _data(std::forward<Data>(data))
{}
#if defined(KOKKOS_ENABLE_CUDA) && defined(KOKKOS_COMPILER_CLANG) && \
(KOKKOS_COMPILER_CLANG < 1500)
// FIXME_NVCC, FIXME_CLANG: Without explicit destructor, it causes misaligned
// address in local write when running query tests with double precision, and
// errors at least Clang 14 and CUDA 11.0.3. No idea why that happens.
KOKKOS_FUNCTION ~PredicateWithAttachment()
{
data.~Data();
Predicate::~Predicate();
}
#endif

Data _data;
};

Expand Down

0 comments on commit 563d976

Please sign in to comment.