Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update macOS onnx to v1.17 Universal build #10

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ LV2.mak
.vscode/
.idea/
Plugin/xcode/
modules/onnxruntime/lib/macos-universal/libonnxruntime.a
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/modu
add_library(onnxruntime STATIC IMPORTED)

if (APPLE)
message(STATUS ${CMAKE_HOST_SYSTEM_PROCESSOR})
if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
set_property(TARGET onnxruntime PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/modules/onnxruntime/lib/onnxruntime-osx-x64.a)
elseif (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
set_property(TARGET onnxruntime PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/modules/onnxruntime/lib/onnxruntime-osx-arm64.a)
else()
message(FATAL_ERROR "CMAKE_HOST_SYSTEM_PROCESSOR not defined.")
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/modules/onnxruntime/lib/macos-universal/libonnxruntime.a)
message("Unzipping universal macOS onnx build")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xf ${CMAKE_CURRENT_LIST_DIR}/modules/onnxruntime/lib/macos-universal/libonnxruntime.a.zip
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/modules/onnxruntime/lib/macos-universal/
)
endif()
set_property(TARGET onnxruntime PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/modules/onnxruntime/lib/macos-universal/libonnxruntime.a)
elseif (MSVC)
set_property(TARGET onnxruntime APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)

Expand Down
8 changes: 6 additions & 2 deletions modules/onnxruntime/include/coreml_provider_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ enum COREMLFlags {
// Please note, enable this option does not guarantee the entire model to be executed using ANE only
COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE = 0x004,

// Keep COREML_FLAG_MAX at the end of the enum definition
// Only allow CoreML EP to take nodes with inputs with static shapes. By default it will also allow inputs with
// dynamic shapes. However, the performance may be negatively impacted if inputs have dynamic shapes.
COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES = 0x008,

// Keep COREML_FLAG_LAST at the end of the enum definition
// And assign the last COREMLFlag to it
COREML_FLAG_LAST = COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE,
COREML_FLAG_LAST = COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES,
};

#ifdef __cplusplus
Expand Down
850 changes: 790 additions & 60 deletions modules/onnxruntime/include/onnxruntime_c_api.h

Large diffs are not rendered by default.

Loading