Skip to content

Commit

Permalink
Fix for MacOS AArch64 builds
Browse files Browse the repository at this point in the history
Calls to getauxval were guarded just by `__aarch64__`, but we only
actually include the appropriate header if SPEAD2_USE_SVE_STREAM is
defined (and it is never defined on MacOS because I don't know how to
detect the feature on MacOS). So builds that explicitly disabled SVE
would also have been broken.
  • Loading branch information
bmerry committed Nov 7, 2024
1 parent ce88bb0 commit 636e7db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common_memcpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void *memcpy_nontemporal_sve(void * __restrict__ dest, const void * __restrict__
#endif // SPEAD2_USE_SVE_STREAM

extern "C" void *(*spead2_resolve_memcpy_nontemporal(
#ifdef __aarch64__
#if SPEAD2_USE_SVE_STREAM
std::uint64_t hwcaps // See System V AVI for AArch64
#endif
))(void *, const void *, std::size_t) noexcept
Expand Down Expand Up @@ -188,7 +188,7 @@ void *memcpy_nontemporal(void * __restrict__ dest, const void * __restrict__ src

void *memcpy_nontemporal(void * __restrict__ dest, const void * __restrict__ src, std::size_t n) noexcept
{
#ifdef __aarch64__
#if SPEAD2_USE_SVE_STREAM
static void *(*memcpy_nontemporal_ptr)(void * __restrict__ dest, const void * __restrict__ src, std::size_t n) noexcept =
spead2_resolve_memcpy_nontemporal(getauxval(AT_HWCAPS));
#else
Expand Down

0 comments on commit 636e7db

Please sign in to comment.