diff --git a/onnxruntime/core/providers/coreml/model/model.mm b/onnxruntime/core/providers/coreml/model/model.mm index 23de66073c928..cccc7fa14550e 100644 --- a/onnxruntime/core/providers/coreml/model/model.mm +++ b/onnxruntime/core/providers/coreml/model/model.mm @@ -306,6 +306,7 @@ Status GetMLMultiArrayCopyInfo(const MLMultiArray* _Nonnull array, // we define __clang_analyzer__ here is for bypass static analysis API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), watchos(10.4)) void ProfileBlock(MLComputePlan* _Nullable computePlan, MLModelStructureProgramBlock* block) { +#if !defined(__clang_analyzer__) for (MLModelStructureProgramOperation* operation in block.operations) { for (size_t i = 0; i < operation.blocks.count; ++i) { ProfileBlock(computePlan, operation.blocks[i]); @@ -319,6 +320,7 @@ void ProfileBlock(MLComputePlan* _Nullable computePlan, MLModelStructureProgramB NSLog(@"Operation: %@, Device Usage: %@, Estimated Cost: %f", operation.operatorName, preferredDevice, estimatedCost.weight); } } +#endif } // since macos(14.4), ios(17.4), MLComputePlan is introduced in // Otherwise, the compiler will complain `MLComputePlan` is not defined.