@@ -7,185 +7,15 @@ Parallel API
77
88oneDPL provides the set of parallel algorithms as defined by the `C++ Standard `_,
99including parallel algorithms added in the 6th edition known as C++20.
10- All those algorithms work with *C++ Standard aligned execution policies * and with * DPC++
11- execution policies *.
10+ All those algorithms work with *C++ Standard aligned execution policies * and with
11+ * device execution policies *.
1212
1313Additionally, oneDPL provides wrapper functions for `SYCL `_ buffers, special iterators, and
1414a set of non-standard parallel algorithms.
1515
16- C++ Standard aligned execution policies
17- +++++++++++++++++++++++++++++++++++++++
16+ .. toctree ::
1817
19- oneDPL has the set of execution policies and related utilities that are semantically aligned
20- with the `C++ Standard `_, 6th edition (C++20):
21-
22- .. code :: cpp
23-
24- // Defined in <oneapi/dpl/execution>
25-
26- namespace oneapi {
27- namespace dpl {
28- namespace execution {
29-
30- class sequenced_policy { /*unspecified*/ };
31- class parallel_policy { /*unspecified*/ };
32- class parallel_unsequenced_policy { /*unspecified*/ };
33- class unsequenced_policy { /*unspecified*/ };
34-
35- inline constexpr sequenced_policy seq { /*unspecified*/ };
36- inline constexpr parallel_policy par { /*unspecified*/ };
37- inline constexpr parallel_unsequenced_policy par_unseq { /*unspecified*/ };
38- inline constexpr unsequenced_policy unseq { /*unspecified*/ };
39-
40- template <class T>
41- struct is_execution_policy;
42-
43- template <class T>
44- inline constexpr bool is_execution_policy_v = oneapi::dpl::execution::is_execution_policy<T>::value;
45- }
46- }
47- }
48-
49- See "Execution policies" in the `C++ Standard `_ for more information.
50-
51- DPC++ Execution Policy
52- ++++++++++++++++++++++
53-
54- A DPC++ execution policy class :code: `oneapi::dpl::execution::device_policy ` specifies
55- where and how an algorithm runs.
56-
57- .. code :: cpp
58-
59- // Defined in <oneapi/dpl/execution>
60-
61- namespace oneapi {
62- namespace dpl {
63- namespace execution {
64-
65- template <typename KernelName = /*unspecified*/>
66- class device_policy;
67-
68- const device_policy<> dpcpp_default;
69-
70- template <typename KernelName = /*unspecified*/>
71- device_policy<KernelName>
72- make_device_policy( sycl::queue );
73-
74- template <typename KernelName = /*unspecified*/>
75- device_policy<KernelName>
76- make_device_policy( sycl::device );
77-
78- template <typename NewKernelName, typename OldKernelName>
79- device_policy<NewKernelName>
80- make_device_policy( const device_policy<OldKernelName>& = dpcpp_default );
81- }
82- }
83- }
84-
85- ``dpcpp_default `` is a predefined execution policy object to run algorithms on the default DPC++ device.
86-
87- device_policy class
88- ^^^^^^^^^^^^^^^^^^^
89-
90- .. code :: cpp
91-
92- template <typename KernelName = /*unspecified*/>
93- class device_policy
94- {
95- public:
96- using kernel_name = KernelName;
97-
98- device_policy();
99- template <typename OtherName>
100- device_policy( const device_policy<OtherName>& );
101- explicit device_policy( sycl::queue );
102- explicit device_policy( sycl::device );
103-
104- sycl::queue queue() const;
105- operator sycl::queue() const;
106- };
107-
108- An object of the ``device_policy `` type is associated with a ``sycl::queue `` that is used
109- to run algorithms on a DPC++ compliant device. When an algorithm runs with ``device_policy ``
110- it is capable of processing SYCL buffers (passed via :code: `oneapi::dpl::begin/end `),
111- data in the host memory and data in Unified Shared Memory (USM), including USM device memory.
112- Data placed in the host memory and USM can only be passed to oneDPL algorithms
113- as pointers and random access iterators. The way to transfer data from the host memory
114- to a device and back is unspecified; per-element data movement to/from a temporary storage
115- is a possible valid implementation.
116-
117- The ``KernelName `` template parameter, also aliased as ``kernel_name `` within the class template,
118- is to explicitly provide a name for DPC++ kernels executed by an algorithm the policy is passed to.
119-
120- .. code :: cpp
121-
122- device_policy()
123-
124- Construct a policy object associated with a queue created with the default device selector.
125-
126- .. code :: cpp
127-
128- template <typename OtherName>
129- device_policy( const device_policy<OtherName>& policy )
130-
131- Construct a policy object associated with the same queue as ``policy ``, by changing
132- the kernel name of the given policy to ``kernel_name `` defined for the new policy.
133-
134- .. code :: cpp
135-
136- explicit device_policy( sycl::queue queue )
137-
138- Construct a policy object associated with the given queue.
139-
140- .. code :: cpp
141-
142- explicit device_policy( sycl::device device )
143-
144- Construct a policy object associated with a queue created for the given device.
145-
146- .. code :: cpp
147-
148- sycl::queue queue() const
149-
150- Return the queue the policy is associated with.
151-
152- .. code :: cpp
153-
154- operator sycl::queue() const
155-
156- Allow implicit conversion of the policy to a ``sycl::queue `` object.
157-
158- make_device_policy function
159- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
160-
161- The ``make_device_policy `` function templates simplify ``device_policy `` creation.
162-
163- .. code :: cpp
164-
165- template <typename KernelName = /*unspecified*/>
166- device_policy<KernelName>
167- make_device_policy( sycl::queue queue )
168-
169- Return a policy object associated with ``queue ``, with a kernel name possibly provided
170- as the template argument, otherwise unspecified.
171-
172- .. code :: cpp
173-
174- template <typename KernelName = /*unspecified*/>
175- device_policy<KernelName>
176- make_device_policy( sycl::device device )
177-
178- Return a policy object to run algorithms on ``device ``, with a kernel name possibly provided
179- as the template argument, otherwise unspecified.
180-
181- .. code :: cpp
182-
183- template <typename NewKernelName, typename OldKernelName>
184- device_policy<NewKernelName>
185- make_device_policy( const device_policy<OldKernelName>& policy = dpcpp_default )
186-
187- Return a policy object constructed from ``policy ``, with a new kernel name provided as the template
188- argument. If no policy object is provided, the new policy is constructed from ``dpcpp_default ``.
18+ parallel_api/execution_policies.rst
18919
19020Buffer wrappers
19121+++++++++++++++
@@ -226,7 +56,7 @@ Buffer wrappers
22656 }
22757
22858 ``oneapi::dpl::begin `` and ``oneapi::dpl::end `` are helper functions
229- for passing DPC++ buffers to oneDPL algorithms.
59+ for passing SYCL buffers to oneDPL algorithms.
23060These functions accept a buffer and return an object
23161of an unspecified type that satisfies the following requirements:
23262
0 commit comments