mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
handle status
This commit is contained in:
parent
e95f2c3200
commit
bad19b9c9e
2 changed files with 10 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue