Mark end of version 11 C API. (#10803)

* Mark end of version 11 C API

* Add static_assert
This commit is contained in:
Pranav Sharma 2022-03-10 15:11:02 -08:00 committed by GitHub
parent 3ae2bfaefe
commit 97ae44d060
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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");