Skip to content

Commit

Permalink
handle status
Browse files Browse the repository at this point in the history
  • Loading branch information
chilo-ms committed Feb 7, 2025
1 parent e95f2c3 commit bad19b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2670,10 +2670,15 @@ TensorrtExecutionProvider::GetCapability(const GraphViewer& graph,
*/

std::function<std::vector<std::unique_ptr<ComputeCapability>>(const GraphViewer&)> selection_func;
auto status = g_host->GetOptimizerByName("ConstantFoldingDQ", selection_func);
std::vector<std::unique_ptr<ComputeCapability>> selection_cc;
if (selection_func) {
selection_cc = selection_func(graph);
std::string optimizer_name = "ConstantFoldingDQ";
auto status = g_host->GetOptimizerByName(optimizer_name, selection_func);
if (status == Status::OK()) {
if (selection_func) {
selection_cc = selection_func(graph);
}
} else {
LOGS_DEFAULT(WARNING) << "[TensorRT EP] Can't get optimizer " << optimizer_name;
}

std::unordered_set<NodeIndex> trt_selection_node_set; // The qualified dq nodes selected by TRT EP
Expand Down
3 changes: 2 additions & 1 deletion onnxruntime/core/session/provider_bridge_ort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ struct ProviderHostImpl : ProviderHost {

if (func.has_value()) {
selection_func = func.value();
} else {
return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, "Failed to get optimizer " + optimizer_name);
}

return Status::OK();
};

Expand Down

0 comments on commit bad19b9

Please sign in to comment.