Skip to content

Commit

Permalink
Update OrtApi 17 marker (#19897)
Browse files Browse the repository at this point in the history
### Description
<!-- Describe your changes. -->

Looks like a bunch of new C OrtApis are introduced in 1.17.0 time frame,
however the static assert sanity check has not been updated along the
prs.

Fix OrtApi marker.

Related issue: 
#19893 


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

The branch is checked out against rel-1.17.2. Once rel-1.17.3 is made,
it will be based on this right version.

---------

Co-authored-by: rachguo <[email protected]>
Co-authored-by: George Wu <[email protected]>
  • Loading branch information
3 people authored and fs-eire committed Mar 21, 2024
1 parent 6bc6adc commit 1747d16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion onnxruntime/core/session/onnxruntime_c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2724,6 +2724,7 @@ static constexpr OrtApi ort_api_1_to_17 = {
&OrtApis::SetDeterministicCompute,
&OrtApis::KernelContext_ParallelFor,
&OrtApis::SessionOptionsAppendExecutionProvider_OpenVINO_V2,
// End of Version 17 - DO NOT MODIFY ABOVE (see above text for more information)
};

// OrtApiBase can never change as there is no way to know what version of OrtApiBase is returned by OrtGetApiBase.
Expand Down Expand Up @@ -2753,7 +2754,7 @@ static_assert(offsetof(OrtApi, ReleaseCANNProviderOptions) / sizeof(void*) == 22
static_assert(offsetof(OrtApi, GetSessionConfigEntry) / sizeof(void*) == 238, "Size of version 14 API cannot change");
static_assert(offsetof(OrtApi, GetBuildInfoString) / sizeof(void*) == 254, "Size of version 15 API cannot change");
static_assert(offsetof(OrtApi, KernelContext_GetResource) / sizeof(void*) == 265, "Size of version 16 API cannot change");
static_assert(offsetof(OrtApi, SetUserLoggingFunction) / sizeof(void*) == 266, "Size of version 17 API cannot change");
static_assert(offsetof(OrtApi, SessionOptionsAppendExecutionProvider_OpenVINO_V2) / sizeof(void*) == 275, "Size of version 17 API cannot change");

Check warning on line 2757 in onnxruntime/core/session/onnxruntime_c_api.cc

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Lines should be <= 120 characters long [whitespace/line_length] [2] Raw Output: onnxruntime/core/session/onnxruntime_c_api.cc:2757: Lines should be <= 120 characters long [whitespace/line_length] [2]

// So that nobody forgets to finish an API version, this check will serve as a reminder:
static_assert(std::string_view(ORT_VERSION) == "1.17.2",
Expand Down
7 changes: 5 additions & 2 deletions onnxruntime/test/providers/cpu/model_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -601,14 +601,18 @@ ::std::vector<::std::basic_string<ORTCHAR_T>> GetParameterStrings() {
std::vector<std::basic_string<ORTCHAR_T>> paths;

for (std::pair<ORT_STRING_VIEW, std::vector<ORT_STRING_VIEW>> kvp : provider_names) {
const ORT_STRING_VIEW provider_name = kvp.first;
// Setup ONNX node tests. The test data is preloaded on our CI build machines.
#if !defined(_WIN32)
ORT_STRING_VIEW node_test_root_path = ORT_TSTR("/data/onnx");
#else
ORT_STRING_VIEW node_test_root_path = ORT_TSTR("c:\\local\\data\\onnx");
#endif
for (auto p : kvp.second) {
paths.push_back(ConcatPathComponent(node_test_root_path, p));
// tensorrt ep isn't expected to pass all onnx node tests. exclude and run model tests only.
if (provider_name != provider_name_tensorrt) {
paths.push_back(ConcatPathComponent(node_test_root_path, p));
}
}

// Same as the above, except this one is for large models
Expand All @@ -627,7 +631,6 @@ ::std::vector<::std::basic_string<ORTCHAR_T>> GetParameterStrings() {
}
#endif

ORT_STRING_VIEW provider_name = kvp.first;
std::unordered_set<std::basic_string<ORTCHAR_T>> all_disabled_tests(std::begin(immutable_broken_tests),
std::end(immutable_broken_tests));
if (provider_name == provider_name_cuda) {
Expand Down

0 comments on commit 1747d16

Please sign in to comment.