Skip to content

Commit aa644e8

Browse files
authored
[EP ABI] Update to use Node_GetEpName (#25363)
Change to use `Node_GetEpName` API name to avoid confusion. For plugin EPs, the EP factory can use whatever name that registered with ORT, so make the API name `Node_GetEpName` to align with `OrtEpFactory.GetName.`
1 parent 4ac95ce commit aa644e8

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

include/onnxruntime/core/session/onnxruntime_c_api.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6026,8 +6026,9 @@ struct OrtApi {
60266026
*/
60276027
ORT_API2_STATUS(Node_GetGraph, _In_ const OrtNode* node, _Outptr_result_maybenull_ const OrtGraph** graph);
60286028

6029-
/** \brief Returns the execution provider type (name) that this node is assigned to run on.
6029+
/** \brief Returns the execution provider name that this node is assigned to run on.
60306030
* Returns NULL if the node has not been assigned to any execution provider yet.
6031+
* For plugin execution providers, the name is the one returned by OrtEp::GetName.
60316032
*
60326033
* \param[in] node The OrtNode instance.
60336034
* \param[out] out Output execution provider type and can be NULL if node has not been assigned.
@@ -6036,7 +6037,7 @@ struct OrtApi {
60366037
*
60376038
* \since Version 1.23.
60386039
*/
6039-
ORT_API2_STATUS(Node_GetEpType, _In_ const OrtNode* node, _Outptr_result_maybenull_ const char** out);
6040+
ORT_API2_STATUS(Node_GetEpName, _In_ const OrtNode* node, _Outptr_result_maybenull_ const char** out);
60406041

60416042
/// @}
60426043

onnxruntime/core/graph/ep_api_types.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ const OrtOpAttr* EpNode::GetAttribute(const std::string& name) const {
276276
}
277277
}
278278

279-
const std::string& EpNode::GetEpType() const {
279+
const std::string& EpNode::GetEpName() const {
280280
return node_.GetExecutionProviderType();
281281
}
282282

onnxruntime/core/graph/ep_api_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ struct EpNode : public OrtNode {
208208
// Helper that gets the node's attributes by name.
209209
const OrtOpAttr* GetAttribute(const std::string& name) const;
210210

211-
// Helper that gets the execution provider that this node is assigned to run on.
212-
const std::string& GetEpType() const;
211+
// Helper that gets the execution provider name that this node is assigned to run on.
212+
const std::string& GetEpName() const;
213213

214214
private:
215215
// Back pointer to containing graph. Useful when traversing through nested subgraphs.

onnxruntime/core/session/onnxruntime_c_api.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3052,7 +3052,7 @@ ORT_API_STATUS_IMPL(OrtApis::Node_GetGraph, _In_ const OrtNode* node,
30523052
API_IMPL_END
30533053
}
30543054

3055-
ORT_API_STATUS_IMPL(OrtApis::Node_GetEpType, _In_ const OrtNode* node,
3055+
ORT_API_STATUS_IMPL(OrtApis::Node_GetEpName, _In_ const OrtNode* node,
30563056
_Outptr_result_maybenull_ const char** out) {
30573057
API_IMPL_BEGIN
30583058
if (out == nullptr) {
@@ -3061,10 +3061,10 @@ ORT_API_STATUS_IMPL(OrtApis::Node_GetEpType, _In_ const OrtNode* node,
30613061

30623062
const EpNode* ep_node = EpNode::ToInternal(node);
30633063
if (ep_node == nullptr) {
3064-
return OrtApis::CreateStatus(OrtErrorCode::ORT_INVALID_ARGUMENT, "node is a ModelEditorNode which doesn't support Node_GetEpType.");
3064+
return OrtApis::CreateStatus(OrtErrorCode::ORT_INVALID_ARGUMENT, "node is a ModelEditorNode which doesn't support Node_GetEpName.");
30653065
}
30663066

3067-
*out = ep_node->GetEpType().c_str();
3067+
*out = ep_node->GetEpName().c_str();
30683068
return nullptr;
30693069
API_IMPL_END
30703070
}
@@ -3751,7 +3751,7 @@ static constexpr OrtApi ort_api_1_to_23 = {
37513751
&OrtApis::Node_GetNumSubgraphs,
37523752
&OrtApis::Node_GetSubgraphs,
37533753
&OrtApis::Node_GetGraph,
3754-
&OrtApis::Node_GetEpType,
3754+
&OrtApis::Node_GetEpName,
37553755

37563756
&OrtApis::GetRunConfigEntry,
37573757

onnxruntime/core/session/ort_apis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ ORT_API_STATUS_IMPL(Node_GetSubgraphs, _In_ const OrtNode* node,
680680
_Out_writes_(num_subgraphs) const OrtGraph** subgraphs, _In_ size_t num_subgraphs,
681681
_Out_writes_opt_(num_subgraphs) const char** attribute_names);
682682
ORT_API_STATUS_IMPL(Node_GetGraph, _In_ const OrtNode* node, _Outptr_result_maybenull_ const OrtGraph** graph);
683-
ORT_API_STATUS_IMPL(Node_GetEpType, _In_ const OrtNode* node, _Outptr_result_maybenull_ const char** out);
683+
ORT_API_STATUS_IMPL(Node_GetEpName, _In_ const OrtNode* node, _Outptr_result_maybenull_ const char** out);
684684

685685
ORT_API_STATUS_IMPL(GetRunConfigEntry, _In_ const OrtRunOptions* options,
686686
_In_z_ const char* config_key, _Outptr_result_maybenull_z_ const char** config_value);

onnxruntime/test/autoep/library/ep.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ OrtStatus* ORT_API_CALL ExampleEp::CompileImpl(_In_ OrtEp* this_ptr, _In_ const
328328
RETURN_IF_ERROR(ort_api.GetValueInfoName(node_inputs[0], &node_input_names[0]));
329329
RETURN_IF_ERROR(ort_api.GetValueInfoName(node_inputs[1], &node_input_names[1]));
330330

331-
const char* ep_type = nullptr;
332-
RETURN_IF_ERROR(ort_api.Node_GetEpType(fused_nodes[0], &ep_type));
333-
if (std::strncmp(ep_type, "example_ep", 11) != 0) {
331+
const char* ep_name = nullptr;
332+
RETURN_IF_ERROR(ort_api.Node_GetEpName(fused_nodes[0], &ep_name));
333+
if (std::strncmp(ep_name, "example_ep", 11) != 0) {
334334
return ort_api.CreateStatus(ORT_EP_FAIL, "The fused node is expected to assigned to this EP to run on");
335335
}
336336

0 commit comments

Comments
 (0)