Skip to content

Commit 8c07803

Browse files
authored
[SYCL] Try to load next plugins if plugin fails (#3641)
Do not stop loading next plugins if the current one fails to initialize.
1 parent a58cfef commit 8c07803

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sycl/source/detail/platform_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ vector_class<platform> platform_impl::get_platforms() {
100100
for (unsigned int i = 0; i < Plugins.size(); i++) {
101101

102102
pi_uint32 NumPlatforms = 0;
103-
// Just return zero platforms if plugin fails to initialize.
103+
// Move to the next plugin if the plugin fails to initialize.
104104
// This way platforms from other plugins get a chance to be discovered.
105105
if (Plugins[i].call_nocheck<PiApiKind::piPlatformsGet>(
106106
0, nullptr, &NumPlatforms) != PI_SUCCESS)
107-
return Platforms;
107+
continue;
108108

109109
if (NumPlatforms) {
110110
vector_class<RT::PiPlatform> PiPlatforms(NumPlatforms);

0 commit comments

Comments
 (0)