From c4aefd9d401931e27611a0f27965f796bc274f7d Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Thu, 10 Mar 2022 15:11:02 -0800 Subject: [PATCH] Mark end of version 11 C API. (#10803) * Mark end of version 11 C API * Add static_assert --- onnxruntime/core/session/onnxruntime_c_api.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/session/onnxruntime_c_api.cc b/onnxruntime/core/session/onnxruntime_c_api.cc index 352aafc2f802e..dee2e32c505d2 100644 --- a/onnxruntime/core/session/onnxruntime_c_api.cc +++ b/onnxruntime/core/session/onnxruntime_c_api.cc @@ -2500,7 +2500,6 @@ static constexpr OrtApi ort_api_1_to_11 = { &OrtApis::GetSparseTensorIndices, // End of Version 9 - DO NOT MODIFY ABOVE (see above text for more information) - // Version 10 - In development, feel free to add/remove/rearrange here &OrtApis::HasValue, &OrtApis::KernelContext_GetGPUComputeStream, &OrtApis::GetTensorMemoryInfo, @@ -2515,13 +2514,13 @@ static constexpr OrtApi ort_api_1_to_11 = { &OrtApis::SynchronizeBoundOutputs, // End of Version 10 - DO NOT MODIFY ABOVE (see above text for more information) - // Version 11 - In development, feel free to add/remove/rearrange here &OrtApis::SessionOptionsAppendExecutionProvider_CUDA_V2, &OrtApis::CreateCUDAProviderOptions, &OrtApis::UpdateCUDAProviderOptions, &OrtApis::GetCUDAProviderOptionsAsString, &OrtApis::ReleaseCUDAProviderOptions, &OrtApis::SessionOptionsAppendExecutionProvider_MIGraphX, + // End of Version 11 - 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) @@ -2536,6 +2535,7 @@ static_assert(offsetof(OrtApi, GetCurrentGpuDeviceId) / sizeof(void*) == 161, "S static_assert(offsetof(OrtApi, CreateSessionFromArrayWithPrepackedWeightsContainer) / sizeof(void*) == 169, "Size of version 8 API cannot change"); 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"); // So that nobody forgets to finish an API version, this check will serve as a reminder: static_assert(std::string_view(ORT_VERSION) == "1.11.0", "ORT_Version change detected, please follow below steps to ensure OrtApi is updated properly");