Skip to content

Commit b1a594f

Browse files
committed
[SYCL] Check that the preferred/chosen GPU backend is Level-Zero
Signed-off-by: Sergey V Maslov <[email protected]>
1 parent 3e11f37 commit b1a594f

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

sycl/test/plugins/sycl-ls-gpu-default.cpp

100755100644
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// REQUIRES: gpu, level_zero
1+
// REQUIRES: gpu
22

3-
// RUN: sycl-ls --verbose >%t.default.out
3+
// RUN: env --unset=SYCL_BE sycl-ls --verbose >%t.default.out
44
// RUN: FileCheck %s --check-prefixes=CHECK-GPU-BUILTIN,CHECK-GPU-CUSTOM --input-file %t.default.out
55

6-
// CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : 1.0
7-
// CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : 1.0
6+
// CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : {{.*}}Level-Zero
7+
// CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : {{.*}}Level-Zero
88

99
//==-- sycl-ls-gpu-default.cpp - SYCL test for default selected gpu device -==//
1010
//
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// REQUIRES: gpu, level_zero
2+
3+
// RUN: sycl-ls --verbose >%t.default.out
4+
// RUN: FileCheck %s --check-prefixes=CHECK-GPU-BUILTIN,CHECK-GPU-CUSTOM --input-file %t.default.out
5+
6+
// CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : {{.*}}Level-Zero
7+
// CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : {{.*}}Level-Zero
8+
9+
//==-- sycl-ls-gpu-default.cpp - SYCL test for Level-Zero selected gpu device -==//
10+
//
11+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
12+
// See https://llvm.org/LICENSE.txt for license information.
13+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
14+
//
15+
//===----------------------------------------------------------------------===//

sycl/test/plugins/sycl-ls-gpu-opencl.cpp

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// RUN: env SYCL_BE=PI_OPENCL sycl-ls --verbose >%t.opencl.out
44
// RUN: FileCheck %s --check-prefixes=CHECK-GPU-BUILTIN,CHECK-GPU-CUSTOM --input-file %t.opencl.out
55

6-
// CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : {{[0-9]\.[0-9]}}
7-
// CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : {{[0-9]\.[0-9]}}
6+
// CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : {{.*}}OpenCL
7+
// CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : {{.*}}OpenCL
88

99
//==-- sycl-ls-gpu-opencl.cpp - SYCL test for discovered/selected devices -===//
1010
//

sycl/tools/sycl-ls/sycl-ls.cpp

100755100644
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ static void printDeviceInfo(const device &Device, const std::string &Prepend) {
7171
std::cout << Prepend << "Vendor : " << DeviceVendor << std::endl;
7272
std::cout << Prepend << "Driver : " << DeviceDriverVersion << std::endl;
7373
} else {
74-
std::cout << Prepend << DeviceTypeName << ": " << DeviceVersion << "[ "
75-
<< DeviceDriverVersion << " ]" << std::endl;
74+
auto DevicePlatform = Device.get_info<info::device::platform>();
75+
auto DevicePlatformName = DevicePlatform.get_info<info::platform::name>();
76+
std::cout << Prepend << DeviceTypeName << ": " << DevicePlatformName << " " << DeviceVersion << " ["
77+
<< DeviceDriverVersion << "]" << std::endl;
7678
}
7779
}
7880

0 commit comments

Comments
 (0)