From cefceff5c91b5cf5fda076027dbf29942585b960 Mon Sep 17 00:00:00 2001 From: RandySheriffH <48490400+RandySheriffH@users.noreply.github.com> Date: Mon, 20 Jun 2022 15:22:55 -0700 Subject: [PATCH] Mark the end of APIs for release 1.12 (#11914) * mark the end of APIs for 1.12 * add static assert for C API 1.12 --- onnxruntime/core/session/onnxruntime_c_api.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onnxruntime/core/session/onnxruntime_c_api.cc b/onnxruntime/core/session/onnxruntime_c_api.cc index caebaa08e4..d2396bca9c 100644 --- a/onnxruntime/core/session/onnxruntime_c_api.cc +++ b/onnxruntime/core/session/onnxruntime_c_api.cc @@ -2529,6 +2529,7 @@ static constexpr OrtApi ort_api_1_to_12 = { &OrtApis::InvokeOp, &OrtApis::ReleaseOp, &OrtApis::SessionOptionsAppendExecutionProvider, + // End of Version 12 - DO NOT MODIFY ABOVE (see above text for more information) }; // Asserts to do a some checks to ensure older Versions of the OrtApi never change (will detect an addition or deletion but not if they cancel out each other) @@ -2544,6 +2545,7 @@ static_assert(offsetof(OrtApi, CreateSessionFromArrayWithPrepackedWeightsContain static_assert(offsetof(OrtApi, GetSparseTensorIndices) / sizeof(void*) == 191, "Size of version 9 API cannot change"); static_assert(offsetof(OrtApi, SynchronizeBoundOutputs) / sizeof(void*) == 203, "Size of version 10 API cannot change"); static_assert(offsetof(OrtApi, SessionOptionsAppendExecutionProvider_MIGraphX) / sizeof(void*) == 209, "Size of version 11 API cannot change"); +static_assert(offsetof(OrtApi, SessionOptionsAppendExecutionProvider) / sizeof(void*) == 216, "Size of version 12 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.12.0", "ORT_Version change detected, please follow below steps to ensure OrtApi is updated properly");