File tree Expand file tree Collapse file tree 5 files changed +28
-5
lines changed Expand file tree Collapse file tree 5 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,11 @@ static void initializePlugins(vector_class<plugin> *Plugins) {
319
319
PluginNames[I].first .find (" cuda" ) != std::string::npos) {
320
320
// Use the CUDA plugin as the GlobalPlugin
321
321
GlobalPlugin = std::make_shared<plugin>(PluginInformation, backend::cuda);
322
+ } else if (InteropBE == backend::level0 &&
323
+ PluginNames[I].first .find (" level0" ) != std::string::npos) {
324
+ // Use the LEVEL0 plugin as the GlobalPlugin
325
+ GlobalPlugin =
326
+ std::make_shared<plugin>(PluginInformation, backend::level0);
322
327
}
323
328
Plugins->emplace_back (plugin (PluginInformation, PluginNames[I].second ));
324
329
if (trace (TraceLevel::PI_TRACE_BASIC))
Original file line number Diff line number Diff line change @@ -19,13 +19,13 @@ __SYCL_INLINE_NAMESPACE(cl) {
19
19
namespace sycl {
20
20
21
21
// Utility function to check if device is of the preferred backend.
22
- // Currently preference is given to the opencl backend.
22
+ // Currently preference is given to the level0 backend.
23
23
static bool isDeviceOfPreferredSyclBe (const device &Device) {
24
24
if (Device.is_host ())
25
25
return false ;
26
26
27
27
return detail::getSyclObjImpl (Device)->getPlugin ().getBackend () ==
28
- backend::opencl ;
28
+ backend::level0 ;
29
29
}
30
30
31
31
device device_selector::select_device () const {
Original file line number Diff line number Diff line change
1
+ // REQUIRES: gpu, level0
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 : 0.91
7
+ // CHECK-GPU-CUSTOM: custom_selector(gpu){{.*}}GPU : 0.91
8
+
9
+ // ==-- sycl-ls-gpu-default.cpp - SYCL test for default 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
+ // ===----------------------------------------------------------------------===//
Original file line number Diff line number Diff line change 1
1
// REQUIRES: gpu, opencl
2
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
3
// RUN: env SYCL_BE=PI_OPENCL sycl-ls --verbose >%t.opencl.out
7
4
// RUN: FileCheck %s --check-prefixes=CHECK-GPU-BUILTIN,CHECK-GPU-CUSTOM --input-file %t.opencl.out
8
5
Original file line number Diff line number Diff line change @@ -127,6 +127,8 @@ int main() {
127
127
Result &= multidevice_test (MyQueue1, MyQueue2);
128
128
} catch (cl::sycl::runtime_error &) {
129
129
std::cout << " Skipping CPU and GPU" << std::endl;
130
+ } catch (cl::sycl::compile_program_error &) {
131
+ std::cout << " Skipping CPU and GPU" << std::endl;
130
132
}
131
133
132
134
try {
@@ -135,6 +137,8 @@ int main() {
135
137
Result &= multidevice_test (MyQueue1, MyQueue2);
136
138
} catch (cl::sycl::runtime_error &) {
137
139
std::cout << " Skipping host and GPU" << std::endl;
140
+ } catch (cl::sycl::compile_program_error &) {
141
+ std::cout << " Skipping CPU and GPU" << std::endl;
138
142
}
139
143
140
144
try {
@@ -143,6 +147,8 @@ int main() {
143
147
Result &= multidevice_test (MyQueue1, MyQueue2);
144
148
} catch (cl::sycl::runtime_error &) {
145
149
std::cout << " Skipping GPU and GPU" << std::endl;
150
+ } catch (cl::sycl::compile_program_error &) {
151
+ std::cout << " Skipping CPU and GPU" << std::endl;
146
152
}
147
153
148
154
return Result;
You can’t perform that action at this time.
0 commit comments