Skip to content

Commit d69d5d6

Browse files
[SYCL][Docs] Add get_native_context call to interop_handle example (#16901)
The interop_handle example in the L0 backend specification uses a L0 context handle, but it may be unclear to users how that context handle is accessible. Since it needs to be at least associated with the corresponding device, it seems proper to be explicit in the example about how to get it from the interop_handle. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 3161af3 commit d69d5d6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sycl/doc/extensions/supported/sycl_ext_oneapi_backend_level_zero.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ data to the host to access the data. Users can get type of the allocation using
300300
Queue.submit([&](handler &CGH) {
301301
auto BufferAcc = Buffer.get_access<access::mode::write>(CGH);
302302
CGH.host_task([=](const interop_handle &IH) {
303+
ze_context_handle_t ZeContext =
304+
IH.get_native_context<backend::ext_oneapi_level_zero>();
303305
void *DevicePtr =
304306
IH.get_native_mem<backend::ext_oneapi_level_zero>(BufferAcc);
305307
ze_memory_allocation_properties_t MemAllocProperties{};

0 commit comments

Comments
 (0)