From 2bc621f2c0b2f180f97f10a6f855a65bdc1448b9 Mon Sep 17 00:00:00 2001 From: wejoncy Date: Mon, 9 Dec 2024 12:13:35 +0800 Subject: [PATCH] Add comments for clang version checks --- onnxruntime/core/providers/coreml/model/model.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/onnxruntime/core/providers/coreml/model/model.mm b/onnxruntime/core/providers/coreml/model/model.mm index 4edd693d78805..14340a4ac8c36 100644 --- a/onnxruntime/core/providers/coreml/model/model.mm +++ b/onnxruntime/core/providers/coreml/model/model.mm @@ -302,6 +302,8 @@ Status GetMLMultiArrayCopyInfo(const MLMultiArray* _Nonnull array, } // since __clang_major__ >= 15, MLComputePlan is introduced in +// We are actually ensure the MacOS/IOS version and Xcode version is greater than `macOS 14.4, iOS 17.4`. +// Otherwise, the compiler will complain `MLComputePlan` is not defined. // we define __clang_analyzer__ here is for bypass static analysis void ProfileComputePlan(NSURL* compileUrl, MLModelConfiguration* config) { #if defined(__APPLE__) && defined(__clang__) && __clang_major__ >= 15 && !defined(__clang_analyzer__) @@ -457,6 +459,7 @@ Status Predict(const std::unordered_map& inputs, // Set the specialization strategy to FastPrediction for macOS 10.15+ // since __clang_major__ >= 15, optimizationHints is introduced in +// Same as above comments for why we are checking __clang_major__. // we define __clang_analyzer__ here is for bypass static analysis #if defined(__APPLE__) && defined(__clang__) && __clang_major__ >= 15 && !defined(__clang_analyzer__) if (HAS_COREML8_OR_LATER) {