You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL][L0] Adds device member to L0 make_queue input type (#6148)
* [SYCL][L0] Adds device member to L0 make_queue input type
This commit adds a new `device` member to the `make_queue` input type for the L0 backend. This allows the L0 backend to correctly associate the right device with the command queue to create the PI queue from, preventing unintended and illegal behavior when the PI queue is later used for otherwise valid operations.
It is currently still valid to create a SYCL queue from a native L0 command queue without associating the correct device, which will lead to the queue being associated with the first device in the supplied SYCL context. This behavior is however marked as deprecated.
Note: The ABI checker test changes were generated with the checker tool, so the ones that are marked as removed are simply just moved by the tool. This is a non-breaking ABI change for the runtime library.
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Deprecated as of version 3 of this specification.[^1]
125
+
</td>
126
+
</tr><tr>
127
+
<td>
128
+
129
+
```C++
130
+
struct {
131
+
ze_command_queue_handle_t NativeHandle;
132
+
device Device;
133
+
ext::oneapi::level_zero::ownership Ownership{
134
+
ext::oneapi::level_zero::ownership::transfer};
135
+
}
136
+
```
137
+
138
+
Supported since version 3 of this specification.[^1]
122
139
</td>
123
140
</tr><tr>
124
141
<td>event</td>
@@ -191,6 +208,8 @@ struct {
191
208
</tr>
192
209
</table>
193
210
211
+
[^1]: The SYCL implementation is responsible for distinguishing between the variants of <code>backend_input_t<backend::ext_oneapi_level_zero, queue></code>.
212
+
194
213
### 4.2 Obtaining of native Level-Zero handles from SYCL objects
195
214
196
215
The ```sycl::get_native<backend::ext_oneapi_level_zero>``` free-function is how a raw native Level-Zero handle can be obtained
<td>Constructs a SYCL queue instance from a Level-Zero <code>ze_command_queue_handle_t</code>. The <code>Context</code> argument must be a valid SYCL context encapsulating a Level-Zero context. The queue is attached to the first device in the passed SYCL context. The <code>Ownership</code> input structure member specifies if the SYCL runtime should take ownership of the passed native handle. The default behavior is to transfer the ownership to the SYCL runtime. See section 4.4 for details.</td>
297
+
<td>Constructs a SYCL queue instance from a Level-Zero <code>ze_command_queue_handle_t</code>. The <code>Context</code> argument must be a valid SYCL context encapsulating a Level-Zero context. The <code>Device</code> input structure member specifies the device to create the <code>queue</code> against and must be in <code>Context</code>. The <code>Ownership</code> input structure member specifies if the SYCL runtime should take ownership of the passed native handle. The default behavior is to transfer the ownership to the SYCL runtime. See section 4.4 for details.
298
+
299
+
If the deprecated variant of <code>backend_input_t<backend::ext_oneapi_level_zero, queue></code> is passed to <code>make_queue</code> the queue is attached to the first device in <code>Context</code>.
300
+
</td>
279
301
</tr><tr>
280
302
<td>
281
303
@@ -485,3 +507,4 @@ struct free_memory {
485
507
|6|2021-08-30|Dmitry Vodopyanov|Updated according to SYCL 2020 reqs for extensions
486
508
|7|2021-09-13|Sergey Maslov|Updated according to SYCL 2020 standard
487
509
|8|2022-01-06|Artur Gainullin|Introduced make_buffer() API
510
+
|9|2022-05-12|Steffen Larsen|Added device member to queue input type
0 commit comments