mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-06 00:03:22 +00:00
Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
f142392163
commit
f4accbe663
2 changed files with 10 additions and 12 deletions
|
|
@ -47,7 +47,6 @@
|
|||
// The following macros are used in implementation files to check the availability of the APIs.
|
||||
#define CAN_USE_COREML8_OR_LATER (__MAC_OS_X_VERSION_MAX_ALLOWED >= 150000 && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000)
|
||||
|
||||
|
||||
// @available is used in implementation code
|
||||
// Base required OS to run CoreML Specification Version 4 (Core ML 3)
|
||||
#define HAS_COREML3_OR_LATER @available(macOS 10.15, iOS 13, *)
|
||||
|
|
@ -57,7 +56,6 @@
|
|||
#define HAS_COREML7_OR_LATER @available(macOS 14, iOS 17, *)
|
||||
#define HAS_COREML8_OR_LATER @available(macOS 15, iOS 18, *)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#define MINIMUM_COREML_VERSION 3 // first version we support
|
||||
|
|
|
|||
|
|
@ -371,16 +371,16 @@ void ProfileComputePlan(NSURL* compileUrl, MLModelConfiguration* config) {
|
|||
|
||||
void ConfigureOptimizationHints(MLModelConfiguration* config, const CoreMLOptions& coreml_options) {
|
||||
#if HAS_COREMLOPTIMIZATIONHINT && CAN_USE_COREML8_OR_LATER
|
||||
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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue