alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
memoryOrder.hpp
Go to the documentation of this file.
1/* Copyright 2025 Mehmet Yusufoglu, René Widera
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6
9
10#include <type_traits>
11
12#if ALPAKA_LANG_HIP
13
15{
16 struct MemOrderHip
17 {
18 template<concepts::MemoryOrder TMemOrder>
19 static constexpr auto get(TMemOrder)
20 {
21 if constexpr(std::same_as<TMemOrder, order::SeqCst>)
22 {
23 return __ATOMIC_SEQ_CST;
24 }
25 if constexpr(std::same_as<TMemOrder, order::AcqRel>)
26 {
27 return __ATOMIC_ACQ_REL;
28 }
29 if constexpr(std::same_as<TMemOrder, order::Release>)
30 {
31 return __ATOMIC_RELEASE;
32 }
33 if constexpr(std::same_as<TMemOrder, order::Acquire>)
34 {
35 return __ATOMIC_ACQUIRE;
36 }
37 if constexpr(std::same_as<TMemOrder, order::Relaxed>)
38 {
39 return __ATOMIC_RELAXED;
40 }
41 }
42 };
43} // namespace alpaka::onAcc::internalCompute
44
45#endif // ALPAKA_LANG_SYCL
constexpr decltype(auto) get(concepts::SpecializationOf< Dict > auto &t) noexcept
Definition Dict.hpp:151