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_CUDA
13
15{
16 struct MemOrderCuda
17 {
18 template<concepts::MemoryOrder TMemOrder>
19 static constexpr auto get(TMemOrder)
20 {
21# ifdef ALPAKA_CUDA_ATOMIC
22 if constexpr(std::same_as<TMemOrder, order::SeqCst>)
23 {
24 return ::cuda::memory_order_seq_cst;
25 }
26 if constexpr(std::same_as<TMemOrder, order::AcqRel>)
27 {
28 return ::cuda::memory_order_acq_rel;
29 }
30 if constexpr(std::same_as<TMemOrder, order::Release>)
31 {
32 return ::cuda::memory_order_release;
33 }
34 if constexpr(std::same_as<TMemOrder, order::Acquire>)
35 {
36 return ::cuda::memory_order_acquire;
37 }
38 if constexpr(std::same_as<TMemOrder, order::Relaxed>)
39 {
40 return ::cuda::memory_order_relaxed;
41 }
42# endif
43 }
44 };
45} // namespace alpaka::onAcc::internalCompute
46
47#endif // ALPAKA_LANG_SYCL
constexpr decltype(auto) get(concepts::SpecializationOf< Dict > auto &t) noexcept
Definition Dict.hpp:151