mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Minor fix to disallow an execution provider registering a nullptr. This matches the expected behavior of GetKernelRegistriesByProviderType to not return any nullptrs. (#646)
This commit is contained in:
parent
971058fc38
commit
541b3149dd
1 changed files with 8 additions and 1 deletions
|
|
@ -60,7 +60,14 @@ Status KernelRegistryManager::RegisterKernels(const ExecutionProviders& executio
|
|||
return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, "found duplicated provider ", provider->Type(),
|
||||
" in KernelRegistryManager");
|
||||
}
|
||||
provider_type_to_registry_.insert(std::make_pair(provider->Type(), provider->GetKernelRegistry()));
|
||||
|
||||
auto registry = provider->GetKernelRegistry();
|
||||
if (!registry) {
|
||||
return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, "Execution provider ", provider->Type(),
|
||||
"does not have a kernel registry.");
|
||||
}
|
||||
|
||||
provider_type_to_registry_.insert(std::make_pair(provider->Type(), registry));
|
||||
}
|
||||
return Status::OK();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue