Skip to content

Commit

Permalink
pass static anaysis
Browse files Browse the repository at this point in the history
  • Loading branch information
wejoncy committed Dec 10, 2024
1 parent 590a80c commit 5bfc8eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions onnxruntime/core/providers/coreml/model/model.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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 <CoreML/CoreML.h>
// Otherwise, the compiler will complain `MLComputePlan` is not defined.
Expand Down

0 comments on commit 5bfc8eb

Please sign in to comment.