Skip to content

Commit

Permalink
oneDPL 2021.7.1 commits (#618)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
10 people authored Nov 8, 2022
1 parent df96969 commit 56e5a7e
Show file tree
Hide file tree
Showing 118 changed files with 11,088 additions and 7,284 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,14 @@ jobs:
shell: cmd
run: |
call %CONDA%/condabin/conda.bat activate base
IF "${{ matrix.backend }}" == "dpcpp" (
if "${{ matrix.backend }}" == "dpcpp" (
set ninja_targets=sycl_iterator.pass
set ctest_flags=-R sycl_iterator.pass
echo ::warning::dpcpp backend is set. Compile and run only sycl_iterator.pass
)
ELSE (
) else (
set ninja_targets=build-onedpl-tests
)
IF "${{ matrix.cxx_compiler }}" == "dpcpp" (
if "${{ matrix.cxx_compiler }}" == "dpcpp" (
powershell $output = dpcpp --version; Write-Host ::warning::Compiler: $output
set toolchain_option=-DCMAKE_TOOLCHAIN_FILE=../cmake/windows-dpcpp-toolchain.cmake
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ C++ Standard API libstdc++ libc++ MSVC
------------------------------------ ---------- ---------- ----------
``std::nextafter`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::nearbyint`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::nearbyintf`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::fdim`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::optional`` Tested Tested Tested
Expand Down Expand Up @@ -358,6 +362,24 @@ C++ Standard API libstdc++ libc++ MSVC
``std::move`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::move_backward`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::is_sorted`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::is_sorted_until`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::partial_sort`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::partial_sort_copy`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::is_heap`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::is_heap_until`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::make_heap`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::push_heap`` Tested Tested Tested
------------------------------------ ---------- ---------- ----------
``std::pop_heap`` Tested Tested Tested
==================================== ========== ========== ==========

These tests were done for the following versions of the standard C++ library:
Expand Down
2 changes: 1 addition & 1 deletion documentation/library_guide/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
author = 'Intel'

# The full version, including alpha/beta/rc tags
release = '2021.7'
release = '2021.7.1'

rst_epilog = """
.. include:: /variables.txt
Expand Down
21 changes: 15 additions & 6 deletions documentation/library_guide/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
|onedpl_long| Guide
|onedpl_long|
=================================

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

.. toctree::
:maxdepth: 2
:titlesonly:
:glob:
:hidden:
:caption: Get Started

introduction/release_notes.rst
introduction/onedpl_gsg.rst

.. toctree::
:maxdepth: 2
:caption: Library Guide

onedpl_gsg
overview
parallel_api_main
api_for_sycl_kernels_main
macros
notices_disclaimers

.. toctree::
:hidden:
:caption: Notices and Disclaimers

notices_disclaimers.rst
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
174 changes: 174 additions & 0 deletions documentation/library_guide/introduction/onedpl_gsg.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
Get Started with the |onedpl_long|
##################################

|onedpl_long| (|onedpl_short|) works with the
`Intel® oneAPI DPC++/C++ Compiler <https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-dpcpp-compiler/top.html>`_
to provide high-productivity APIs to developers, which can minimize SYCL*
programming efforts across devices for high performance parallel applications.

|onedpl_short| consists of the following components:

* Parallel API
* API for SYCL Kernels
* Macros


For general information about |onedpl_short|, visit the `oneDPL GitHub* repository <https://github.com/oneapi-src/oneDPL>`_,
or visit the `Intel® oneAPI DPC++ Library Guide <https://software.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-library-guide/top.html>`_
and the `Intel® oneAPI DPC++ Library main page <https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/dpc-library.html>`_.

Before You Begin
================

Visit the |onedpl_short| `Release Notes
<https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-library-release-notes.html>`_
page for:

* Where to Find the Release
* Overview
* New Features
* Fixed Issues
* Known Issues and Limitations

Install the `Intel® oneAPI Base Toolkit (Base Kit) <https://software.intel.com/en-us/oneapi/base-kit>`_
to use |onedpl_short|.

To use Parallel API, include the corresponding header files in your source code.

All |onedpl_short| header files are in the ``oneapi/dpl`` directory. Use ``#include <oneapi/dpl/…>`` to include them.
|onedpl_short| uses the namespace ``oneapi::dpl`` for most its classes and functions.

To use tested C++ standard APIs, you need to include the corresponding C++ standard header files
and use the ``std`` namespace.


pkg-config Support
==================

The pkg-config program is used to retrieve information about your installed libraries, and
to compile and link against one or more libraries.

Use pkg-config with |onedpl_short|
----------------------------------

Use pkg-config with the ``--cflags`` flag to get the include path to the oneDPL directory:

.. code:: cpp
dpcpp test.cpp $(pkg-config --cflags dpl)
The ``--msvc-syntax`` flag is required when you use a Microsoft Visual C++* compiler.
This flag converts your compiling and linking flags to the appropriate form:

.. code:: cpp
dpcpp test.cpp $(pkg-config --msvc-syntax --cflags dpl)
.. note::
Use the pkg-config tool to get rid of large hard-coded paths and make compilation more portable.


Usage Examples
==============

|onedpl_short| sample code is available from the
`oneAPI GitHub samples repository <https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneDPL>`_.
Each sample includes a readme with build instructions.

\<oneapi/dpl/random\> Header Usage Example
------------------------------------------

This example illustrates |onedpl_short| random number generator usage.
The sample below shows you how to create an random number generator engine object (the source of pseudo-randomness),
a distribution object (specifying the desired probability distribution), and how to generate
the random numbers themselves. Random number generation is performed in a vectorized manner
to improve the speed of your computations.

This example performs its computations on your default SYCL device. You can set the
``SYCL_DEVICE_TYPE`` environment variable to CPU or GPU.

.. code:: cpp
template<int VecSize>
void random_fill(float* usmptr, std::size_t n) {
auto zero = oneapi::dpl::counting_iterator<std::size_t>(0);
std::for_each(oneapi::dpl::execution::dpcpp_default,
zero, zero + n/VecSize,
[usmptr](std::size_t i) {
auto offset = i * VecSize;
oneapi::dpl::minstd_rand_vec<VecSize> engine(seed, offset);
oneapi::dpl::uniform_real_distribution<sycl::vec<float, VecSize>> distr;
auto res = distr(engine);
res.store(i, sycl::global_ptr<float>(usmptr));
});
}
Pi Benchmark Usage Example
--------------------------

This example uses a Monte Carlo method to estimate the value of π.
The basic idea is to generate random points within a square, and to check what
fraction of these random points lie in a quarter-circle inscribed within that square.
The expected value is the ratio of the areas of the quarter-circle and the square (π/4).
You can take the observed fraction of points in the quarter-circle as an estimate of π/4.

This example shows you how to create an random number generator engine object (the source of pseudo-randomness),
a distribution object (specifying the desired probability distribution), generate the
random numbers themselves, and then perform a reduction to count quantity of points that
fit into the square *S*. Random number generation is performed in scalar manner to simplify your code.


.. figure:: images/pi_benchmark.png
:alt: An image of pi chart.

.. code:: cpp
float estimated_pi;
{
sycl::queue q(sycl::gpu_selector{});
auto policy = oneapi::dpl::execution::make_device_policy(q);
float sum = std::transform_reduce( policy,
oneapi::dpl::counting_iterator<int>(0),
oneapi::dpl::counting_iterator<int>(N),
0.0f,
std::plus<float>{},
[=](int n){
float local_sum = 0.0f;
oneapi::dpl::minstd_rand engine(SEED, n * ITER * 2);
oneapi::dpl::uniform_real_distribution<float> distr;
for(int i = 0; i < ITER; ++i) {
float x = distr(engine);
float y = distr(engine);
if (x * x + y * y <= 1.0)
local_sum += 1.0;
}
return local_sum / (float)ITER;
}
);
estimated_pi = 4.0f * (float)sum / N;
}
Find More
=========

.. list-table::
:widths: 50 50
:header-rows: 1

* - Resource Link
- Description
* - `Intel® oneAPI DPC++ Library Guide <https://software.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-library-guide/top.html>`_
- Refer to the |onedpl_short| guide for more in depth information.
* - `System Requirements <https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-system-requirements.html>`_
- Check system requirements before you install |onedpl_short|.
* - `Intel® oneAPI DPC++ Library Release Notes <https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-library-release-notes.html>`_
- Check the release notes to learn about updates in the latest release.
* - `oneDPL Samples <https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneDPL>`_
- Learn how to use |onedpl_short| with samples.
* - `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>`_
- Add oneAPI components to a Yocto project build using the meta-intel layers.
8 changes: 8 additions & 0 deletions documentation/library_guide/introduction/release_notes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. |release_notes| replace:: |onedpl_long| Release Notes
.. _release_notes: https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-dpcpp-library-release-notes.html

=============
Release Notes
=============

Refer to |release_notes|_.
2 changes: 1 addition & 1 deletion documentation/library_guide/parallel_api/iterators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ header. All iterators are implemented in the ``oneapi::dpl`` namespace.

struct multiply_index_by_two {
template <typename Index>
Index operator()(const Index& i)
Index operator[](const Index& i) const
{ return i*2; }
};

Expand Down
3 changes: 2 additions & 1 deletion documentation/library_guide/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
breathe==4.9.1
sphinx==3.4.0
jinja2<3.1
docutils>=0.15
sphinx_book_theme
sphinx-intl==2.0.0
sphinx-tabs
sphinx-prompt
sphinx_substitution_extensions
sphinx_substitution_extensions
23 changes: 11 additions & 12 deletions documentation/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,23 @@ The Intel® oneAPI DPC++ Library (oneDPL) accompanies the Intel® oneAPI DPC++/C
and provides high-productivity APIs aimed to minimize programming efforts of C++ developers
creating efficient heterogeneous applications.

New in 2021.7.0
New in 2021.7.1
===============

Deprecation Notice
------------------
- Deprecated support of C++11 for Parallel API with host execution policies (``seq``, ``unseq``, ``par``, ``par_unseq``).
C++17 is the minimal required version going forward.
New Features
------------
- Added possibility to construct a zip_iterator out of a std::tuple of iterators.
- 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`.

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

Known Issues and Limitations
----------------------------
New in This Release
^^^^^^^^^^^^^^^^^^^
- STL algorithm functions (such as ``std::for_each``) used in DPC++ kernels do not compile with the debug version of
the Microsoft* Visual C++ standard library.

Existing Issues
^^^^^^^^^^^^^^^
See oneDPL Guide for other `restrictions and known limitations`_.
Expand All @@ -36,6 +33,8 @@ See oneDPL Guide for other `restrictions and known limitations`_.
- ``std::array`` cannot be swapped in DPC++ kernels with ``std::swap`` function or ``swap`` member function
in the Microsoft* Visual C++ standard library.
- The ``oneapi::dpl::experimental::ranges::reverse`` algorithm is not available with ``-fno-sycl-unnamed-lambda`` option.
- STL algorithm functions (such as ``std::for_each``) used in DPC++ kernels do not compile with the debug version of
the Microsoft* Visual C++ standard library.

New in 2021.6.1
===============
Expand Down
Loading

0 comments on commit 56e5a7e

Please sign in to comment.