mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Add details of which node was not able to be placed on an execution provider. (#1665)
This commit is contained in:
parent
e652a236b4
commit
a68a20e415
1 changed files with 12 additions and 6 deletions
|
|
@ -14,11 +14,21 @@ Status KernelRegistryManager::CreateKernel(const onnxruntime::Node& node,
|
|||
const IExecutionProvider& execution_provider,
|
||||
const SessionState& session_state,
|
||||
/*out*/ std::unique_ptr<OpKernel>& op_kernel) const {
|
||||
auto create_error_message = [&node](const std::string& error) {
|
||||
std::ostringstream errormsg;
|
||||
errormsg << error << node.OpType();
|
||||
if (node.Op() != nullptr) errormsg << "(" << node.Op()->since_version() << ")";
|
||||
if (!node.Name().empty()) errormsg << " (node " << node.Name() << ")";
|
||||
return errormsg.str();
|
||||
};
|
||||
|
||||
const std::string& ptype = node.GetExecutionProviderType();
|
||||
if (ptype.empty()) {
|
||||
return Status(ONNXRUNTIME, FAIL,
|
||||
"The node is not placed on any Execution Provider, therefore, can't find a suitable kernel for it");
|
||||
create_error_message("The node is not placed on any Execution Provider, "
|
||||
"therefore, can't find a suitable kernel for "));
|
||||
}
|
||||
|
||||
Status status;
|
||||
{
|
||||
for (auto& registry : custom_kernel_registries_) {
|
||||
|
|
@ -41,11 +51,7 @@ Status KernelRegistryManager::CreateKernel(const onnxruntime::Node& node,
|
|||
}
|
||||
}
|
||||
|
||||
std::ostringstream errormsg;
|
||||
errormsg << "Failed to find kernel for " << node.OpType();
|
||||
if (node.Op() != nullptr) errormsg << "(" << node.Op()->since_version() << ")";
|
||||
if (!node.Name().empty()) errormsg << " (node " << node.Name() << ")";
|
||||
return Status(ONNXRUNTIME, FAIL, errormsg.str());
|
||||
return Status(ONNXRUNTIME, FAIL, create_error_message("Failed to find kernel for "));
|
||||
}
|
||||
|
||||
Status KernelRegistryManager::RegisterKernels(const ExecutionProviders& execution_providers) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue