Skip to content

Commit 71aca78

Browse files
[SYCL] Fix Level Zero tests on machines with multiple GPUs (#11028)
Level Zero adapter does not support building programs with multiple devices yet. Modify the test to always use a single device to avoid failures on multi-GPU machines.
1 parent cc44082 commit 71aca78

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sycl/test-e2e/KernelAndProgram/level-zero-link-flags.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ class MyKernel;
1919
void test() {
2020
sycl::queue Queue;
2121
sycl::context Context = Queue.get_context();
22+
sycl::device Device = Queue.get_device();
2223

2324
auto BundleInput =
24-
sycl::get_kernel_bundle<MyKernel, sycl::bundle_state::input>(Context);
25+
sycl::get_kernel_bundle<MyKernel, sycl::bundle_state::input>(Context,
26+
{Device});
2527
auto BundleObject = sycl::compile(BundleInput);
2628

2729
try {

sycl/test-e2e/KernelAndProgram/level-zero-static-link-flow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ class MyKernel;
3232
void test() {
3333
sycl::queue Queue;
3434
sycl::context Context = Queue.get_context();
35+
sycl::device Device = Queue.get_device();
3536

3637
auto BundleInput =
37-
sycl::get_kernel_bundle<MyKernel, sycl::bundle_state::input>(Context);
38+
sycl::get_kernel_bundle<MyKernel, sycl::bundle_state::input>(Context,
39+
{Device});
3840
auto BundleObject = sycl::compile(BundleInput);
3941
sycl::link(BundleObject);
4042

0 commit comments

Comments
 (0)