vecmem 1.14.0
Loading...
Searching...
No Matches
memory_order.hpp
1/*
2 * VecMem project, part of the ACTS project (R&D line)
3 *
4 * (c) 2024 CERN for the benefit of the ACTS project
5 *
6 * Mozilla Public License Version 2.0
7 */
8
9#pragma once
10
11// System include(s).
12#include <atomic>
13
14#if (defined(CL_SYCL_LANGUAGE_VERSION) || defined(SYCL_LANGUAGE_VERSION)) && \
15 defined(VECMEM_HAVE_SYCL_ATOMIC_REF)
16// SYCL include(s).
17#include <sycl/sycl.hpp>
18#endif
19
20namespace vecmem {
21#if (defined(CL_SYCL_LANGUAGE_VERSION) || defined(SYCL_LANGUAGE_VERSION)) && \
22 defined(VECMEM_HAVE_SYCL_ATOMIC_REF)
24using memory_order = ::sycl::memory_order;
25#elif ((!defined(__CUDA_ARCH__)) && (!defined(__HIP_DEVICE_COMPILE__)) && \
26 (!defined(CL_SYCL_LANGUAGE_VERSION)) && \
27 (!defined(SYCL_LANGUAGE_VERSION)) && __cpp_lib_atomic_ref)
28using memory_order = std::memory_order;
29#else
31enum class memory_order {
32 relaxed = 0,
33 consume = 1,
34 acquire = 2,
35 release = 3,
36 acq_rel = 4,
37 seq_cst = 5
38};
39#endif
40} // namespace vecmem
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
memory_order
Custom (dummy) definition for the memory order.
Definition memory_order.hpp:31