Skip to content

Commit 6532637

Browse files
authored
[SYCL][Doc] Fix ptrdiff_t type namespace qualifier (#14888)
ptrdiff_t is declared in std namespace. Define syclex namespace alias used in the usage examples.
1 parent e4620f6 commit 6532637

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

sycl/doc/extensions/proposed/sycl_ext_oneapi_barrier.asciidoc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,16 @@ namespace sycl::ext::oneapi::experimental {
129129
public:
130130
using arrival_token = __unspecified__;
131131
132-
static constexpr ptrdiff_t max() noexcept;
132+
static constexpr std::ptrdiff_t max() noexcept;
133133
134-
constexpr explicit barrier(ptrdiff_t expected,
134+
constexpr explicit barrier(std::ptrdiff_t expected,
135135
CompletionFunction f = CompletionFunction());
136136
~barrier();
137137
138138
barrier(const barrier&) = delete;
139139
barrier& operator=(const barrier&) = delete;
140140
141-
[[nodiscard]] arrival_token arrive(ptrdiff_t update = 1);
141+
[[nodiscard]] arrival_token arrive(std::ptrdiff_t update = 1);
142142
void wait(arrival_token&& arrival) const;
143143
144144
void arrive_and_wait();
@@ -150,14 +150,14 @@ namespace sycl::ext::oneapi::experimental {
150150

151151
[source,c++]
152152
----
153-
static constexpr ptrdiff_t max() noexcept;
153+
static constexpr std::ptrdiff_t max() noexcept;
154154
----
155155
_Returns_: The maximum number of threads of execution that can be synchronized
156156
by any `barrier` with the specified `Scope` and `CompletionFunction`.
157157

158158
[source,c++]
159159
----
160-
constexpr explicit barrier(ptrdiff_t expected, CompletionFunction f = CompletionFunction());
160+
constexpr explicit barrier(std::ptrdiff_t expected, CompletionFunction f = CompletionFunction());
161161
----
162162
_Preconditions_: If `Scope` is `memory_scope::work_group`, the calling thread
163163
of execution must be a work-item belonging to the work-group that will use the
@@ -184,7 +184,7 @@ concurrently introduces a data race.
184184

185185
[source,c++]
186186
----
187-
[[nodiscard]] arrival_token arrive(ptrdiff_t update = 1);
187+
[[nodiscard]] arrival_token arrive(std::ptrdiff_t update = 1);
188188
----
189189
_Effects_: The calling thread of execution arrives at the barrier and decreases
190190
the expected count by `update`.
@@ -240,6 +240,7 @@ extension.
240240

241241
[source,c++]
242242
----
243+
namespace syclex = sycl::ext::oneapi::experimental;
243244
using work_group_barrier = syclex::barrier<sycl::memory_scope::work_group>;
244245
245246
q.parallel_for(..., [=](sycl::nd_item it) {
@@ -264,6 +265,7 @@ initialized on the device that will use the barrier.
264265

265266
[source,c++]
266267
----
268+
namespace syclex = sycl::ext::oneapi::experimental;
267269
using device_barrier = syclex::barrier<sycl::memory_scope::device>;
268270
269271
// Allocate memory for the barrier
@@ -306,6 +308,7 @@ accessible by the host.
306308

307309
[source,c++]
308310
----
311+
namespace syclex = sycl::ext::oneapi::experimental;
309312
using system_barrier = syclex::barrier<sycl::memory_scope::system>;
310313
311314
// Allocate memory for the barrier

0 commit comments

Comments
 (0)