Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
snnn committed Oct 5, 2023
1 parent d5c3452 commit 409170b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions onnxruntime/core/providers/js/js_execution_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,10 @@ std::vector<std::unique_ptr<ComputeCapability>> JsExecutionProvider::GetCapabili

const auto& node = *p_node;
if (!node.GetExecutionProviderType().empty()) {
// If the node was added by layout transformer, do not move it to CPU
if(node.GetExecutionProviderType() == kJsExecutionProvider) {
candidates.push_back(node.Index());
}
continue;
}

Expand All @@ -659,17 +663,14 @@ std::vector<std::unique_ptr<ComputeCapability>> JsExecutionProvider::GetCapabili
continue;
}
candidates.push_back(node.Index());
// If the node was added by layout transformer, do not move it to CPU
if(node.Domain() != "com.ms.internal.nhwc"){
LOGS(*GetLogger(), ERROR) << "Add node to tenative_candidates. node domain: " << node.Domain() << " node name: " << node.Name();
tenative_candidates.push_back(node.Index());
}
tenative_candidates.push_back(node.Index());
}
auto cpu_nodes = GetCpuPreferredNodes(graph, kernel_lookup, tenative_candidates);
std::vector<std::unique_ptr<ComputeCapability>> result;

Check warning on line 669 in onnxruntime/core/providers/js/js_execution_provider.cc

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Lines should be <= 120 characters long [whitespace/line_length] [2] Raw Output: onnxruntime/core/providers/js/js_execution_provider.cc:669: Lines should be <= 120 characters long [whitespace/line_length] [2]
for (auto& node_index : candidates) {
if (cpu_nodes.count(node_index) > 0)
if (cpu_nodes.count(node_index) > 0) {
continue;
}

auto sub_graph = std::make_unique<IndexedSubGraph>();
sub_graph->nodes.push_back(node_index);

Check warning on line 676 in onnxruntime/core/providers/js/js_execution_provider.cc

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <vector> for vector<> [build/include_what_you_use] [4] Raw Output: onnxruntime/core/providers/js/js_execution_provider.cc:676: Add #include <vector> for vector<> [build/include_what_you_use] [4]
Expand Down

0 comments on commit 409170b

Please sign in to comment.