Skip to content

Commit 3b7fdf4

Browse files
smaslov-intelagainull
authored andcommitted
[SYCL] PI: correct default interoperability plugin selection
Signed-off-by: Sergey V Maslov <[email protected]>
1 parent 05625f1 commit 3b7fdf4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

sycl/source/detail/pi.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,17 @@ vector_class<plugin> initialize() {
228228
continue;
229229
}
230230
backend *BE = SYCLConfig<SYCL_BE>::get();
231-
if (!BE || (*BE == backend::opencl &&
232-
PluginNames[I].first.find("opencl") != std::string::npos)) {
231+
// Use OpenCL as the default interoperability plugin.
232+
// This will go away when we make backend interoperability selection
233+
// explicit in SYCL-2020.
234+
backend InteropBE = BE ? *BE : backend::opencl;
235+
236+
if (InteropBE == backend::opencl &&
237+
PluginNames[I].first.find("opencl") != std::string::npos) {
233238
// Use the OpenCL plugin as the GlobalPlugin
234239
GlobalPlugin =
235240
std::make_shared<plugin>(PluginInformation, backend::opencl);
236-
} else if (*BE == backend::cuda &&
241+
} else if (InteropBE == backend::cuda &&
237242
PluginNames[I].first.find("cuda") != std::string::npos) {
238243
// Use the CUDA plugin as the GlobalPlugin
239244
GlobalPlugin = std::make_shared<plugin>(PluginInformation, backend::cuda);

0 commit comments

Comments
 (0)