Skip to content

Commit ffabde2

Browse files
committed
[Offload] Don't add the unsupported host plugin to the list
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 dffd7f3 commit ffabde2

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
@@ -244,17 +244,15 @@ Error initPlugins(OffloadContext &Context) {
244244
// Attempt to create an instance of each supported plugin.
245245
#define PLUGIN_TARGET(Name) \
246246
do { \
247-
Context.Platforms.emplace_back(ol_platform_impl_t{ \
248-
std::unique_ptr<GenericPluginTy>(createPlugin_##Name()), \
249-
pluginNameToBackend(#Name)}); \
247+
if (StringRef(#Name) != "host") \
248+
Context.Platforms.emplace_back(ol_platform_impl_t{ \
249+
std::unique_ptr<GenericPluginTy>(createPlugin_##Name()), \
250+
pluginNameToBackend(#Name)}); \
250251
} while (false);
251252
#include "Shared/Targets.def"
252253

253254
// Preemptively initialize all devices in the plugin
254255
for (auto &Platform : Context.Platforms) {
255-
// Do not use the host plugin - it isn't supported.
256-
if (Platform.BackendType == OL_PLATFORM_BACKEND_UNKNOWN)
257-
continue;
258256
auto Err = Platform.Plugin->init();
259257
[[maybe_unused]] std::string InfoMsg = toString(std::move(Err));
260258
for (auto DevNum = 0; DevNum < Platform.Plugin->number_of_devices();

0 commit comments

Comments
 (0)