Skip to content

Commit 2eb900a

Browse files
committed
Adding preprocessor define for checking CAN_USE_COREML8_OR_LATER
1 parent e6e3747 commit 2eb900a

File tree

1 file changed

+1
-4
lines changed
  • onnxruntime/core/providers/coreml/model

1 file changed

+1
-4
lines changed

onnxruntime/core/providers/coreml/model/model.mm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,8 @@ void ProfileComputePlan(NSURL* compileUrl, MLModelConfiguration* config) {
369369
#define HAS_COREMLOPTIMIZATIONHINT 0
370370
#endif
371371

372-
373372
void ConfigureOptimizationHints(MLModelConfiguration* config, const CoreMLOptions& coreml_options) {
374-
if (HAS_COREML8_OR_LATER) {
375-
#if HAS_COREMLOPTIMIZATIONHINT
373+
#if HAS_COREMLOPTIMIZATIONHINT && CAN_USE_COREML8_OR_LATER
376374
MLOptimizationHints* optimizationHints = [[MLOptimizationHints alloc] init];
377375
if (coreml_options.UseStrategy("FastPrediction")) {
378376
optimizationHints.specializationStrategy = MLSpecializationStrategyFastPrediction;
@@ -384,7 +382,6 @@ void ConfigureOptimizationHints(MLModelConfiguration* config, const CoreMLOption
384382
// not set
385383
}
386384
#endif
387-
}
388385
}
389386

390387
Status CompileOrReadCachedModel(NSURL* modelUrl, const CoreMLOptions& coreml_options,

0 commit comments

Comments
 (0)