DPC++ Runtime
Runtime libraries for oneAPI DPC++
atomic_enums.hpp
Go to the documentation of this file.
1 //==--------------- atomic_enums.hpp - SYCL_ONEAPI_extended_atomics enums --==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 
11 #include <CL/__spirv/spirv_ops.hpp>
15 #include <CL/sycl/memory_enums.hpp>
16 
17 #ifndef __SYCL_DEVICE_ONLY__
18 #include <atomic>
19 #endif
20 #include <type_traits>
21 
23 namespace sycl {
24 namespace ext {
25 namespace oneapi {
26 
27 using memory_order __SYCL2020_DEPRECATED("use 'sycl::memory_order' instead") =
30  "use 'sycl::memory_order_relaxed' instead") = memory_order::relaxed;
32  "use 'sycl::memory_order_acquire' instead") = memory_order::acquire;
34  "use 'sycl::memory_order_release' instead") = memory_order::release;
36  "use 'sycl::memory_order_acq_rel' instead") = memory_order::acq_rel;
38  "use 'sycl::memory_order_seq_cst' instead") = memory_order::seq_cst;
39 
40 using memory_scope __SYCL2020_DEPRECATED("use 'sycl::memory_scope' instead") =
43 memory_scope memory_scope_work_item __SYCL2020_DEPRECATED(
44  "use 'sycl::memory_scope_work_item' instead") = memory_scope::work_item;
46 memory_scope memory_scope_sub_group __SYCL2020_DEPRECATED(
47  "use 'sycl::memory_scope_sub_group' instead") = memory_scope::sub_group;
48 __SYCL_INLINE_CONSTEXPR memory_scope memory_scope_work_group
49  __SYCL2020_DEPRECATED("use 'sycl::memory_scope_work_group' instead") =
50  memory_scope::work_group;
52  "use 'sycl::memory_scope_device' instead") = memory_scope::device;
54  "use 'sycl::memory_scope_system' instead") = memory_scope::system;
55 
56 #ifndef __SYCL_DEVICE_ONLY__
57 namespace detail {
58 
60  "use 'sycl::detail::getStdMemoryOrder(sycl::memory_order)' instead")
61 static inline constexpr std::memory_order
62 getStdMemoryOrder(::cl::sycl::ext::oneapi::memory_order order) {
63  switch (order) {
64  case memory_order::relaxed:
65  return std::memory_order_relaxed;
66  case memory_order::__consume_unsupported:
67  return std::memory_order_consume;
68  case memory_order::acquire:
69  return std::memory_order_acquire;
70  case memory_order::release:
71  return std::memory_order_release;
72  case memory_order::acq_rel:
73  return std::memory_order_acq_rel;
74  case memory_order::seq_cst:
75  return std::memory_order_seq_cst;
76  }
77 }
78 
79 } // namespace detail
80 #endif // __SYCL_DEVICE_ONLY__
81 
82 } // namespace oneapi
83 } // namespace ext
84 } // namespace sycl
85 } // __SYCL_INLINE_NAMESPACE(cl)
spirv_ops.hpp
cl::sycl::memory_order
memory_order
Definition: memory_enums.hpp:16
cl::sycl::info::device
device
Definition: info_desc.hpp:53
__SYCL2020_DEPRECATED
#define __SYCL2020_DEPRECATED(message)
Definition: defines_elementary.hpp:56
helpers.hpp
sycl
Definition: invoke_simd.hpp:68
access.hpp
cl::sycl::memory_scope
memory_scope
Definition: memory_enums.hpp:26
cl::sycl::detail::getStdMemoryOrder
static std::memory_order getStdMemoryOrder(__spv::MemorySemanticsMask::Flag)
Definition: atomic.hpp:81
defines.hpp
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
std
Definition: accessor.hpp:2616
__SYCL_INLINE_CONSTEXPR
#define __SYCL_INLINE_CONSTEXPR
Definition: defines_elementary.hpp:65
memory_enums.hpp
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12