Skip to content

Commit

Permalink
Fix range section
Browse files Browse the repository at this point in the history
- Clarify when constructors are available
- Fix highlighting and text in most operatorOP
  • Loading branch information
Naghasan committed Apr 15, 2024
1 parent 10fe615 commit ec2e19b
Showing 1 changed file with 44 additions and 29 deletions.
73 changes: 44 additions & 29 deletions source/iface/range.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,28 @@ It can be constructed from integers.

range();

Construct a ``SYCL`` range with the value ``0`` for each dimension

::

range(size_t dim0);

Construct a 1D ``SYCL`` with value ``dim0``.
Only available if ``Dimensions`` is equals to ``1``.

::

range(size_t dim0, size_t dim1);

Construct a 2D ``SYCL`` with value ``dim0`` and ``dim1``.
Only available if ``Dimensions`` is equals to ``2``.

::

range(size_t dim0, size_t dim1, size_t dim2);

Construct a ``SYCL`` range with the value ``0`` for each dimension
or a 1D,2D,3D range with values dim0, dim1 and dim2.
Construct a 3D ``SYCL`` with value ``dim0``, ``dim1`` and ``dim2``.
Only available if ``Dimensions`` is equals to ``3``.


================
Expand Down Expand Up @@ -94,11 +108,11 @@ Where ``OP`` is: ``+``, ``-``, ``*``, ``/``, ``%``, ``<<``,
``<=``, ``>=``.

Constructs and returns a new instance of the ``sycl::range`` class
template with the same dimensionality as ``lhs range``, where each
template with the same dimensionality as ``lhs`` range, where each
element of the new ``sycl::range`` instance is the result of an
element-wise ``OP`` operator between each element of ``lhs range``
and each element of the ``rhs range``. If the operator returns
a ``bool``, the result is the cast to ``size_t``.
element-wise ``OP`` operator between each element of ``lhs`` range
and each element of ``rhs`` range. If the element-wise operator
returns a ``bool``, the element result is the cast to ``size_t``.

::

Expand All @@ -109,11 +123,11 @@ Where ``OP`` is: ``+``, ``-``, ``*``, ``/``, ``%``, ``<<``,
``<=``, ``>=``.

Constructs and returns a new instance of the ``sycl::range`` class
template with the same dimensionality as ``lhs range``, where each
template with the same dimensionality as ``lhs`` range, where each
element of the new ``sycl::range`` instance is the result of an
element-wise ``OP`` operator between each element of this ``sycl::range``
and the ``rhs size_t``. If the operator returns a ``bool``, the
result is the cast to ``size_t``.
element-wise ``OP`` operator between each element of ``lhs`` range
and ``rhs`` ``size_t``. If the element-wise operator returns a ``bool``,
the element result is the cast to ``size_t``.

::

Expand All @@ -122,10 +136,11 @@ result is the cast to ``size_t``.
Where ``OP`` is: ``+=``, ``-=``, ``*=``, ``/=``, ``%=``,
``<<=``, ``>>=``, ``&=``, ``|=``, ``^=``.

Assigns each element of ``lhs range`` instance with the result of an
element-wise ``OP`` operator between each element of ``lhs range`` and
each element of the ``rhs range`` and returns ``lhs range``.
If the operator returns a ``bool``, the result is the cast to ``size_t``.
Assigns each element of ``lhs`` range instance with the result of an
element-wise ``OP`` operator between each element of ``lhs`` range and
each element of ``rhs`` range and returns ``lhs``.
If the element-wise operator returns a ``bool``, the element result
is the cast to ``size_t``.

::

Expand All @@ -134,10 +149,10 @@ If the operator returns a ``bool``, the result is the cast to ``size_t``.
Where ``OP`` is: ``+=``, ``-=``, ``*=``, ``/=``, ``%=``,
``<<=``, ``>>=``, ``&=``, ``|=``, ``^=``.

Assigns each element of ``lhs range`` instance with the result of an
element-wise ``OP`` operator between each element of ``lhs range``
and the ``rhs size_t`` and returns ``lhs range``. If the operator
returns a ``bool``, the result is the cast to ``size_t``.
Assigns each element of ``lhs`` instance with the result of an
element-wise ``OP`` operator between each element of ``lhs`` range
and ``rhs`` ``size_t`` and returns ``lhs``. If the element-wise operator
returns a ``bool``, the element result is the cast to ``size_t``.

::

Expand All @@ -148,11 +163,11 @@ Where ``OP`` is: ``+``, ``-``, ``*``, ``/``, ``%``, ``<<``,
``<=``, ``>=``.

Constructs and returns a new instance of the ``sycl::range``
class template with the same dimensionality as the ``rhs`` ``sycl::range``,
class template with the same dimensionality as the ``rhs`` range,
where each element of the new ``sycl::range`` instance is the result
of an element-wise ``OP`` operator between the ``lhs size_t``
and each element of the ``rhs`` ``sycl::range``. If the operator
returns a ``bool``, the result is the cast to ``size_t``.
of an element-wise ``OP`` operator between the ``lhs`` ``size_t``
and each element of the ``rhs`` range. If the element-wise operator
returns a ``bool``, the element result is the cast to ``size_t``.

::

Expand All @@ -161,27 +176,27 @@ returns a ``bool``, the result is the cast to ``size_t``.
Where ``OP`` is: unary ``+``, unary ``-``.

Constructs and returns a new instance of the ``sycl::range`` class
template with the same dimensionality as the ``rhs`` ``sycl::range``,
template with the same dimensionality as the ``rhs`` range,
where each element of the new ``sycl::range`` instance is the result
of an element-wise ``OP`` operator on the ``rhs``
``sycl::range``.
range.

::

sycl::range& operatorOP(sycl::range& rhs);

Where ``OP`` is: prefix ``++``, prefix ``--``.

Assigns each element of the ``rhs range`` instance with the result of an
element-wise ``OP`` operator on each element of the ``rhs range``
and returns this ``sycl::range``.
Assigns each element of the ``rhs`` range instance with the result of an
element-wise ``OP`` operator on each element of the ``rhs`` range
and returns ``rhs``.

::

range operatorOP(sycl::range& lhs, int);

Where ``OP`` is: postfix ``++``, postfix ``--``.

Make a copy of the ``lhs range``. Assigns each element of the ``lhs range``
Make a copy of the ``lhs`` range. Assigns each element of the ``lhs`` range
instance with the result of an element-wise ``OP`` operator on each element
of the ``lhs range``. Then return the initial copy of the ``sycl::range``.
of the ``lhs`` range. Then return the initial copy of the ``sycl::range``.

0 comments on commit ec2e19b

Please sign in to comment.