Skip to content

Commit e0ed175

Browse files
committed
Address comments
1 parent 9a5c951 commit e0ed175

22 files changed

+73
-52
lines changed

backends/apple/coreml/runtime/delegate/ETCoreMLAsset.mm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
//
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

8-
#import "ETCoreMLLogging.h"
98
#import "ETCoreMLAsset.h"
109

10+
#import "ETCoreMLLogging.h"
11+
#import "objc_safe_cast.h"
12+
1113
#import <fcntl.h>
1214
#import <os/lock.h>
1315
#import <stdio.h>
1416
#import <system_error>
15-
16-
#import "objc_safe_cast.h"
17-
1817
namespace {
1918
using namespace executorchcoreml;
2019

backends/apple/coreml/runtime/delegate/ETCoreMLAssetManager.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

88
#import "ETCoreMLAssetManager.h"
9+
910
#import "ETCoreMLAsset.h"
1011
#import "ETCoreMLLogging.h"
1112
#import "database.hpp"
12-
#import <iostream>
1313
#import "json_key_value_store.hpp"
1414
#import "serde_json.h"
15+
16+
#import <iostream>
1517
#import <sstream>
1618

1719
namespace {

backends/apple/coreml/runtime/delegate/ETCoreMLDefaultModelExecutor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
2-
// ETCoreMLDefaultModelExecutor.h
3-
// executorchcoreml_tests
2+
// ETCoreMLDefaultModelExecutor.h
43
//
5-
// Created by Gyan Sinha on 2/25/24.
4+
// Copyright © 2024 Apple Inc. All rights reserved.
65
//
6+
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

88
#import <CoreML/CoreML.h>
99

backends/apple/coreml/runtime/delegate/ETCoreMLDefaultModelExecutor.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
2-
// ETCoreMLDefaultModelExecutor.m
3-
// executorchcoreml_tests
2+
// ETCoreMLDefaultModelExecutor.mm
43
//
5-
// Created by Gyan Sinha on 2/25/24.
4+
// Copyright © 2024 Apple Inc. All rights reserved.
65
//
6+
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

88
#import "ETCoreMLAsset.h"
99
#import "ETCoreMLDefaultModelExecutor.h"

backends/apple/coreml/runtime/delegate/ETCoreMLLogging.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

88
#import <Foundation/Foundation.h>
9+
#import <os/log.h>
910

1011
#import <executorch/runtime/platform/log.h>
11-
#import <os/log.h>
1212

1313
NS_ASSUME_NONNULL_BEGIN
1414

@@ -51,9 +51,9 @@ typedef NS_ERROR_ENUM(ETCoreMLErrorDomain, ETCoreMLError) {
5151
#define ETCoreMLLogError(error, formatString, ...) \
5252
do { \
5353
NSString *message = error.localizedDescription; \
54-
message = [NSString stringWithFormat:@"[Core ML] " formatString " %@", ##__VA_ARGS__, message]; \
54+
message = [NSString stringWithFormat:@"[Core ML] " formatString " %@", ##__VA_ARGS__, message]; \
5555
ET_LOG(Error, "%s", message.UTF8String); \
56-
} while(0) \
56+
} while(0)
5757
#else
5858
#define ETCoreMLLogError(error, formatString, ...) \
5959
os_log_error(ETCoreMLErrorUtils.loggingChannel, formatString " %@", ##__VA_ARGS__, error.localizedDescription);
@@ -77,7 +77,7 @@ typedef NS_ERROR_ENUM(ETCoreMLErrorDomain, ETCoreMLError) {
7777
if (errorOut) { \
7878
*errorOut = localError; \
7979
} \
80-
} while (0)
80+
} while(0)
8181

8282
/// Record the error and its underlying error with `os_log_error` and fills `*errorOut` with `NSError`.
8383
#define ETCoreMLLogUnderlyingErrorAndSetNSError(errorOut, errorCode, underlyingNSError, formatString, ...) \
@@ -88,7 +88,7 @@ typedef NS_ERROR_ENUM(ETCoreMLErrorDomain, ETCoreMLError) {
8888
underlyingError:underlyingNSError \
8989
format:@formatString, ##__VA_ARGS__]; \
9090
} \
91-
} while(0) \
91+
} while(0)
9292

9393

9494
#pragma clang diagnostic pop

backends/apple/coreml/runtime/delegate/ETCoreMLLogging.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

88
#import "ETCoreMLLogging.h"
9+
910
#import "ETCoreMLStrings.h"
1011

1112
const NSErrorDomain ETCoreMLErrorDomain = @"com.apple.executorchcoreml";

backends/apple/coreml/runtime/delegate/ETCoreMLModelCompiler.mm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
//
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

8-
#import <ETCoreMLModelCompiler.h>
9-
#import <ETCoreMLLogging.h>
8+
#import "ETCoreMLModelCompiler.h"
9+
10+
#import "ETCoreMLLogging.h"
11+
1012
#import <TargetConditionals.h>
1113

1214
@implementation ETCoreMLModelCompiler

backends/apple/coreml/runtime/delegate/ETCoreMLModelLoader.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
//
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

8+
#import "ETCoreMLModelLoader.h"
9+
10+
#import "asset.h"
811
#import "ETCoreMLAsset.h"
912
#import "ETCoreMLAssetManager.h"
1013
#import "ETCoreMLDefaultModelExecutor.h"
1114
#import "ETCoreMLLogging.h"
1215
#import "ETCoreMLModel.h"
13-
#import "ETCoreMLModelLoader.h"
14-
#import "asset.h"
1516
#import "model_metadata.h"
1617

1718
using namespace executorchcoreml;

backends/apple/coreml/runtime/delegate/ETCoreMLModelManager.mm

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,30 @@
55
//
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

8+
#import "ETCoreMLModelManager.h"
9+
810
#import "ETCoreMLAsset.h"
9-
#include <Foundation/Foundation.h>
1011
#import "ETCoreMLAssetManager.h"
1112
#import "ETCoreMLDefaultModelExecutor.h"
1213
#import "ETCoreMLLogging.h"
1314
#import "ETCoreMLModel.h"
1415
#import "ETCoreMLModelCompiler.h"
1516
#import "ETCoreMLModelExecutor.h"
1617
#import "ETCoreMLModelLoader.h"
17-
#import "ETCoreMLModelManager.h"
1818
#import "ETCoreMLStrings.h"
1919
#import "MLModel_Prewarm.h"
2020
#import "MLMultiArray_Copy.h"
21-
#import <filesystem>
2221
#import "inmemory_filesystem_utils.hpp"
23-
#import <iostream>
24-
#import <memory>
2522
#import "model_metadata.h"
2623
#import "multiarray.h"
2724
#import "objc_array_util.h"
25+
#import "serde_json.h"
26+
27+
#import <filesystem>
28+
#import <iostream>
29+
#import <memory>
2830
#import <optional>
2931
#import <os/lock.h>
30-
#import "serde_json.h"
3132
#import <string>
3233
#import <system_error>
3334
#import <vector>

backends/apple/coreml/runtime/delegate/MLModel_Prewarm.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

88
#import "MLModel_Prewarm.h"
9+
910
#import <algorithm>
1011

1112
@interface MLMultiArray (Prewarm)

backends/apple/coreml/runtime/delegate/MLMultiArray_Copy.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

88
#import "MLMultiArray_Copy.h"
9+
910
#import "objc_array_util.h"
1011
#import "multiarray.h"
1112

backends/apple/coreml/runtime/delegate/asset.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
//
2-
// ModelAsset.cpp
2+
// asset.cpp
33
//
44
// Copyright © 2024 Apple Inc. All rights reserved.
55
//
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

88

9-
#import <asset.h>
9+
#import "asset.h"
1010

1111
#import <optional>
1212

13-
#import <objc_safe_cast.h>
13+
#import "objc_safe_cast.h"
1414

1515
namespace {
1616

backends/apple/coreml/runtime/delegate/backend_delegate.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
#pragma once
99

10-
#include <model_logging_options.h>
10+
#include "model_logging_options.h"
11+
1112
#include <system_error>
1213
#include <unordered_map>
1314
#include <vector>

backends/apple/coreml/runtime/delegate/backend_delegate.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

88

9-
#import "ETCoreMLLogging.h"
9+
#import "backend_delegate.h"
10+
1011
#import "ETCoreMLAssetManager.h"
12+
#import "ETCoreMLLogging.h"
1113
#import "ETCoreMLModel.h"
1214
#import "ETCoreMLModelManager.h"
1315
#import "ETCoreMLStrings.h"
14-
#import "backend_delegate.h"
1516
#import "model_event_logger.h"
1617
#import "multiarray.h"
1718

backends/apple/coreml/runtime/delegate/coreml_backend_delegate.mm

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@
55
//
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

8-
#import <ETCoreMLLogging.h>
9-
#import <ETCoreMLModel.h>
10-
#import <ETCoreMLStrings.h>
11-
#import <backend_delegate.h>
12-
#import <coreml_backend/delegate.h>
8+
#import "coreml_backend/delegate.h"
9+
10+
#import "backend_delegate.h"
11+
#import "ETCoreMLLogging.h"
12+
#import "ETCoreMLModel.h"
13+
#import "ETCoreMLStrings.h"
14+
#import "model_event_logger.h"
15+
#import "model_logging_options.h"
16+
#import "multiarray.h"
17+
#import "objc_safe_cast.h"
18+
1319
#import <executorch/runtime/core/evalue.h>
1420
#import <executorch/runtime/platform/log.h>
1521
#import <executorch/runtime/kernel/kernel_includes.h>
22+
23+
#include <array>
1624
#import <memory>
17-
#import <model_event_logger.h>
18-
#import <model_logging_options.h>
19-
#import <multiarray.h>
20-
#import <objc_safe_cast.h>
2125
#import <unordered_map>
2226
#import <vector>
23-
#include <array>
2427

2528
#ifdef ET_EVENT_TRACER_ENABLED
2629
#import <model_event_logger_impl.h>

backends/apple/coreml/runtime/delegate/multiarray.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
88

99
#import "multiarray.h"
10+
11+
#import "objc_array_util.h"
12+
1013
#import <Accelerate/Accelerate.h>
1114
#import <CoreML/CoreML.h>
1215
#import <functional>
1316
#import <numeric>
14-
#import "objc_array_util.h"
1517
#import <optional>
1618
#import <vector>
1719

backends/apple/coreml/runtime/delegate/serde_json.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

88
#import "serde_json.h"
9+
910
#import "asset.h"
1011
#import "objc_json_serde.h"
1112
#import "model_metadata.h"

backends/apple/coreml/runtime/sdk/ETCoreMLModelDebugger.mm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#import "ETCoreMLModelDebugger.h"
99

10-
#import <CoreML/CoreML.h>
1110
#import "ETCoreMLAsset.h"
1211
#import "ETCoreMLAssetManager.h"
1312
#import "ETCoreMLLogging.h"
@@ -16,12 +15,14 @@
1615
#import "ETCoreMLModelStructurePath.h"
1716
#import "ETCoreMLPair.h"
1817
#import "ETCoreMLStrings.h"
19-
#import <format/MIL.pb.h>
20-
#import <format/Model.pb.h>
21-
#import <fstream>
22-
#import <iostream>
18+
#import "format/MIL.pb.h"
19+
#import "format/Model.pb.h"
2320
#import "model_package_info.h"
2421
#import "objc_json_serde.h"
22+
23+
#import <CoreML/CoreML.h>
24+
#import <fstream>
25+
#import <iostream>
2526
#import <string>
2627
#import <unordered_map>
2728

backends/apple/coreml/runtime/sdk/ETCoreMLModelProfiler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Please refer to the license found in the LICENSE file in the root directory of the source tree.
77

88
#import "ETCoreMLPair.h"
9+
910
#import <CoreML/CoreML.h>
1011
#import <TargetConditionals.h>
1112

backends/apple/coreml/runtime/sdk/ETCoreMLModelProfiler.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
#import "ETCoreMLOperationProfilingInfo.h"
1515
#import "ETCoreMLPair.h"
1616
#import "ETCoreMLStrings.h"
17+
#import "program_path.h"
18+
1719
#import <mach/mach_time.h>
1820
#import <math.h>
19-
#import "program_path.h"
2021

2122
namespace {
2223
using namespace executorchcoreml::modelstructure;

backends/apple/coreml/runtime/sdk/ETCoreMLOperationProfilingInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#import <CoreML/CoreML.h>
99

10-
#import <ETCoreMLComputeUnits.h>
10+
#import "ETCoreMLComputeUnits.h"
1111

1212
NS_ASSUME_NONNULL_BEGIN
1313

backends/apple/coreml/runtime/sdk/model_event_logger_impl.mm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99

1010
#import "ETCoreMLModelStructurePath.h"
1111
#import "ETCoreMLOperationProfilingInfo.h"
12-
#import <executorch/runtime/core/event_tracer.h>
1312
#import "objc_array_util.h"
13+
#import "MLMultiArray_Copy.h"
14+
15+
#import <executorch/runtime/core/event_tracer.h>
16+
1417
#import <mach/mach_time.h>
1518
#import <numeric>
16-
#import "MLMultiArray_Copy.h"
1719

1820
namespace {
1921

0 commit comments

Comments
 (0)