Skip to content

Commit 56e5a7e

Browse files
ValentinaKatsdcbenitoSergeyKopienkodmitriy-sobolevNikita Semin
authored
oneDPL 2021.7.1 commits (#618)
* Added pkg-config support info to GSG (#543) Signed-off-by: Dylan Benito <[email protected]> (cherry picked from commit 527fbca) * Make BidirectionalIterator from tests fulfill Iterator requirements (#546) * test/support/iterator_utils.h - Fix error in BidirectionalIterator::operator++() * test/support/iterator_utils.h - Fix error in BidirectionalIterator::operator--() (cherry picked from commit 86b85bb) * Fix inclusive_scan_by_segment.pass failure on HOST device, icpc compiler with wrong effect error (#551) Fix inclusive_scan_by_segment.pass failure on HOST device, icpc compiler with wrong effect error (cherry picked from commit f849e71) * Add comment for test offset const (#503) Add comment for test offset constants (cherry picked from commit faf4f2d) * Support of USM shared/device memory in tests (#491) Implemented support of USM shared/device memory in tests. Fixed UB in tests when we use temporary SYCL buffer and accessor to get data from device. (cherry picked from commit a36fec1) * Skip testing fp16/fp64 types if not supported by a device (#461) The limitation is that wrapper-like types are not properly handled; the most important one is zip_iterator Signed-off-by: Sobolev, Dmitriy <[email protected]> (cherry picked from commit f06c51d) * [RNG] Enable skip of DP where not supported (#556) Disabled DP tests on Devices without DP support for RNG component Aligned file permissions and line endings for RNG tests (cherry picked from commit a3476ef) * Add shortcut for oneapi::dpl into public headers (#558) Added shortcut for oneapi::dpl into public headers: namespace dpl = oneapi::dpl; (cherry picked from commit 85dc7fd) * Fix the definition of _ONEDPL_USE_PREDEFINED_POLICIES (#562) * Fix the definition of _ONEDPL_USE_PREDEFINED_POLICIES * Make name of internal macro more distinguishable from public one Co-authored-by: Ruslan Arutyunyan <[email protected]> (cherry picked from commit 93167ef) * Eliminate extra work in CI (#568) * Eliminate extra work in CI (cherry picked from commit 80cb033) * Do not call destructors for trivially destructible types (#567) Removed destructors calls for trivially destructible types. (cherry picked from commit 36343bf) * Update requirements.txt (#589) (cherry picked from commit 6b8ec04) * Update version for oneDPL 2021.7.1 (#593) * Update onedpl_config.h * Update version.pass.cpp (cherry picked from commit 39a3d4f) * Support zip_iterator construction from tuple of iterators (#588) * Support zip_iterator construction from tuple of iterators. * Update test to exercise new function. (cherry picked from commit 83fb771) * [oneDPL][ranges] Added assertion on buffer size check (a couple of iterators to a range) (cherry picked from commit e6ec6c3) * [oneDPL][examples] + fix a error in histogram example (#559) (cherry picked from commit cc843c1) * [oneDPL][examples] Fixed a buffer size error in histogram example (cherry picked from commit 05a3844) * Correct permutation_iterator example's index map function. (#579) (cherry picked from commit a6b26f4) * Add serial sort algorithm to oneapi::dpl (#441) Signed-off-by: haonanya <[email protected]> (cherry picked from commit 7633483) (cherry picked from commit 54ad8a5) * Add serial heap algorithm to oneapi::dpl (#336) Signed-off-by: haonanya <[email protected]> (cherry picked from commit 4892145) (cherry picked from commit ff7257f) * Workaround of compile error in clang < 13.0 (cherry picked from commit 1131808) * Change order of partial_sort declarations in include/oneapi/dpl/pstl/glue_algorithm_defs.h (cherry picked from commit c089b97) * Change order of partial_sort_copy declarations in include/oneapi/dpl/pstl/glue_algorithm_defs.h (cherry picked from commit 98f8c34) * Change order of is_sorted_until declarations in include/oneapi/dpl/pstl/glue_algorithm_defs.h (cherry picked from commit 948eb59) * Change order of is_sorted declarations in include/oneapi/dpl/pstl/glue_algorithm_defs.h (cherry picked from commit 4222756) * Change order of is_heap_until declarations in include/oneapi/dpl/pstl/glue_algorithm_defs.h (cherry picked from commit 62d716d) * Change order of is_heap declarations in include/oneapi/dpl/pstl/glue_algorithm_defs.h (cherry picked from commit dde9ffb) * Add comments for partial_sort function (cherry picked from commit 024c630) * Add comments for partial_sort_copy (cherry picked from commit e9c3370) * Add comments for is_sorted and is_sorted_until functions (cherry picked from commit d5c23be) * Add comments for is_heap and is_heap_until functions (cherry picked from commit 58198ef) * Change order of is_sorted and is_sorted_until in include/oneapi/dpl/pstl/glue_algorithm_defs.h (cherry picked from commit ad7a595) * Change order of is_heap and is_heap_until in include/oneapi/dpl/pstl/glue_algorithm_defs.h (cherry picked from commit ecd5bba) * Fix review comment: use dpl::is_sorted_until instead of std::is_sorted_until (cherry picked from commit 36426dd) * Add tests for std::nearbyint, std::nearbyintf (#596) [oneDPL] Added nearbyint, nearbyintf support to oneapi::dpl (cherry picked from commit f3f593e) * [oneDPL] + a fix for in-place scan, dpcpp policy, a test was added as well (cherry picked from commit 7595b51) * [oneDPL][test] + test coverage extention for in-place scan (cherry picked from commit 8f9190b) * Fix error in permutation iterator (#600) [oneDPL] + Fix error in permutation iterator [oneDPL][test] + Prepare new test exclusive_scan_by_segment_perm_it.pass.cpp (cherry picked from commit 70fdaeb) * [oneDPL] + Return from reduce_by_segment if source data is empty (#604) (cherry picked from commit c2b8326) * Fix error in reduce_by_key algorithm (#609) [oneDPL][tests] Add test for reduce_by_key check [oneDPL] Fix error in reduce_by_key algorithm (cherry picked from commit 43066fa) * [oneDPL][test] + in_place_scan test fixes (cherry picked from commit 9e32043) * [oneDPL][test] compilation fixes for in_place_scan test (cherry picked from commit 9d3d54d) * Update documentation version for oneDPL 2021.7.1 (#613) (cherry picked from commit fa76f8e) * Updated doc structure (#612) Updated with GSG and Library Guide section headers, moved content, etc. Signed-off-by: Dylan Benito <[email protected]> (cherry picked from commit 7621c19) * Update release notes for oneDPL 2021.7.1 (#619) * Update release_notes.rst * Update release_notes.rst * Update release_notes.rst * Update release_notes.rst * Address review feedback * Address review feedback (cherry picked from commit 948f735) Co-authored-by: Dylan <[email protected]> Co-authored-by: Sergey Kopienko <[email protected]> Co-authored-by: Dmitriy Sobolev <[email protected]> Co-authored-by: Nikita Semin <[email protected]> Co-authored-by: Alexey Kukanov <[email protected]> Co-authored-by: KseniiaBakina <[email protected]> Co-authored-by: Timmie Smith <[email protected]> Co-authored-by: MikeDvorskiy <[email protected]> Co-authored-by: haonanya <[email protected]>
1 parent df96969 commit 56e5a7e

File tree

118 files changed

+11088
-7284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+11088
-7284
lines changed

.github/workflows/ci.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,14 @@ jobs:
220220
shell: cmd
221221
run: |
222222
call %CONDA%/condabin/conda.bat activate base
223-
IF "${{ matrix.backend }}" == "dpcpp" (
223+
if "${{ matrix.backend }}" == "dpcpp" (
224224
set ninja_targets=sycl_iterator.pass
225225
set ctest_flags=-R sycl_iterator.pass
226226
echo ::warning::dpcpp backend is set. Compile and run only sycl_iterator.pass
227-
)
228-
ELSE (
227+
) else (
229228
set ninja_targets=build-onedpl-tests
230229
)
231-
IF "${{ matrix.cxx_compiler }}" == "dpcpp" (
230+
if "${{ matrix.cxx_compiler }}" == "dpcpp" (
232231
powershell $output = dpcpp --version; Write-Host ::warning::Compiler: $output
233232
set toolchain_option=-DCMAKE_TOOLCHAIN_FILE=../cmake/windows-dpcpp-toolchain.cmake
234233
)

documentation/library_guide/api_for_sycl_kernels/tested_standard_cpp_api.rst

+22
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ C++ Standard API libstdc++ libc++ MSVC
315315
------------------------------------ ---------- ---------- ----------
316316
``std::nextafter`` Tested Tested Tested
317317
------------------------------------ ---------- ---------- ----------
318+
``std::nearbyint`` Tested Tested Tested
319+
------------------------------------ ---------- ---------- ----------
320+
``std::nearbyintf`` Tested Tested Tested
321+
------------------------------------ ---------- ---------- ----------
318322
``std::fdim`` Tested Tested Tested
319323
------------------------------------ ---------- ---------- ----------
320324
``std::optional`` Tested Tested Tested
@@ -358,6 +362,24 @@ C++ Standard API libstdc++ libc++ MSVC
358362
``std::move`` Tested Tested Tested
359363
------------------------------------ ---------- ---------- ----------
360364
``std::move_backward`` Tested Tested Tested
365+
------------------------------------ ---------- ---------- ----------
366+
``std::is_sorted`` Tested Tested Tested
367+
------------------------------------ ---------- ---------- ----------
368+
``std::is_sorted_until`` Tested Tested Tested
369+
------------------------------------ ---------- ---------- ----------
370+
``std::partial_sort`` Tested Tested Tested
371+
------------------------------------ ---------- ---------- ----------
372+
``std::partial_sort_copy`` Tested Tested Tested
373+
------------------------------------ ---------- ---------- ----------
374+
``std::is_heap`` Tested Tested Tested
375+
------------------------------------ ---------- ---------- ----------
376+
``std::is_heap_until`` Tested Tested Tested
377+
------------------------------------ ---------- ---------- ----------
378+
``std::make_heap`` Tested Tested Tested
379+
------------------------------------ ---------- ---------- ----------
380+
``std::push_heap`` Tested Tested Tested
381+
------------------------------------ ---------- ---------- ----------
382+
``std::pop_heap`` Tested Tested Tested
361383
==================================== ========== ========== ==========
362384

363385
These tests were done for the following versions of the standard C++ library:

documentation/library_guide/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
author = 'Intel'
3838

3939
# The full version, including alpha/beta/rc tags
40-
release = '2021.7'
40+
release = '2021.7.1'
4141

4242
rst_epilog = """
4343
.. include:: /variables.txt

documentation/library_guide/index.rst

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
|onedpl_long| Guide
1+
|onedpl_long|
22
=================================
33

44
|onedpl_long| (|onedpl_short|) works with the |dpcpp_cpp| to
@@ -7,13 +7,22 @@ efforts across devices for high performance parallel applications.
77

88
.. toctree::
99
:maxdepth: 2
10-
:titlesonly:
11-
:glob:
12-
:hidden:
10+
:caption: Get Started
11+
12+
introduction/release_notes.rst
13+
introduction/onedpl_gsg.rst
14+
15+
.. toctree::
16+
:maxdepth: 2
17+
:caption: Library Guide
1318

14-
onedpl_gsg
1519
overview
1620
parallel_api_main
1721
api_for_sycl_kernels_main
1822
macros
19-
notices_disclaimers
23+
24+
.. toctree::
25+
:hidden:
26+
:caption: Notices and Disclaimers
27+
28+
notices_disclaimers.rst
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
Get Started with the |onedpl_long|
2+
##################################
3+
4+
|onedpl_long| (|onedpl_short|) works with the
5+
`Intel® oneAPI DPC++/C++ Compiler <https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-dpcpp-compiler/top.html>`_
6+
to provide high-productivity APIs to developers, which can minimize SYCL*
7+
programming efforts across devices for high performance parallel applications.
8+
9+
|onedpl_short| consists of the following components:
10+
11+
* Parallel API
12+
* API for SYCL Kernels
13+
* Macros
14+
15+
16+
For general information about |onedpl_short|, visit the `oneDPL GitHub* repository <https://github.com/oneapi-src/oneDPL>`_,
17+
or visit the `Intel® oneAPI DPC++ Library Guide <https://software.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-library-guide/top.html>`_
18+
and the `Intel® oneAPI DPC++ Library main page <https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/dpc-library.html>`_.
19+
20+
Before You Begin
21+
================
22+
23+
Visit the |onedpl_short| `Release Notes
24+
<https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-library-release-notes.html>`_
25+
page for:
26+
27+
* Where to Find the Release
28+
* Overview
29+
* New Features
30+
* Fixed Issues
31+
* Known Issues and Limitations
32+
33+
Install the `Intel® oneAPI Base Toolkit (Base Kit) <https://software.intel.com/en-us/oneapi/base-kit>`_
34+
to use |onedpl_short|.
35+
36+
To use Parallel API, include the corresponding header files in your source code.
37+
38+
All |onedpl_short| header files are in the ``oneapi/dpl`` directory. Use ``#include <oneapi/dpl/…>`` to include them.
39+
|onedpl_short| uses the namespace ``oneapi::dpl`` for most its classes and functions.
40+
41+
To use tested C++ standard APIs, you need to include the corresponding C++ standard header files
42+
and use the ``std`` namespace.
43+
44+
45+
pkg-config Support
46+
==================
47+
48+
The pkg-config program is used to retrieve information about your installed libraries, and
49+
to compile and link against one or more libraries.
50+
51+
Use pkg-config with |onedpl_short|
52+
----------------------------------
53+
54+
Use pkg-config with the ``--cflags`` flag to get the include path to the oneDPL directory:
55+
56+
.. code:: cpp
57+
58+
dpcpp test.cpp $(pkg-config --cflags dpl)
59+
60+
The ``--msvc-syntax`` flag is required when you use a Microsoft Visual C++* compiler.
61+
This flag converts your compiling and linking flags to the appropriate form:
62+
63+
.. code:: cpp
64+
65+
dpcpp test.cpp $(pkg-config --msvc-syntax --cflags dpl)
66+
67+
.. note::
68+
Use the pkg-config tool to get rid of large hard-coded paths and make compilation more portable.
69+
70+
71+
Usage Examples
72+
==============
73+
74+
|onedpl_short| sample code is available from the
75+
`oneAPI GitHub samples repository <https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneDPL>`_.
76+
Each sample includes a readme with build instructions.
77+
78+
\<oneapi/dpl/random\> Header Usage Example
79+
------------------------------------------
80+
81+
This example illustrates |onedpl_short| random number generator usage.
82+
The sample below shows you how to create an random number generator engine object (the source of pseudo-randomness),
83+
a distribution object (specifying the desired probability distribution), and how to generate
84+
the random numbers themselves. Random number generation is performed in a vectorized manner
85+
to improve the speed of your computations.
86+
87+
This example performs its computations on your default SYCL device. You can set the
88+
``SYCL_DEVICE_TYPE`` environment variable to CPU or GPU.
89+
90+
.. code:: cpp
91+
92+
template<int VecSize>
93+
void random_fill(float* usmptr, std::size_t n) {
94+
auto zero = oneapi::dpl::counting_iterator<std::size_t>(0);
95+
96+
std::for_each(oneapi::dpl::execution::dpcpp_default,
97+
zero, zero + n/VecSize,
98+
[usmptr](std::size_t i) {
99+
auto offset = i * VecSize;
100+
101+
oneapi::dpl::minstd_rand_vec<VecSize> engine(seed, offset);
102+
oneapi::dpl::uniform_real_distribution<sycl::vec<float, VecSize>> distr;
103+
104+
auto res = distr(engine);
105+
res.store(i, sycl::global_ptr<float>(usmptr));
106+
});
107+
}
108+
109+
Pi Benchmark Usage Example
110+
--------------------------
111+
112+
This example uses a Monte Carlo method to estimate the value of π.
113+
The basic idea is to generate random points within a square, and to check what
114+
fraction of these random points lie in a quarter-circle inscribed within that square.
115+
The expected value is the ratio of the areas of the quarter-circle and the square (π/4).
116+
You can take the observed fraction of points in the quarter-circle as an estimate of π/4.
117+
118+
This example shows you how to create an random number generator engine object (the source of pseudo-randomness),
119+
a distribution object (specifying the desired probability distribution), generate the
120+
random numbers themselves, and then perform a reduction to count quantity of points that
121+
fit into the square *S*. Random number generation is performed in scalar manner to simplify your code.
122+
123+
124+
.. figure:: images/pi_benchmark.png
125+
:alt: An image of pi chart.
126+
127+
.. code:: cpp
128+
129+
float estimated_pi;
130+
{
131+
sycl::queue q(sycl::gpu_selector{});
132+
auto policy = oneapi::dpl::execution::make_device_policy(q);
133+
134+
float sum = std::transform_reduce( policy,
135+
oneapi::dpl::counting_iterator<int>(0),
136+
oneapi::dpl::counting_iterator<int>(N),
137+
0.0f,
138+
std::plus<float>{},
139+
[=](int n){
140+
float local_sum = 0.0f;
141+
oneapi::dpl::minstd_rand engine(SEED, n * ITER * 2);
142+
oneapi::dpl::uniform_real_distribution<float> distr;
143+
for(int i = 0; i < ITER; ++i) {
144+
float x = distr(engine);
145+
float y = distr(engine);
146+
if (x * x + y * y <= 1.0)
147+
local_sum += 1.0;
148+
}
149+
return local_sum / (float)ITER;
150+
}
151+
);
152+
estimated_pi = 4.0f * (float)sum / N;
153+
}
154+
155+
156+
Find More
157+
=========
158+
159+
.. list-table::
160+
:widths: 50 50
161+
:header-rows: 1
162+
163+
* - Resource Link
164+
- Description
165+
* - `Intel® oneAPI DPC++ Library Guide <https://software.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-library-guide/top.html>`_
166+
- Refer to the |onedpl_short| guide for more in depth information.
167+
* - `System Requirements <https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-system-requirements.html>`_
168+
- Check system requirements before you install |onedpl_short|.
169+
* - `Intel® oneAPI DPC++ Library Release Notes <https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-library-release-notes.html>`_
170+
- Check the release notes to learn about updates in the latest release.
171+
* - `oneDPL Samples <https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneDPL>`_
172+
- Learn how to use |onedpl_short| with samples.
173+
* - `Layers for Yocto* Project <https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-iot-linux/top/adding-oneapi-components-to-yocto-project-builds.html>`_
174+
- Add oneAPI components to a Yocto project build using the meta-intel layers.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. |release_notes| replace:: |onedpl_long| Release Notes
2+
.. _release_notes: https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-dpcpp-library-release-notes.html
3+
4+
=============
5+
Release Notes
6+
=============
7+
8+
Refer to |release_notes|_.

documentation/library_guide/parallel_api/iterators.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ header. All iterators are implemented in the ``oneapi::dpl`` namespace.
9999

100100
struct multiply_index_by_two {
101101
template <typename Index>
102-
Index operator()(const Index& i)
102+
Index operator[](const Index& i) const
103103
{ return i*2; }
104104
};
105105

Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
breathe==4.9.1
22
sphinx==3.4.0
3+
jinja2<3.1
34
docutils>=0.15
45
sphinx_book_theme
56
sphinx-intl==2.0.0
67
sphinx-tabs
78
sphinx-prompt
8-
sphinx_substitution_extensions
9+
sphinx_substitution_extensions

documentation/release_notes.rst

+11-12
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,23 @@ The Intel® oneAPI DPC++ Library (oneDPL) accompanies the Intel® oneAPI DPC++/C
88
and provides high-productivity APIs aimed to minimize programming efforts of C++ developers
99
creating efficient heterogeneous applications.
1010

11-
New in 2021.7.0
11+
New in 2021.7.1
1212
===============
1313

14-
Deprecation Notice
15-
------------------
16-
- Deprecated support of C++11 for Parallel API with host execution policies (``seq``, ``unseq``, ``par``, ``par_unseq``).
17-
C++17 is the minimal required version going forward.
14+
New Features
15+
------------
16+
- Added possibility to construct a zip_iterator out of a std::tuple of iterators.
17+
- Added 9 more serial-based versions of algorithms: ``is_heap``, ``is_heap_until``, ``make_heap``, ``push_heap``, ``pop_heap``, ``is_sorted``, ``is_sorted_until``, ``partial_sort``, ``partial_sort_copy``. Please refer to `Tested Standard C++ API Reference https://github.com/oneapi-src/oneDPL/blob/main/documentation/library_guide/tested_standard_cpp_api.rst#tested-standard-c-api-reference`.
1818

1919
Fixed Issues
2020
------------
21-
- Fixed a kernel name definition error in range-based algorithms and ``reduce_by_segment`` used with
22-
a device_policy object that has no explicit kernel name.
21+
- Added namespace alias ``dpl = oneapi::dpl`` into all public headers.
22+
- Fixed error in ``reduce_by_segment`` algorithm.
23+
- Fixed errors when data size is 0 in ``upper_bound``, ``lower_bound`` and ``binary_search`` algorithms.
24+
- Fixed wrong results error in algorithms call with permutation iterator.
2325

2426
Known Issues and Limitations
2527
----------------------------
26-
New in This Release
27-
^^^^^^^^^^^^^^^^^^^
28-
- STL algorithm functions (such as ``std::for_each``) used in DPC++ kernels do not compile with the debug version of
29-
the Microsoft* Visual C++ standard library.
30-
3128
Existing Issues
3229
^^^^^^^^^^^^^^^
3330
See oneDPL Guide for other `restrictions and known limitations`_.
@@ -36,6 +33,8 @@ See oneDPL Guide for other `restrictions and known limitations`_.
3633
- ``std::array`` cannot be swapped in DPC++ kernels with ``std::swap`` function or ``swap`` member function
3734
in the Microsoft* Visual C++ standard library.
3835
- The ``oneapi::dpl::experimental::ranges::reverse`` algorithm is not available with ``-fno-sycl-unnamed-lambda`` option.
36+
- STL algorithm functions (such as ``std::for_each``) used in DPC++ kernels do not compile with the debug version of
37+
the Microsoft* Visual C++ standard library.
3938

4039
New in 2021.6.1
4140
===============

0 commit comments

Comments
 (0)