Skip to content

Commit

Permalink
CI: fix windows compile
Browse files Browse the repository at this point in the history
Fix error by explicit linking to the right namespace.

```
AtomicAtomicRef.hpp(59,25): error C2039: 'atomic_ref': is not a member of 'alpaka::trait::detail'
```
  • Loading branch information
psychocoderHPC authored and fwyzard committed Jun 19, 2024
1 parent 217120b commit ed0a95f
Showing 1 changed file with 12 additions and 12 deletions.
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),
"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

0 comments on commit ed0a95f

Please sign in to comment.