Skip to content

Commit 204580a

Browse files
authored
[Offload] Don't add the unsupported host plugin to the list (#159642)
Summary: The host plugin is basically OpenMP specific and doesn't work very well. Previously we were skipping over it in the list instead of just not adding it at all.
1 parent 612a105 commit 204580a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

offload/liboffload/src/OffloadImpl.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,15 @@ Error initPlugins(OffloadContext &Context) {
250250
// Attempt to create an instance of each supported plugin.
251251
#define PLUGIN_TARGET(Name) \
252252
do { \
253-
Context.Platforms.emplace_back(ol_platform_impl_t{ \
254-
std::unique_ptr<GenericPluginTy>(createPlugin_##Name()), \
255-
pluginNameToBackend(#Name)}); \
253+
if (StringRef(#Name) != "host") \
254+
Context.Platforms.emplace_back(ol_platform_impl_t{ \
255+
std::unique_ptr<GenericPluginTy>(createPlugin_##Name()), \
256+
pluginNameToBackend(#Name)}); \
256257
} while (false);
257258
#include "Shared/Targets.def"
258259

259260
// Preemptively initialize all devices in the plugin
260261
for (auto &Platform : Context.Platforms) {
261-
// Do not use the host plugin - it isn't supported.
262-
if (Platform.BackendType == OL_PLATFORM_BACKEND_UNKNOWN)
263-
continue;
264262
auto Err = Platform.Plugin->init();
265263
[[maybe_unused]] std::string InfoMsg = toString(std::move(Err));
266264
for (auto DevNum = 0; DevNum < Platform.Plugin->number_of_devices();

0 commit comments

Comments
 (0)