From b1a594ffc61e3bec94f77c5db3b6452ec6ff8726 Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Fri, 23 Oct 2020 08:29:04 -0700 Subject: [PATCH 1/3] [SYCL] Check that the preferred/chosen GPU backend is Level-Zero Signed-off-by: Sergey V Maslov --- sycl/test/plugins/sycl-ls-gpu-default.cpp | 8 ++++---- sycl/test/plugins/sycl-ls-gpu-level-zero.cpp | 15 +++++++++++++++ sycl/test/plugins/sycl-ls-gpu-opencl.cpp | 4 ++-- sycl/tools/sycl-ls/sycl-ls.cpp | 6 ++++-- 4 files changed, 25 insertions(+), 8 deletions(-) mode change 100755 => 100644 sycl/test/plugins/sycl-ls-gpu-default.cpp create mode 100644 sycl/test/plugins/sycl-ls-gpu-level-zero.cpp mode change 100755 => 100644 sycl/test/plugins/sycl-ls-gpu-opencl.cpp mode change 100755 => 100644 sycl/tools/sycl-ls/sycl-ls.cpp diff --git a/sycl/test/plugins/sycl-ls-gpu-default.cpp b/sycl/test/plugins/sycl-ls-gpu-default.cpp old mode 100755 new mode 100644 index 15b9ca4e33a0..11165b63197d --- a/sycl/test/plugins/sycl-ls-gpu-default.cpp +++ b/sycl/test/plugins/sycl-ls-gpu-default.cpp @@ -1,10 +1,10 @@ -// REQUIRES: gpu, level_zero +// REQUIRES: gpu -// RUN: sycl-ls --verbose >%t.default.out +// RUN: env --unset=SYCL_BE sycl-ls --verbose >%t.default.out // RUN: FileCheck %s --check-prefixes=CHECK-GPU-BUILTIN,CHECK-GPU-CUSTOM --input-file %t.default.out -// CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : 1.0 -// CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : 1.0 +// CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : {{.*}}Level-Zero +// CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : {{.*}}Level-Zero //==-- sycl-ls-gpu-default.cpp - SYCL test for default selected gpu device -==// // diff --git a/sycl/test/plugins/sycl-ls-gpu-level-zero.cpp b/sycl/test/plugins/sycl-ls-gpu-level-zero.cpp new file mode 100644 index 000000000000..a41edf775f68 --- /dev/null +++ b/sycl/test/plugins/sycl-ls-gpu-level-zero.cpp @@ -0,0 +1,15 @@ +// REQUIRES: gpu, level_zero + +// RUN: sycl-ls --verbose >%t.default.out +// RUN: FileCheck %s --check-prefixes=CHECK-GPU-BUILTIN,CHECK-GPU-CUSTOM --input-file %t.default.out + +// CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : {{.*}}Level-Zero +// CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : {{.*}}Level-Zero + +//==-- sycl-ls-gpu-default.cpp - SYCL test for Level-Zero selected gpu device -==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// diff --git a/sycl/test/plugins/sycl-ls-gpu-opencl.cpp b/sycl/test/plugins/sycl-ls-gpu-opencl.cpp old mode 100755 new mode 100644 index 4437e68c2833..0ce30ab30205 --- a/sycl/test/plugins/sycl-ls-gpu-opencl.cpp +++ b/sycl/test/plugins/sycl-ls-gpu-opencl.cpp @@ -3,8 +3,8 @@ // RUN: env SYCL_BE=PI_OPENCL sycl-ls --verbose >%t.opencl.out // RUN: FileCheck %s --check-prefixes=CHECK-GPU-BUILTIN,CHECK-GPU-CUSTOM --input-file %t.opencl.out -// CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : {{[0-9]\.[0-9]}} -// CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : {{[0-9]\.[0-9]}} +// CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : {{.*}}OpenCL +// CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : {{.*}}OpenCL //==-- sycl-ls-gpu-opencl.cpp - SYCL test for discovered/selected devices -===// // diff --git a/sycl/tools/sycl-ls/sycl-ls.cpp b/sycl/tools/sycl-ls/sycl-ls.cpp old mode 100755 new mode 100644 index f3909723f422..259921507bcc --- a/sycl/tools/sycl-ls/sycl-ls.cpp +++ b/sycl/tools/sycl-ls/sycl-ls.cpp @@ -71,8 +71,10 @@ static void printDeviceInfo(const device &Device, const std::string &Prepend) { std::cout << Prepend << "Vendor : " << DeviceVendor << std::endl; std::cout << Prepend << "Driver : " << DeviceDriverVersion << std::endl; } else { - std::cout << Prepend << DeviceTypeName << ": " << DeviceVersion << "[ " - << DeviceDriverVersion << " ]" << std::endl; + auto DevicePlatform = Device.get_info(); + auto DevicePlatformName = DevicePlatform.get_info(); + std::cout << Prepend << DeviceTypeName << ": " << DevicePlatformName << " " << DeviceVersion << " [" + << DeviceDriverVersion << "]" << std::endl; } } From a0aefe5eaeec97a25fce21d535325463eb721705 Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Fri, 23 Oct 2020 08:39:29 -0700 Subject: [PATCH 2/3] [SYCL] clang format Signed-off-by: Sergey V Maslov --- sycl/test/plugins/sycl-ls-gpu-level-zero.cpp | 2 +- sycl/tools/sycl-ls/sycl-ls.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sycl/test/plugins/sycl-ls-gpu-level-zero.cpp b/sycl/test/plugins/sycl-ls-gpu-level-zero.cpp index a41edf775f68..0457698a93ff 100644 --- a/sycl/test/plugins/sycl-ls-gpu-level-zero.cpp +++ b/sycl/test/plugins/sycl-ls-gpu-level-zero.cpp @@ -6,7 +6,7 @@ // CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : {{.*}}Level-Zero // CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : {{.*}}Level-Zero -//==-- sycl-ls-gpu-default.cpp - SYCL test for Level-Zero selected gpu device -==// +//==-- sycl-ls-gpu-level-zero.cpp - Test Level-Zero selected gpu device ----==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. diff --git a/sycl/tools/sycl-ls/sycl-ls.cpp b/sycl/tools/sycl-ls/sycl-ls.cpp index 259921507bcc..8e01a67d4bc1 100644 --- a/sycl/tools/sycl-ls/sycl-ls.cpp +++ b/sycl/tools/sycl-ls/sycl-ls.cpp @@ -73,8 +73,9 @@ static void printDeviceInfo(const device &Device, const std::string &Prepend) { } else { auto DevicePlatform = Device.get_info(); auto DevicePlatformName = DevicePlatform.get_info(); - std::cout << Prepend << DeviceTypeName << ": " << DevicePlatformName << " " << DeviceVersion << " [" - << DeviceDriverVersion << "]" << std::endl; + std::cout << Prepend << DeviceTypeName << ": " << DevicePlatformName << " " + << DeviceVersion << " [" << DeviceDriverVersion << "]" + << std::endl; } } From 326ed81f8c85a0888010d52e26ead774514a24c1 Mon Sep 17 00:00:00 2001 From: Sergey V Maslov Date: Fri, 23 Oct 2020 10:11:24 -0700 Subject: [PATCH 3/3] [SYCL] address comment Signed-off-by: Sergey V Maslov --- sycl/test/plugins/sycl-ls-gpu-opencl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test/plugins/sycl-ls-gpu-opencl.cpp b/sycl/test/plugins/sycl-ls-gpu-opencl.cpp index 0ce30ab30205..23dec78cdd10 100644 --- a/sycl/test/plugins/sycl-ls-gpu-opencl.cpp +++ b/sycl/test/plugins/sycl-ls-gpu-opencl.cpp @@ -6,7 +6,7 @@ // CHECK-GPU-BUILTIN: gpu_selector(){{.*}}GPU : {{.*}}OpenCL // CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : {{.*}}OpenCL -//==-- sycl-ls-gpu-opencl.cpp - SYCL test for discovered/selected devices -===// +//==-- sycl-ls-gpu-opencl.cpp - SYCL test for selected OpenCL GPU device --===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information.