Skip to content

Commit 5d0c3c0

Browse files
committed
Add synopsis and a short description for new policy instance templates
1 parent 8742170 commit 5d0c3c0

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

source/elements/oneDPL/source/parallel_api/execution_policies.rst

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ A device execution policy represents a `SYCL`_ device and queue to run oneDPL al
5656
class device_policy;
5757
5858
inline const device_policy<> dpcpp_default;
59+
60+
template <typename KernelName = /*unspecified*/>
61+
const device_policy<KernelName> dpdefault;
62+
63+
template <typename KernelName = /*unspecified*/>
64+
const device_policy<KernelName> dpgpu;
65+
66+
template <typename KernelName = /*unspecified*/>
67+
const device_policy<KernelName> dpcpu;
5968
6069
template <typename KernelName = /*unspecified*/>
6170
device_policy<KernelName>
@@ -151,13 +160,21 @@ Return the queue the policy is associated with.
151160
152161
Allow implicit conversion of the policy to a ``sycl::queue`` object.
153162

154-
Predefined Device Policy
155-
^^^^^^^^^^^^^^^^^^^^^^^^
163+
Predefined Device Policies
164+
^^^^^^^^^^^^^^^^^^^^^^^^^^
156165

157166
``dpcpp_default`` is a predefined execution policy object to run algorithms on the default SYCL device.
158167
It is a global immutable (``const``) instance of type ``device_policy<>``.
159168
[*Note*: ``dpcpp_default`` can be copied but cannot be moved. -- *end note*]
160169

170+
``dpdefault``, ``dpgpu``, and `dpcpu`` are variable templates for creating ``device_policy`` objects,
171+
possibly with user-provided kernel names, to run algorithms on the default SYCL device, a GPU device,
172+
and a CPU device, respectively. A policy object instantiated from one of these templates is associated
173+
with a SYCL queue constructed with the device selector appropriate for the template used.
174+
[*Example*: ``dpgpu<>`` is associated with a queue created by ``sycl::gpu_selector_v``. -- *end example*]
175+
176+
177+
161178
make_device_policy Function
162179
^^^^^^^^^^^^^^^^^^^^^^^^^^^
163180

0 commit comments

Comments
 (0)