Experimental C++ API update#29142
Open
edgchen1 wants to merge 4 commits into
Open
Conversation
Move the C++ accessor wrappers out of the experimental C header into a new C++ companion header (onnxruntime_experimental_cxx_api.h), keeping onnxruntime_experimental_c_api.h pure C. Add a throwing accessor variant (Get_..._FnOrThrow) alongside the existing nullable accessor; it throws Ort::Exception (ORT_NOT_IMPLEMENTED) when the experimental function is unavailable. Split the mechanical, X-macro-generated per-function plumbing into _fns.h detail headers so each public header stays focused on its curated, hand-written surface. Enforce that the detail headers are only included through their public header via a scoped ORT_INCLUDING_* guard macro that triggers a #error otherwise. Register the new headers in cmake, update the design doc, and update the tests to use the new headers and the throwing accessor. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Inline the experimental C typedef/name-constant macro pass and C++ nullable/FnOrThrow accessor passes into the public headers. Keep explicit section comments for auxiliary/custom code in each header. Remove obsolete split detail headers and their installation entries from cmake. Update Experimental_C_API.md to document the restored two-header model and inline X-macro expansion approach. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
onnxruntime_experimental_cxx_api.h. This can also contain other auxiliary experimental API-related C++ code.Get_X_FnOrThrow()variant throws an exception if the experimental API is unavailable in the build.Motivation and Context
Improve experimental API ergonomics for C++.