Skip to content

Commit

Permalink
fix 'Invalid plugin kind specified: DNN' error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruturaj4 committed Mar 25, 2024
1 parent ae717d1 commit b2c8d60
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions xla/stream_executor/plugin_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,19 @@ absl::Status PluginRegistry::RegisterFactoryInternal(
bool PluginRegistry::HasFactory(Platform::Id platform_id,
PluginKind plugin_kind) const {
auto iter = factories_.find(platform_id);
if (iter != factories_.end()) {
switch (plugin_kind) {
case PluginKind::kBlas:
return iter->second.blas.has_value();
case PluginKind::kDnn:
return iter->second.dnn.has_value();
case PluginKind::kFft:
return iter->second.fft.has_value();
default:
break;
}
if (iter == factories_.end()) {
return false;
}

switch (plugin_kind) {
case PluginKind::kBlas:
return iter->second.blas.has_value();
case PluginKind::kDnn:
return iter->second.dnn.has_value();
case PluginKind::kFft:
return iter->second.fft.has_value();
default:
break;
}

LOG(ERROR) << "Invalid plugin kind specified: "
Expand Down

0 comments on commit b2c8d60

Please sign in to comment.