Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit c9efc13

Browse files
[SYCL][L0] check copy operations on interop queue (#855)
Signed-off-by: Sergey V Maslov <[email protected]>
1 parent f681f3a commit c9efc13

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
}

0 commit comments

Comments
 (0)