-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[onnxruntime] Supprt CoreML feature, Download CMake scripts from upst…
…ream (#265) * [onnxruntime] support 'coreml' feature * [onnxruntime] download external scripts from upstream branch * test: onnxruntime[coreml], linux build
- Loading branch information
Showing
9 changed files
with
109 additions
and
123 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
diff --git a/cmake/onnxruntime_providers_coreml.cmake b/cmake/onnxruntime_providers_coreml.cmake | ||
index 0aa25a2..1cb768c 100644 | ||
--- a/cmake/onnxruntime_providers_coreml.cmake | ||
+++ b/cmake/onnxruntime_providers_coreml.cmake | ||
@@ -9,7 +9,7 @@ add_compile_definitions(USE_COREML=1) | ||
|
||
# Check if we can build the coremltools code for creating an mlpackage with an mlprogram. | ||
# The coremltools source requires std::filesystem::path which is only available from iOS 13 on. | ||
-set(_enable_ML_PROGRAM ON) | ||
+option(_enable_ML_PROGRAM "..." ON) | ||
if (IOS AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 13.0) | ||
message(WARNING "CoreML ML Program is not supported on iOS < 13.0. Excluding ML Program support from build.") | ||
set(_enable_ML_PROGRAM OFF) | ||
@@ -29,7 +29,9 @@ if (_enable_ML_PROGRAM) | ||
endif() | ||
|
||
# Compile CoreML proto definition to ${CMAKE_CURRENT_BINARY_DIR}/coreml_proto | ||
-set(COREML_PROTO_ROOT ${coremltools_SOURCE_DIR}/mlmodel/format) | ||
+if(NOT DEFINED COREML_PROTO_ROOT) | ||
+ set(COREML_PROTO_ROOT ${coremltools_SOURCE_DIR}/mlmodel/format) | ||
+endif() | ||
file(GLOB coreml_proto_srcs "${COREML_PROTO_ROOT}/*.proto") | ||
|
||
onnxruntime_add_static_library(coreml_proto ${coreml_proto_srcs}) | ||
@@ -62,7 +64,7 @@ endif() | ||
# Separate source_group for each as the .proto files are in the repo and the .cc/.h files are generated in the build | ||
# output directory. | ||
set_target_properties(coreml_proto PROPERTIES FOLDER "External") | ||
-source_group(TREE ${COREML_PROTO_ROOT} PREFIX coreml_proto FILES ${coreml_proto_srcs}) | ||
+# source_group(TREE ${COREML_PROTO_ROOT} PREFIX coreml_proto FILES ${coreml_proto_srcs}) | ||
|
||
# filter to the generated .cc/.h files | ||
get_target_property(coreml_proto_generated_srcs coreml_proto SOURCES) | ||
@@ -119,7 +121,7 @@ if(_enable_ML_PROGRAM) | ||
${onnxruntime_providers_coreml_modelpackage_cc_srcs} | ||
) | ||
|
||
- source_group(TREE ${coremltools_SOURCE_DIR} PREFIX coremltools FILES ${coremltools_srcs}) | ||
+ # source_group(TREE ${coremltools_SOURCE_DIR} PREFIX coremltools FILES ${coremltools_srcs}) | ||
endif() | ||
|
||
# Add CoreML objective c++ source code |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
tensorflow-lite[gpu] | ||
onnxruntime[framework] | ||
onnxruntime[framework,coreml] | ||
metal-cpp | ||
miniaudio | ||
abseil |
This file contains 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
This file contains 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
This file contains 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