Skip to content

Commit b5b7143

Browse files
[oneDPL][RNG] Add Philox engine to the oneAPI spec
1 parent e36aad1 commit b5b7143

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

source/elements/oneDPL/source/sycl_kernels_api.rst

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Supported Functionality
2727
- Engine class templates:
2828
- ``linear_congruential_engine``
2929
- ``subtract_with_carry_engine``
30+
- ``philox_engine``
3031
- Engine adaptor class templates:
3132
- ``discard_block_engine``
3233
- Engines and engine adaptors with predefined parameters:
@@ -36,6 +37,8 @@ Supported Functionality
3637
- ``ranlux48_base``
3738
- ``ranlux24``
3839
- ``ranlux48``
40+
- ``philox4x32``
41+
- ``philox4x64``
3942
- Distribution class templates:
4043
- ``uniform_int_distribution``
4144
- ``uniform_real_distribution``
@@ -48,7 +51,7 @@ Supported Functionality
4851
- ``cauchy_distribution``
4952
- ``extreme_value_distribution``
5053

51-
``linear_congruential_engine`` and ``subtract_with_carry_engine`` satisfy the uniform random bit generator requirements.
54+
``linear_congruential_engine``, ``subtract_with_carry_engine``, and ``philox_engine`` satisfy the uniform random bit generator requirements.
5255

5356
Limitations
5457
-----------
@@ -82,7 +85,7 @@ The ``scalar_type`` is used instead of ``result_type`` in all contexts where a s
8285
Since ``scalar_type`` is the same as ``result_type`` except for template instantiations with ``sycl::vec``,
8386
class templates still meet the applicable requirements of the `C++ Standard`_.
8487

85-
When instantiated with ``sycl::vec<Type,N>``, ``linear_congruential_engine`` and ``subtract_with_carry_engine`` may not
88+
When instantiated with ``sycl::vec<Type,N>``, ``linear_congruential_engine``, ``subtract_with_carry_engine``, and ``philox_engine`` may not
8689
formally satisfy the uniform random bit generator requirements defined by the `C++ Standard`_. Instead, the following
8790
alternative requirements apply: for an engine object ``g`` of type ``G``,
8891

@@ -105,7 +108,7 @@ The following engines and engine adaptors with predefined parameters are defined
105108
.. code:: cpp
106109
107110
template <int N>
108-
using minstd_rand0_vec = linear_congruential_engine<sycl::vec<::std::uint_fast32_t, N>, 16807, 0, 2147483647>;
111+
using minstd_rand0_vec = linear_congruential_engine<sycl::vec<uint_fast32_t, N>, 16807, 0, 2147483647>;
109112
110113
template <int N>
111114
using minstd_rand_vec = linear_congruential_engine<sycl::vec<uint_fast32_t, N>, 48271, 0, 2147483647>;
@@ -122,6 +125,14 @@ The following engines and engine adaptors with predefined parameters are defined
122125
template <int N>
123126
using ranlux48_vec = discard_block_engine<ranlux48_base_vec<N>, 389, 11>;
124127
128+
template <int N>
129+
using philox4x32_vec =
130+
philox_engine<sycl::vec<uint_fast32_t, N>, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85>;
131+
132+
template <int N>
133+
using philox4x64_vec = philox_engine<sycl::vec<uint_fast64_t, N>, 64, 4, 10, 0xCA5A826395121157, 0x9E3779B97F4A7C15,
134+
0xD2E7470EE14C6C93, 0xBB67AE8584CAA73B>;
135+
125136
Except for producing a ``sycl::vec`` of random values per invocation, the behavior of these engines is equivalent to
126137
the corresponding scalar engines, as described in the following table:
127138

@@ -151,7 +162,12 @@ the corresponding scalar engines, as described in the following table:
151162
* - ``ranlux48_vec``
152163
- ``ranlux48``
153164
- 1112339016
154-
165+
* - ``philox4x32_vec``
166+
- ``philox4x32``
167+
- 1955073260
168+
* - ``philox4x64_vec``
169+
- ``philox4x64``
170+
- 3409172418970261260
155171

156172
Function Objects
157173
++++++++++++++++

0 commit comments

Comments
 (0)