@@ -39,11 +39,10 @@ See "Execution policies" in the `C++ Standard`_ for more information.
39
39
The ``std::is_execution_policy `` type trait resolves to ``std::false_type `` for oneDPL execution policies.
40
40
Implementations and programs should instead use the :ref: `oneDPL type trait <exec-policy-type-trait >`.
41
41
42
- Device Execution Policy
43
- +++++++++++++++++++++++
42
+ Device Execution Policies
43
+ +++++++++++++++++++++++++
44
44
45
- A device execution policy class ``oneapi::dpl::execution::device_policy `` specifies
46
- the `SYCL `_ device and queue to run oneDPL algorithms.
45
+ A device execution policy represents a `SYCL `_ device and queue to run oneDPL algorithms.
47
46
48
47
.. code :: cpp
49
48
@@ -56,7 +55,7 @@ the `SYCL`_ device and queue to run oneDPL algorithms.
56
55
template <typename KernelName = /*unspecified*/>
57
56
class device_policy;
58
57
59
- const device_policy<> dpcpp_default;
58
+ inline const device_policy<> dpcpp_default;
60
59
61
60
template <typename KernelName = /*unspecified*/>
62
61
device_policy<KernelName>
@@ -69,12 +68,11 @@ the `SYCL`_ device and queue to run oneDPL algorithms.
69
68
template <typename NewKernelName, typename OldKernelName>
70
69
device_policy<NewKernelName>
71
70
make_device_policy( const device_policy<OldKernelName>& = dpcpp_default );
71
+
72
72
}
73
73
}
74
74
}
75
75
76
- ``dpcpp_default `` is a predefined execution policy object to run algorithms on the default `SYCL `_ device.
77
-
78
76
device_policy Class
79
77
^^^^^^^^^^^^^^^^^^^
80
78
@@ -99,15 +97,22 @@ device_policy Class
99
97
An object of the ``device_policy `` type is associated with a ``sycl::queue `` that is used
100
98
to run algorithms on a SYCL device. When an algorithm runs with ``device_policy ``
101
99
it is capable of processing SYCL buffers (passed via ``oneapi::dpl::begin/end ``),
102
- data in the host memory and data in Unified Shared Memory (USM), including USM device memory .
103
- Data placed in the host memory and USM can only be passed to oneDPL algorithms
100
+ data in the host memory and data in Unified Shared Memory (USM), including device USM .
101
+ Data placed in the host memory and USM can be passed to oneDPL algorithms
104
102
as pointers and random access iterators. The way to transfer data from the host memory
105
103
to a device and back is unspecified; per-element data movement to/from a temporary storage
106
104
is a possible valid implementation.
107
105
108
106
The ``KernelName `` template parameter, also aliased as ``kernel_name `` within the class template,
109
107
is to explicitly provide a name for SYCL kernels executed by an algorithm the policy is passed to.
110
108
109
+ The ``device_policy `` type is copy-constructible, copy-assignable, move-constructible and move-assignable.
110
+ A policy instance constructed as or assigned a copy of another instance is associated with
111
+ a ``sycl::queue `` that compares equal, as defined by `SYCL `_, to the queue of that other instance.
112
+ A policy instance constructed as or assigned a move of another instance is associated with the queue
113
+ of that other instance without copying it. It is unspecified whether the moved-from policy instance
114
+ is associated with any queue after the move.
115
+
111
116
.. code :: cpp
112
117
113
118
device_policy()
@@ -119,8 +124,8 @@ Construct a policy object associated with a queue created with the default devic
119
124
template <typename OtherName>
120
125
device_policy( const device_policy<OtherName>& policy )
121
126
122
- Construct a policy object associated with the same queue as ``policy ``, by changing
123
- the kernel name of the given policy to ``kernel_name `` defined for the new policy.
127
+ Construct a policy object as if by copying ``policy `` and changing
128
+ the kernel name to ``kernel_name `` defined for the new policy.
124
129
125
130
.. code :: cpp
126
131
@@ -146,6 +151,13 @@ Return the queue the policy is associated with.
146
151
147
152
Allow implicit conversion of the policy to a ``sycl::queue `` object.
148
153
154
+ Predefined Device Policy
155
+ ^^^^^^^^^^^^^^^^^^^^^^^^
156
+
157
+ ``dpcpp_default `` is a predefined execution policy object to run algorithms on the default SYCL device.
158
+ It is a global immutable (``const ``) instance of type ``device_policy<> ``.
159
+ [*Note *: ``dpcpp_default `` can be copied but cannot be moved. -- *end note *]
160
+
149
161
make_device_policy Function
150
162
^^^^^^^^^^^^^^^^^^^^^^^^^^^
151
163
0 commit comments