mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-04 23:59:56 +00:00
Minor optimization: if a node has already been placed, there's no need to find a kernel for it. (#2417)
This commit is contained in:
parent
5ab7041fa7
commit
f268e69c79
1 changed files with 3 additions and 2 deletions
|
|
@ -1204,8 +1204,9 @@ CUDAExecutionProvider::GetCapability(const onnxruntime::GraphViewer& graph,
|
|||
continue;
|
||||
|
||||
const auto& node = *p_node;
|
||||
const auto* cuda_kernel_def = GetKernelRegistry()->TryFindKernel(node, Type());
|
||||
if (cuda_kernel_def == nullptr || !node.GetExecutionProviderType().empty()) {
|
||||
const KernelCreateInfo* cuda_kernel_def = nullptr;
|
||||
if (!node.GetExecutionProviderType().empty() ||
|
||||
!(cuda_kernel_def = GetKernelRegistry()->TryFindKernel(node, Type()))) {
|
||||
// node is not in cuda exeuction provider if no kernel def found,
|
||||
// or if other execution provider already assigned to it
|
||||
defs_outside_cuda.insert(node.OutputDefs().cbegin(), node.OutputDefs().cend());
|
||||
|
|
|
|||
Loading…
Reference in a new issue