You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sycl/doc/extensions/deprecated/sycl_ext_oneapi_extended_atomics.asciidoc
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ NOTE: Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are tradema
27
27
28
28
NOTE: This document is better viewed when rendered as html with asciidoctor. GitHub does not render image icons.
29
29
30
-
This document describes an extension that introduces the `sycl::intel::atomic_ref` class, which exposes additional functionality aligned with the +std::atomic_ref+ class from {cpp}20.
30
+
This document describes an extension that introduces the `cl::sycl::intel::atomic_ref` class, which exposes additional functionality aligned with the +std::atomic_ref+ class from {cpp}20.
31
31
32
32
== Name Strings
33
33
@@ -62,21 +62,21 @@ This extension is written against the SYCL 1.2.1 specification, Revision 6 and t
62
62
63
63
== Overview
64
64
65
-
The SYCL atomic library (+sycl::atomic+) defined in SYCL 1.2.1 is based on the standard atomic libary (+std::atomic+) but has some differences. This extension introduces a new fence function (+sycl::intel::atomic_fence+) and an alternative atomic class (+sycl::intel::atomic_ref+) including additional features from {cpp}20:
65
+
The SYCL atomic library (+cl::sycl::atomic+) defined in SYCL 1.2.1 is based on the standard atomic libary (+std::atomic+) but has some differences. This extension introduces a new fence function (+cl::sycl::intel::atomic_fence+) and an alternative atomic class (+cl::sycl::intel::atomic_ref+) including additional features from {cpp}20:
66
66
67
67
- Overloaded operators to reduce the verbosity of using atomics
68
68
- Missing functions (e.g. `is_lock_free()`)
69
69
- Support for floating-point types
70
70
- Support for additional memory orderings besides `relaxed`
71
71
- Support for scopes denoting the set of work-items and devices to which memory ordering applies
72
72
73
-
This extension deprecates the SYCL 1.2.1 +sycl::atomic+ class and accessors created with mode +access::mode::atomic+.
73
+
This extension deprecates the SYCL 1.2.1 +cl::sycl::atomic+ class and accessors created with mode +access::mode::atomic+.
74
74
75
75
The extension can be enabled using the `-fsycl-extended-atomics` flag, and applications can check whether the extension is enabled using `__has_extension(sycl_extended_atomics)`.
76
76
77
77
=== Overloaded Operators
78
78
79
-
In SYCL 1.2.1, the +sycl::atomic+ class provides atomic operations by way of member functions (e.g. +fetch_add+) without defining the corresponding operators (e.g. `+=`). This increases the verbosity of simple uses of atomics.
79
+
In SYCL 1.2.1, the +cl::sycl::atomic+ class provides atomic operations by way of member functions (e.g. +fetch_add+) without defining the corresponding operators (e.g. `+=`). This increases the verbosity of simple uses of atomics.
80
80
81
81
The operators defined by this extension match those defined for +std::atomic_ref+ in {cpp}20. The functionality of each operator is equivalent to calling a corresponding member function of the +atomic_ref+ class -- the operators do not expose any new functionality of the class, but act as shorthands for common use-cases.
82
82
@@ -121,7 +121,7 @@ This extension extends support for floating-point types to the +compare_exchange
121
121
122
122
=== Support for Additional Memory Orderings
123
123
124
-
The atomic operations in SYCL 1.2.1 default to +memory_order_relaxed+, which is inconsistent with the default of +memory_order_seq_cst+ used by the +std::atomic+ class. Defaulting to +memory_order_relaxed+ may improve the performance and portability of SYCL 1.2.1 code across multiple target devices, but may also lead to unexpected behavior when code is migrated between {cpp} and SYCL. Different users have different understandings of which memory orders are the most common or useful, and the performance difference between memory orders is also expected to vary between devices. This extension therefore makes the default memory order of +sycl::intel::atomic_ref+ dependent upon a template argument that must be specified by the user.
124
+
The atomic operations in SYCL 1.2.1 default to +memory_order_relaxed+, which is inconsistent with the default of +memory_order_seq_cst+ used by the +std::atomic+ class. Defaulting to +memory_order_relaxed+ may improve the performance and portability of SYCL 1.2.1 code across multiple target devices, but may also lead to unexpected behavior when code is migrated between {cpp} and SYCL. Different users have different understandings of which memory orders are the most common or useful, and the performance difference between memory orders is also expected to vary between devices. This extension therefore makes the default memory order of +cl::sycl::intel::atomic_ref+ dependent upon a template argument that must be specified by the user.
125
125
126
126
All devices must support +memory_order_relaxed+, and the host device must support all {cpp} memory orders. These changes bring the SYCL memory model in line with modern {cpp} while allowing a device/compiler to implement only a subset of {cpp} memory orders. Supporting the standard {cpp} memory model in SYCL requires that disjoint address spaces (e.g. local and global memory) are treated as though they are part of a single address space (i.e. there must be a single happens-before relationship for all addresses).
127
127
@@ -153,7 +153,7 @@ All devices must support +memory_scope::work_group+, and the host device must su
153
153
154
154
=== The +atomic_ref+ Class
155
155
156
-
The +sycl::intel::atomic_ref+ class is constructed from a reference, and enables atomic operations to the referenced object. If any non-atomic access to the referenced object is made during the lifetime of the +sycl::intel::atomic_ref+ class then the behavior is undefined. No subobject of the object referenced by an +atomic_ref+ shall be concurrently referenced by any other +atomic_ref+ object.
156
+
The +cl::sycl::intel::atomic_ref+ class is constructed from a reference, and enables atomic operations to the referenced object. If any non-atomic access to the referenced object is made during the lifetime of the +cl::sycl::intel::atomic_ref+ class then the behavior is undefined. No subobject of the object referenced by an +atomic_ref+ shall be concurrently referenced by any other +atomic_ref+ object.
157
157
158
158
The address space specified by the template argument +Space+ must be +access::address_space::global_space+ or +access::address_space::local_space+. It is illegal for an +atomic_ref+ to reference an object in +access::address_space::constant_space+ or +access::address_space::private_space+.
Copy file name to clipboardExpand all lines: sycl/doc/extensions/deprecated/sycl_ext_oneapi_group_algorithms.asciidoc
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,19 +112,19 @@ Functions with arguments of type +vec<T,N>+ are applied component-wise: they are
112
112
113
113
=== Function Objects
114
114
115
-
A number of function objects are provided in the +sycl::intel+ namespace. These function objects are used for all interfaces requiring an operator to be specified. All function objects obey C++ conversion and promotion rules.
115
+
A number of function objects are provided in the +cl::sycl::intel+ namespace. These function objects are used for all interfaces requiring an operator to be specified. All function objects obey C++ conversion and promotion rules.
116
116
117
117
Transparent function objects are provided if using a {cpp}14 compiler -- the parameter types and return type for transparent function objects will be deduced if +T+ is not specified.
118
118
119
119
The following function objects alias objects in the +<functional>+ header from the {cpp} standard library:
120
120
121
-
- +sycl::intel::plus+
122
-
- +sycl::intel::multiplies+
123
-
- +sycl::intel::bit_and+
124
-
- +sycl::intel::bit_or+
125
-
- +sycl::intel::bit_xor+
126
-
- +sycl::intel::logical_and+
127
-
- +sycl::intel::logical_or+
121
+
- +cl::sycl::intel::plus+
122
+
- +cl::sycl::intel::multiplies+
123
+
- +cl::sycl::intel::bit_and+
124
+
- +cl::sycl::intel::bit_or+
125
+
- +cl::sycl::intel::bit_xor+
126
+
- +cl::sycl::intel::logical_and+
127
+
- +cl::sycl::intel::logical_or+
128
128
129
129
New function objects without {cpp} standard library equivalents are defined in the table below:
0 commit comments