Skip to content

Commit

Permalink
[SYCL][Doc] Fix ptrdiff_t type namespace qualifier (#14888)
Browse files Browse the repository at this point in the history
ptrdiff_t is declared in std namespace.

Define syclex namespace alias used in the usage examples.
  • Loading branch information
bader authored Aug 1, 2024
1 parent e4620f6 commit 6532637
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions sycl/doc/extensions/proposed/sycl_ext_oneapi_barrier.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ namespace sycl::ext::oneapi::experimental {
public:
using arrival_token = __unspecified__;
static constexpr ptrdiff_t max() noexcept;
static constexpr std::ptrdiff_t max() noexcept;
constexpr explicit barrier(ptrdiff_t expected,
constexpr explicit barrier(std::ptrdiff_t expected,
CompletionFunction f = CompletionFunction());
~barrier();
barrier(const barrier&) = delete;
barrier& operator=(const barrier&) = delete;
[[nodiscard]] arrival_token arrive(ptrdiff_t update = 1);
[[nodiscard]] arrival_token arrive(std::ptrdiff_t update = 1);
void wait(arrival_token&& arrival) const;
void arrive_and_wait();
Expand All @@ -150,14 +150,14 @@ namespace sycl::ext::oneapi::experimental {

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

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

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

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

[source,c++]
----
namespace syclex = sycl::ext::oneapi::experimental;
using device_barrier = syclex::barrier<sycl::memory_scope::device>;
// Allocate memory for the barrier
Expand Down Expand Up @@ -306,6 +308,7 @@ accessible by the host.

[source,c++]
----
namespace syclex = sycl::ext::oneapi::experimental;
using system_barrier = syclex::barrier<sycl::memory_scope::system>;
// Allocate memory for the barrier
Expand Down

0 comments on commit 6532637

Please sign in to comment.