mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-10 17:37:14 +00:00
Exclude more code from custom_ops.cc when not required in minimal build (#19142)
### Description <!-- Describe your changes. --> - Split out the code that implements the OrtKernelContext API (used by compiled nodes and custom ops) and the code that implements the custom ops API. - Exclude based on minimal build settings using helpers - the main change is to simply wrap the implementation into a lambda so it can be easily enabled/disabled - actual implementation of all functions are unchanged - Re-organize so the related implementations are together - most diffs are from this, but without the reorg it would be much harder to know which helper to use - General cleanup of lines that were too long. ### 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. --> Saves ~10KB in a minimal build. Build command used for comparison ``` ./build --android --android_api=29 --android_sdk="d:\Android" --android_abi=arm64-v8a --parallel --android_ndk_path="D:\Android\ndk\26.0.10792818\" --build_shared_lib --cmake_generator Ninja --skip_tests --minimal_build --disable_rtti --disable_ml_ops --disable_exceptions --cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF --include_ops_by_config .\no_ops.config --config MinSizeRel ``` Main: 1,218,480 bytes With changes: 1,208,320 bytes
This commit is contained in:
parent
1e936bfd63
commit
6dd0079d13
1 changed files with 534 additions and 476 deletions
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue