Skip to content

Commit cf879f3

Browse files
[SYCL] Add a check that the preferred/chosen GPU RT is Level-Zero (#2677)
Signed-off-by: Sergey V Maslov <[email protected]>
1 parent b8a7b01 commit cf879f3

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

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

100755100644
+4-4
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
//
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-level-zero.cpp - Test 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
+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
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

9-
//==-- sycl-ls-gpu-opencl.cpp - SYCL test for discovered/selected devices -===//
9+
//==-- sycl-ls-gpu-opencl.cpp - SYCL test for selected OpenCL GPU device --===//
1010
//
1111
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
1212
// See https://llvm.org/LICENSE.txt for license information.

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

100755100644
+5-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ 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 << " "
77+
<< DeviceVersion << " [" << DeviceDriverVersion << "]"
78+
<< std::endl;
7679
}
7780
}
7881

0 commit comments

Comments
 (0)