diff --git a/js/react_native/e2e/ios/Podfile b/js/react_native/e2e/ios/Podfile index 0272c23092..f2d052818e 100644 --- a/js/react_native/e2e/ios/Podfile +++ b/js/react_native/e2e/ios/Podfile @@ -1,7 +1,7 @@ require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -platform :ios, '13.0' +platform :ios, '15.1' pre_install do |installer| # Custom pre-install script or commands @@ -15,7 +15,14 @@ end target 'OnnxruntimeModuleExample' do config = use_native_modules! - use_react_native!(:path => config["reactNativePath"]) +]# Check both symbol and string keys with default value + use_react_native!( + :path => config[:reactNativePath], + # Hermes is now enabled by default. Disable by setting this flag to false. + # Upcoming versions of React Native may rely on get_default_flags(), but + # we make it explicit here to aid in the React Native upgrade process. + :hermes_enabled => false + ) use_frameworks! @@ -32,7 +39,10 @@ post_install do |installer| installer.generated_projects.each do |project| project.targets.each do |target| target.build_configurations.each do |config| - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.1' + + # TODO: remove this once we migrate the Pipelines to use arm64 MacOS + config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64" end end end diff --git a/js/react_native/ios/Podfile b/js/react_native/ios/Podfile index ad8a5ce3b2..7208a3a514 100644 --- a/js/react_native/ios/Podfile +++ b/js/react_native/ios/Podfile @@ -1,7 +1,7 @@ require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -platform :ios, '13.0' +platform :ios, '15.1' pre_install do |installer| # Custom pre-install script or commands @@ -15,8 +15,14 @@ end def shared config = use_native_modules! - use_react_native!(:path => config["reactNativePath"]) - + # Check both symbol and string keys with default value + use_react_native!( + :path => config[:reactNativePath], + # Hermes is now enabled by default. Disable by setting this flag to false. + # Upcoming versions of React Native may rely on get_default_flags(), but + # we make it explicit here to aid in the React Native upgrade process. + :hermes_enabled => false + ) # Comment the next line if you don't want to use dynamic frameworks use_frameworks! @@ -43,8 +49,10 @@ post_install do |installer| installer.generated_projects.each do |project| project.targets.each do |target| target.build_configurations.each do |config| - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.1' + # TODO: remove this once we migrate the Pipelines to use arm64 MacOS + config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64" end end end -end \ No newline at end of file +end diff --git a/onnxruntime/core/providers/coreml/model/model.mm b/onnxruntime/core/providers/coreml/model/model.mm index 5211b89ec1..fff1c231f9 100644 --- a/onnxruntime/core/providers/coreml/model/model.mm +++ b/onnxruntime/core/providers/coreml/model/model.mm @@ -369,20 +369,22 @@ void ProfileComputePlan(NSURL* compileUrl, MLModelConfiguration* config) { #define HAS_COREMLOPTIMIZATIONHINT 0 #endif -API_AVAILABLE_COREML8 + void ConfigureOptimizationHints(MLModelConfiguration* config, const CoreMLOptions& coreml_options) { + if (HAS_COREML8_OR_LATER) { #if HAS_COREMLOPTIMIZATIONHINT - MLOptimizationHints* optimizationHints = [[MLOptimizationHints alloc] init]; - if (coreml_options.UseStrategy("FastPrediction")) { - optimizationHints.specializationStrategy = MLSpecializationStrategyFastPrediction; - config.optimizationHints = optimizationHints; - } else if (coreml_options.UseStrategy("Default")) { - optimizationHints.specializationStrategy = MLSpecializationStrategyDefault; - config.optimizationHints = optimizationHints; - } else { - // not set - } + MLOptimizationHints* optimizationHints = [[MLOptimizationHints alloc] init]; + if (coreml_options.UseStrategy("FastPrediction")) { + optimizationHints.specializationStrategy = MLSpecializationStrategyFastPrediction; + config.optimizationHints = optimizationHints; + } else if (coreml_options.UseStrategy("Default")) { + optimizationHints.specializationStrategy = MLSpecializationStrategyDefault; + config.optimizationHints = optimizationHints; + } else { + // not set + } #endif + } } Status CompileOrReadCachedModel(NSURL* modelUrl, const CoreMLOptions& coreml_options,