Skip to content

Commit 20a7058

Browse files
Merge branch 'main' into add-partial-sort
2 parents e51b7ca + 291376e commit 20a7058

File tree

4 files changed

+106
-15
lines changed

4 files changed

+106
-15
lines changed

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pydata-sphinx-theme==0.15.2
4141
pyenchant==3.2.2
4242
Pygments==2.17.2
4343
PyYAML==6.0.1
44-
requests==2.32.0
44+
requests==2.32.4
4545
six==1.16.0
4646
snowballstemmer==2.2.0
4747
soupsieve==2.5
@@ -62,5 +62,5 @@ sphinxcontrib-spelling==8.0.0
6262
sphinxcontrib-svg2pdfconverter==1.2.2
6363
sphinxmark==1.0.0
6464
typing_extensions==4.9.0
65-
urllib3==2.2.2
65+
urllib3==2.5.0
6666
virtualenv==20.26.6

source/elements/oneDPL/source/parallel_api.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ All those algorithms work with *C++ Standard aligned execution policies* and wit
1414
oneDPL also provides *parallel range algorithms*: variations of C++20 range-based algorithms
1515
that take a oneDPL execution policy.
1616

17+
For all parallel algorithms (including ones with ranges) oneDPL implements list-initialization, where applicable,
18+
as described in `P2248R8`_ proposal that is accepted for C++26.
19+
1720
Additionally, oneDPL provides wrapper functions for `SYCL`_ buffers, special iterators, and
1821
a set of non-standard parallel algorithms.
1922

@@ -25,6 +28,7 @@ a set of non-standard parallel algorithms.
2528
parallel_api/iterators.rst
2629
parallel_api/algorithms.rst
2730
parallel_api/parallel_range_api.rst
28-
31+
2932
.. _`C++ Standard`: https://isocpp.org/std/the-standard
3033
.. _`SYCL`: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html
34+
.. _`P2248R8`: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html

source/elements/oneDPL/source/parallel_api/parallel_range_api.rst

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ Sequence Search and Comparison
288288
namespace oneapi::dpl::ranges {
289289
290290
// equal
291-
template<typename ExecutionPolicy, std::ranges::random_access_range R1,
291+
template <typename ExecutionPolicy, std::ranges::random_access_range R1,
292292
std::ranges::random_access_range R2, typename Pred = std::ranges::equal_to,
293293
typename Proj1 = std::identity, typename Proj2 = std::identity>
294294
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
@@ -299,7 +299,7 @@ Sequence Search and Comparison
299299
Proj1 proj1 = {}, Proj2 proj2 = {});
300300
301301
// mismatch
302-
template<typename ExecutionPolicy, std::ranges::random_access_range R1,
302+
template <typename ExecutionPolicy, std::ranges::random_access_range R1,
303303
std::ranges::random_access_range R2, typename Pred = std::ranges::equal_to,
304304
typename Proj1 = std::identity, typename Proj2 = std::identity>
305305
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
@@ -312,7 +312,7 @@ Sequence Search and Comparison
312312
Proj1 proj1 = {}, Proj2 proj2 = {});
313313
314314
// find_end
315-
template<typename ExecutionPolicy, std::ranges::random_access_range R1,
315+
template <typename ExecutionPolicy, std::ranges::random_access_range R1,
316316
std::ranges::random_access_range R2, typename Pred = std::ranges::equal_to,
317317
typename Proj1 = std::identity, typename Proj2 = std::identity>
318318
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
@@ -324,7 +324,7 @@ Sequence Search and Comparison
324324
Proj1 proj1 = {}, Proj2 proj2 = {});
325325
326326
// search
327-
template<typename ExecutionPolicy, std::ranges::random_access_range R1,
327+
template <typename ExecutionPolicy, std::ranges::random_access_range R1,
328328
std::ranges::random_access_range R2, typename Pred = std::ranges::equal_to,
329329
typename Proj1 = std::identity, typename Proj2 = std::identity>
330330
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
@@ -336,7 +336,7 @@ Sequence Search and Comparison
336336
Proj1 proj1 = {}, Proj2 proj2 = {});
337337
338338
// search_n
339-
template<typename ExecutionPolicy, std::ranges::random_access_range R,
339+
template <typename ExecutionPolicy, std::ranges::random_access_range R,
340340
typename Pred = std::ranges::equal_to, typename Proj = std::identity,
341341
typename T = /*projected-value-type*/<std::ranges::iterator_t<R>, Proj>>
342342
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
@@ -346,10 +346,21 @@ Sequence Search and Comparison
346346
search_n (ExecutionPolicy&& pol, R&& r, std::ranges::range_difference_t<R> count,
347347
const T& value, Pred pred = {}, Proj proj = {});
348348
349+
// lexicographical_compare
350+
template <typename ExecutionPolicy, std::ranges::random_access_range R1,
351+
std::ranges::random_access_range R2, typename Proj1 = std::identity,
352+
typename Proj2 = std::identity,
353+
std::indirect_strict_weak_order< std::projected<std::ranges::iterator_t<R1>, Proj1>,
354+
std::projected<std::ranges::iterator_t<R2>, Proj2> >
355+
Comp = std::ranges::less>
356+
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
357+
std::ranges::sized_range<R1> && std::ranges::sized_range<R2>
358+
bool lexicographical_compare (ExecutionPolicy&& pol, R1&& r1, R2&& r2, Comp comp = {},
359+
Proj1 proj1 = {}, Proj2 proj2 = {});
349360
}
350361
351-
Sorting and Merge
352-
+++++++++++++++++
362+
Sorting, Merge, and Heap Operations
363+
+++++++++++++++++++++++++++++++++++
353364

354365
.. code:: cpp
355366
@@ -433,6 +444,34 @@ Sorting and Merge
433444
merge (ExecutionPolicy&& pol, R1&& r1, R2&& r2, OutR&& result, Comp comp = {},
434445
Proj1 proj1 = {}, Proj2 proj2 = {});
435446
447+
// inplace_merge
448+
template <typename ExecutionPolicy, std::ranges::random_access_range R,
449+
typename Comp = std::ranges::less, typename Proj = std::identity>
450+
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
451+
std::ranges::sized_range<R> && std::sortable<std::ranges::iterator_t<R>, Comp, Proj>
452+
std::ranges::borrowed_iterator_t<R>
453+
inplace_merge (ExecutionPolicy&& pol, R&& r, std::ranges::iterator_t<R> middle,
454+
Comp comp = {}, Proj proj = {});
455+
456+
// is_heap
457+
template <typename ExecutionPolicy, std::ranges::random_access_range R,
458+
typename Proj = std::identity,
459+
std::indirect_strict_weak_order< std::projected<std::ranges::iterator_t<R>, Proj> >
460+
Comp = std::ranges::less>
461+
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
462+
std::ranges::sized_range<R>
463+
bool is_heap (ExecutionPolicy&& pol, R&& r, Comp comp = {}, Proj proj = {});
464+
465+
// is_heap_until
466+
template <typename ExecutionPolicy, std::ranges::random_access_range R,
467+
typename Proj = std::identity,
468+
std::indirect_strict_weak_order< std::projected<std::ranges::iterator_t<R>, Proj> >
469+
Comp = std::ranges::less>
470+
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
471+
std::ranges::sized_range<R>
472+
std::ranges::borrowed_iterator_t<R>
473+
is_heap_until (ExecutionPolicy&& pol, R&& r, Comp comp = {}, Proj proj = {});
474+
436475
}
437476
438477
Set operations
@@ -518,6 +557,7 @@ Set operations
518557
std::ranges::borrowed_iterator_t<OutR>>
519558
set_symmetric_difference (ExecutionPolicy&& pol, R1&& r1, R2&& r2, OutR&& result,
520559
Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
560+
521561
}
522562
523563
Copying Mutating Operations
@@ -560,6 +600,31 @@ Copying Mutating Operations
560600
std::ranges::borrowed_iterator_t<OutR>>
561601
move (ExecutionPolicy&& pol, R&& r, OutR&& result);
562602
603+
// remove_copy
604+
template <typename ExecutionPolicy, std::ranges::random_access_range R,
605+
std::ranges::random_access_range OutR, typename Proj = std::identity,
606+
typename T = /*projected-value-type*/<std::ranges::iterator_t<R>, Proj>>
607+
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
608+
std::ranges::sized_range<R> && std::ranges::sized_range<OutR> &&
609+
std::indirectly_copyable<std::ranges::iterator_t<R>, std::ranges::iterator_t<OutR>> &&
610+
std::indirect_binary_predicate< std::ranges::equal_to,
611+
std::projected<std::ranges::iterator_t<R>, Proj>,
612+
const T* >
613+
std::ranges::remove_copy_result<std::ranges::borrowed_iterator_t<R>,
614+
std::ranges::borrowed_iterator_t<OutR>>
615+
remove_copy (ExecutionPolicy&& pol, R&& r, OutR&& result, const T& value, Proj proj = {});
616+
617+
// remove_copy_if
618+
template <typename ExecutionPolicy, std::ranges::random_access_range R,
619+
std::ranges::random_access_range OutR, typename Proj = std::identity,
620+
std::indirect_unary_predicate< std::projected<std::ranges::iterator_t<R>, Proj> > Pred>
621+
requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
622+
std::ranges::sized_range<R> && std::ranges::sized_range<OutR> &&
623+
std::indirectly_copyable<std::ranges::iterator_t<R>, std::ranges::iterator_t<OutR>>
624+
std::ranges::remove_copy_if_result<std::ranges::borrowed_iterator_t<R>,
625+
std::ranges::borrowed_iterator_t<OutR>>
626+
remove_copy_if (ExecutionPolicy&& pol, R&& r, OutR&& result, Pred pred, Proj proj = {});
627+
563628
// reverse_copy
564629
template <typename ExecutionPolicy, std::ranges::random_access_range R,
565630
std::ranges::random_access_range OutR>

source/elements/oneDPL/source/sycl_kernels_api.rst

Lines changed: 27 additions & 5 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,11 @@ 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+
.. note::
55+
The ``philox_engine`` class template and the corresponding predefined engines match the respective API
56+
in the working draft of the next C++ standard edition (C++26).
57+
58+
``linear_congruential_engine``, ``subtract_with_carry_engine``, and ``philox_engine`` satisfy the uniform random bit generator requirements.
5259

5360
Limitations
5461
-----------
@@ -82,7 +89,7 @@ The ``scalar_type`` is used instead of ``result_type`` in all contexts where a s
8289
Since ``scalar_type`` is the same as ``result_type`` except for template instantiations with ``sycl::vec``,
8390
class templates still meet the applicable requirements of the `C++ Standard`_.
8491

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

@@ -105,10 +112,12 @@ The following engines and engine adaptors with predefined parameters are defined
105112
.. code:: cpp
106113
107114
template <int N>
108-
using minstd_rand0_vec = linear_congruential_engine<sycl::vec<::std::uint_fast32_t, N>, 16807, 0, 2147483647>;
115+
using minstd_rand0_vec =
116+
linear_congruential_engine<sycl::vec<uint_fast32_t, N>, 16807, 0, 2147483647>;
109117
110118
template <int N>
111-
using minstd_rand_vec = linear_congruential_engine<sycl::vec<uint_fast32_t, N>, 48271, 0, 2147483647>;
119+
using minstd_rand_vec =
120+
linear_congruential_engine<sycl::vec<uint_fast32_t, N>, 48271, 0, 2147483647>;
112121
113122
template <int N>
114123
using ranlux24_base_vec = subtract_with_carry_engine<sycl::vec<uint_fast32_t, N>, 24, 10, 24>;
@@ -122,6 +131,14 @@ The following engines and engine adaptors with predefined parameters are defined
122131
template <int N>
123132
using ranlux48_vec = discard_block_engine<ranlux48_base_vec<N>, 389, 11>;
124133
134+
template <int N>
135+
using philox4x32_vec = philox_engine<sycl::vec<uint_fast32_t, N>, 32, 4, 10, 0xCD9E8D57,
136+
0x9E3779B9, 0xD2511F53, 0xBB67AE85>;
137+
138+
template <int N>
139+
using philox4x64_vec = philox_engine<sycl::vec<uint_fast64_t, N>, 64, 4, 10, 0xCA5A826395121157,
140+
0x9E3779B97F4A7C15, 0xD2E7470EE14C6C93, 0xBB67AE8584CAA73B>;
141+
125142
Except for producing a ``sycl::vec`` of random values per invocation, the behavior of these engines is equivalent to
126143
the corresponding scalar engines, as described in the following table:
127144

@@ -151,7 +168,12 @@ the corresponding scalar engines, as described in the following table:
151168
* - ``ranlux48_vec``
152169
- ``ranlux48``
153170
- 1112339016
154-
171+
* - ``philox4x32_vec``
172+
- ``philox4x32``
173+
- 1955073260
174+
* - ``philox4x64_vec``
175+
- ``philox4x64``
176+
- 3409172418970261260
155177

156178
Function Objects
157179
++++++++++++++++

0 commit comments

Comments
 (0)