Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/onnxruntime/core/session/onnxruntime_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*
* This value is used by some API functions to behave as this version of the header expects.
*/
#define ORT_API_VERSION 23
#define ORT_API_VERSION 24

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -6584,7 +6584,7 @@ struct OrtApi {
* \param[in] info The OrtTensorTypeAndShapeInfo instance.
* \return true if the tensor has shape information, false otherwise.
*
* \since Version 1.23
* \since Version 1.24
*/
ORT_API_T(bool, TensorTypeAndShape_HasShape, _In_ const OrtTensorTypeAndShapeInfo* info);
};
Expand Down
3 changes: 3 additions & 0 deletions onnxruntime/core/session/compile_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,14 @@ static constexpr OrtCompileApi ort_compile_api = {
&OrtCompileAPI::ModelCompilationOptions_SetGraphOptimizationLevel,
&OrtCompileAPI::ModelCompilationOptions_SetOutputModelWriteFunc,
&OrtCompileAPI::ModelCompilationOptions_SetOutputModelGetInitializerLocationFunc,
// End of Version 23 - DO NOT MODIFY ABOVE
};

// checks that we don't violate the rule that the functions must remain in the slots they were originally assigned
static_assert(offsetof(OrtCompileApi, CompileModel) / sizeof(void*) == 8,
"Size of version 22 Api cannot change"); // initial version in ORT 1.22
static_assert(offsetof(OrtCompileApi, ModelCompilationOptions_SetOutputModelGetInitializerLocationFunc) / sizeof(void*) == 13,
"Size of version 23 of Api cannot change");

ORT_API(const OrtCompileApi*, OrtCompileAPI::GetCompileApi) {
return &ort_compile_api;
Expand Down
1 change: 1 addition & 0 deletions onnxruntime/core/session/model_editor_c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ static constexpr OrtModelEditorApi ort_model_editor_api = {
&OrtModelEditorAPI::SessionGetOpsetForDomain,
&OrtModelEditorAPI::ApplyModelToModelEditorSession,
&OrtModelEditorAPI::FinalizeModelEditorSession,
// End of Version 22 - DO NOT MODIFY ABOVE
};

// checks that we don't violate the rule that the functions must remain in the slots they were originally assigned
Expand Down
3 changes: 3 additions & 0 deletions onnxruntime/core/session/onnxruntime_c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4228,6 +4228,8 @@ static constexpr OrtApi ort_api_1_to_24 = {
&OrtApis::Graph_GetModelMetadata,
&OrtApis::GetModelCompatibilityForEpDevices,
&OrtApis::CreateExternalInitializerInfo,
// End of Version 23 - DO NOT MODIFY ABOVE (see above text for more information)

&OrtApis::TensorTypeAndShape_HasShape,
};

Expand Down Expand Up @@ -4264,6 +4266,7 @@ static_assert(offsetof(OrtApi, AddExternalInitializersFromFilesInMemory) / sizeo
static_assert(offsetof(OrtApi, SetEpDynamicOptions) / sizeof(void*) == 284, "Size of version 20 API cannot change");

static_assert(offsetof(OrtApi, GetEpApi) / sizeof(void*) == 317, "Size of version 22 API cannot change");
static_assert(offsetof(OrtApi, CreateExternalInitializerInfo) / sizeof(void*) == 389, "Size of version 23 API cannot change");

// So that nobody forgets to finish an API version, this check will serve as a reminder:
static_assert(std::string_view(ORT_VERSION) == "1.24.0",
Expand Down
3 changes: 3 additions & 0 deletions onnxruntime/core/session/plugin_ep/ep_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,14 @@ static constexpr OrtEpApi ort_ep_api = {
&OrtExecutionProviderApi::SyncStream_GetImpl,
&OrtExecutionProviderApi::SyncStream_GetSyncId,
&OrtExecutionProviderApi::GetSyncIdForLastWaitOnSyncStream,
// End of Version 23 - DO NOT MODIFY ABOVE
};

// checks that we don't violate the rule that the functions must remain in the slots they were originally assigned
static_assert(offsetof(OrtEpApi, ReleaseEpDevice) / sizeof(void*) == 1,
"Size of version 22 API cannot change"); // initial version in ORT 1.22
static_assert(offsetof(OrtEpApi, GetSyncIdForLastWaitOnSyncStream) / sizeof(void*) == 15,
"Size of version 23 API cannot change");

} // namespace OrtExecutionProviderApi

Expand Down
Loading