File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ // REQUIRES: level_zero, level_zero_dev_kit
2
+
3
+ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out
4
+ // RUN: %GPU_RUN_PLACEHOLDER %t.out
5
+
6
+ #include < CL/sycl.hpp>
7
+ #include < level_zero/ze_api.h>
8
+ #include < sycl/ext/oneapi/backend/level_zero.hpp>
9
+
10
+ int main () {
11
+ using namespace sycl ;
12
+
13
+ queue Q{gpu_selector_v};
14
+
15
+ auto nativeQ = sycl::get_native<sycl::backend::ext_oneapi_level_zero>(Q);
16
+
17
+ backend_input_t <backend::ext_oneapi_level_zero, queue> QueueInteropInput = {
18
+ nativeQ, Q.get_device (), ext::oneapi::level_zero::ownership::keep};
19
+ queue Q2 = make_queue<backend::ext_oneapi_level_zero>(QueueInteropInput,
20
+ Q.get_context ());
21
+
22
+ // Command submission works fine
23
+ Q2.submit ([&](handler &cgh) { cgh.single_task <class K >([]() {}); });
24
+
25
+ // Check that copy submission also works
26
+ int *hostMem = (int *)malloc_host (sizeof (int ), Q2);
27
+ int *devMem = malloc_device<int >(1 , Q2);
28
+ Q2.memcpy (hostMem, devMem, sizeof (int ));
29
+ }
You can’t perform that action at this time.
0 commit comments