Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix clang9/nvcc11.2 boost bug #2294

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions include/alpaka/atomic/AtomicAtomicRef.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace alpaka
void isSupportedByAtomicAtomicRef()
{
static_assert(
std::is_trivially_copyable_v<T> && detail::atomic_ref<T>::required_alignment <= alignof(T),
std::is_trivially_copyable_v<T> && alpaka::detail::atomic_ref<T>::required_alignment <= alignof(T),
fwyzard marked this conversation as resolved.
Show resolved Hide resolved
"Type not supported by AtomicAtomicRef, please recompile defining "
"ALPAKA_DISABLE_ATOMIC_ATOMICREF.");
}
Expand All @@ -56,7 +56,7 @@ namespace alpaka
ALPAKA_FN_HOST static auto atomicOp(AtomicAtomicRef const&, T* const addr, T const& value) -> T
{
isSupportedByAtomicAtomicRef<T>();
detail::atomic_ref<T> ref(*addr);
alpaka::detail::atomic_ref<T> ref(*addr);
return ref.fetch_add(value);
}
};
Expand All @@ -68,7 +68,7 @@ namespace alpaka
ALPAKA_FN_HOST static auto atomicOp(AtomicAtomicRef const&, T* const addr, T const& value) -> T
{
isSupportedByAtomicAtomicRef<T>();
detail::atomic_ref<T> ref(*addr);
alpaka::detail::atomic_ref<T> ref(*addr);
return ref.fetch_sub(value);
}
};
Expand All @@ -80,7 +80,7 @@ namespace alpaka
ALPAKA_FN_HOST static auto atomicOp(AtomicAtomicRef const&, T* const addr, T const& value) -> T
{
isSupportedByAtomicAtomicRef<T>();
detail::atomic_ref<T> ref(*addr);
alpaka::detail::atomic_ref<T> ref(*addr);
T old = ref;
T result = old;
result = std::min(result, value);
Expand All @@ -100,7 +100,7 @@ namespace alpaka
ALPAKA_FN_HOST static auto atomicOp(AtomicAtomicRef const&, T* const addr, T const& value) -> T
{
isSupportedByAtomicAtomicRef<T>();
detail::atomic_ref<T> ref(*addr);
alpaka::detail::atomic_ref<T> ref(*addr);
T old = ref;
T result = old;
result = std::max(result, value);
Expand All @@ -120,7 +120,7 @@ namespace alpaka
ALPAKA_FN_HOST static auto atomicOp(AtomicAtomicRef const&, T* const addr, T const& value) -> T
{
isSupportedByAtomicAtomicRef<T>();
detail::atomic_ref<T> ref(*addr);
alpaka::detail::atomic_ref<T> ref(*addr);
T old = ref;
T result = value;
while(!ref.compare_exchange_weak(old, result))
Expand All @@ -138,7 +138,7 @@ namespace alpaka
ALPAKA_FN_HOST static auto atomicOp(AtomicAtomicRef const&, T* const addr, T const& value) -> T
{
isSupportedByAtomicAtomicRef<T>();
detail::atomic_ref<T> ref(*addr);
alpaka::detail::atomic_ref<T> ref(*addr);
T old = ref;
T result = ((old >= value) ? 0 : static_cast<T>(old + 1));
while(!ref.compare_exchange_weak(old, result))
Expand All @@ -156,7 +156,7 @@ namespace alpaka
ALPAKA_FN_HOST static auto atomicOp(AtomicAtomicRef const&, T* const addr, T const& value) -> T
{
isSupportedByAtomicAtomicRef<T>();
detail::atomic_ref<T> ref(*addr);
alpaka::detail::atomic_ref<T> ref(*addr);
T old = ref;
T result = ((old >= value) ? 0 : static_cast<T>(old - 1));
while(!ref.compare_exchange_weak(old, result))
Expand All @@ -174,7 +174,7 @@ namespace alpaka
ALPAKA_FN_HOST static auto atomicOp(AtomicAtomicRef const&, T* const addr, T const& value) -> T
{
isSupportedByAtomicAtomicRef<T>();
detail::atomic_ref<T> ref(*addr);
alpaka::detail::atomic_ref<T> ref(*addr);
return ref.fetch_and(value);
}
};
Expand All @@ -186,7 +186,7 @@ namespace alpaka
ALPAKA_FN_HOST static auto atomicOp(AtomicAtomicRef const&, T* const addr, T const& value) -> T
{
isSupportedByAtomicAtomicRef<T>();
detail::atomic_ref<T> ref(*addr);
alpaka::detail::atomic_ref<T> ref(*addr);
return ref.fetch_or(value);
}
};
Expand All @@ -198,7 +198,7 @@ namespace alpaka
ALPAKA_FN_HOST static auto atomicOp(AtomicAtomicRef const&, T* const addr, T const& value) -> T
{
isSupportedByAtomicAtomicRef<T>();
detail::atomic_ref<T> ref(*addr);
alpaka::detail::atomic_ref<T> ref(*addr);
return ref.fetch_xor(value);
}
};
Expand All @@ -214,7 +214,7 @@ namespace alpaka
T const& value) -> T
{
isSupportedByAtomicAtomicRef<T>();
detail::atomic_ref<T> ref(*addr);
alpaka::detail::atomic_ref<T> ref(*addr);
T old = ref;
T result;
do
Expand Down
Loading