Skip to content

Commit 4ac2613

Browse files
authored
[oneDPL] Add specification version macro and requirements to header files (#591)
1 parent 761f604 commit 4ac2613

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed
Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,53 @@
11
.. SPDX-FileCopyrightText: 2019-2022 Intel Corporation
2+
.. SPDX-FileCopyrightText: Contributors to the oneAPI Specification project.
23
..
34
.. SPDX-License-Identifier: CC-BY-4.0
45
6+
General Information
7+
-------------------
8+
9+
This section describes the most general functionality of |dpl_full_name| (oneDPL)
10+
such as namespaces, versioning, etc.
11+
512
Namespaces
6-
----------
13+
++++++++++
714

815
oneDPL uses ``namespace oneapi::dpl`` and a shorter variant ``namespace dpl`` for all
916
functionality including parallel algorithms, oneDPL execution policies, etc.
1017
For the subset of the standard C++ library for kernels, the standard class
1118
and function names are also aliased in ``namespace oneapi::dpl``.
1219

1320
oneDPL uses nested namespaces for the functionality aligned with the C++ standard.
14-
The names of those namespaces are the same as in ``namespace std``. For example,
15-
oneDPL execution policies are provided in ``namespace oneapi::dpl::execution``.
21+
The names of those namespaces are the same as for their analogues in ``namespace std``.
22+
[*Example*: oneDPL execution policies are provided in ``namespace oneapi::dpl::execution``. -- *end example*]
23+
24+
Header Files
25+
++++++++++++
26+
27+
The oneDPL header files are provided under the ``oneapi/dpl/`` include path,
28+
which must explicitly precede oneDPL header file names in ``#include`` directives.
29+
30+
Following the naming convention for the C++ standard library header files,
31+
the oneDPL header files have no extension suffix in their names.
32+
33+
A oneDPL header file automatically includes the C++ standard library header file
34+
which name matches that of the oneDPL header file without the include path prefix.
35+
[*Example*: ``#include <oneapi/dpl/version>`` automatically includes ``<version>``
36+
if that is available. -- *end example*]
37+
38+
Version Information
39+
+++++++++++++++++++
40+
41+
A oneDPL implementation must define the following preprocessor macro representing
42+
the version of the oneDPL specification that the implementation is compliant with.
43+
44+
.. code:: cpp
45+
46+
// Defined in <oneapi/dpl/version>
47+
48+
#define ONEDPL_SPEC_VERSION /*implementation-defined*/
49+
50+
The ``ONEDPL_SPEC_VERSION`` macro must be defined to the decimal literal whose value equals to
51+
*major-spec-version* * 100 + *minor-spec-version*, where *major-spec-version* and *minor-spec-version*
52+
are the major and the minor versions of the latest fully supported specification.
53+
[*Example*: ``#define ONEDPL_SPEC_VERSION 104`` for the oneDPL specification 1.4. -- *end example*]

source/elements/oneDPL/source/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.. SPDX-FileCopyrightText: 2019-2022 Intel Corporation
2+
.. SPDX-FileCopyrightText: Contributors to the oneAPI Specification project.
23
..
34
.. SPDX-License-Identifier: CC-BY-4.0
45
@@ -8,6 +9,8 @@
89
oneDPL
910
======
1011

12+
This is the specification of |dpl_full_name|, part of the oneAPI Specification version |dpl_version|.
13+
1114
The |dpl_full_name| (oneDPL) provides the functionality
1215
specified in the `C++ standard`_, with extensions to support data parallelism
1316
and offloading to devices, and with extensions to simplify its usage for

0 commit comments

Comments
 (0)