Skip to content

Commit 0cfc7f5

Browse files
shoumikhinfacebook-github-bot
authored andcommitted
Fix CI: cmake paths for the runner module, include runner module exported headers, fix Xcode project. (#1567)
Summary: Pull Request resolved: #1567 . Reviewed By: kimishpatel Differential Revision: D52636216 fbshipit-source-id: d572e8c7a914120d9d7e26ccada970d3fb697bc8
1 parent c0b4361 commit 0cfc7f5

File tree

5 files changed

+9
-14
lines changed

5 files changed

+9
-14
lines changed

build/build_apple_frameworks.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ mkdir -p "$HEADERS_PATH"
135135
//runtime/executor:program \
136136
//extension/data_loader: \
137137
//extension/memory_allocator: \
138+
//extension/runner/module: \
138139
| rsync -av --files-from=- "$SOURCE_ROOT_DIR" "$HEADERS_PATH/executorch"
139140

140141
echo "Creating frameworks"

build/print_exported_headers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def exported_headers(buck2: str, target: str) -> Set[str]:
4343
deps = query(buck2, target, "exported_deps")
4444
headers = set(query(buck2, target, "exported_headers"))
4545
headers.update(
46-
header for dep in deps for header in exported_headers(buck2, dep.split()[0])
46+
header
47+
for dep in deps
48+
for header in exported_headers(buck2, dep.split()[0])
49+
if header.endswith(".h")
4750
)
4851
return headers
4952

examples/demo-apps/apple_ios/ExecuTorchDemo/ExecuTorchDemo.xcodeproj/project.pbxproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
032C01B72AC329B6002955E1 /* CustomViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 032C01B62AC329B6002955E1 /* CustomViews.swift */; };
1818
032C01B92AC32ADF002955E1 /* CameraController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 032C01B82AC32ADF002955E1 /* CameraController.swift */; };
1919
032C01E82AC34B60002955E1 /* MobileNetClassifier.mm in Sources */ = {isa = PBXBuildFile; fileRef = 032C01902AC22B16002955E1 /* MobileNetClassifier.mm */; };
20-
032C01E92AC34B63002955E1 /* Module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 032C01942AC22B16002955E1 /* Module.cpp */; };
2120
032C01EC2AC34CAC002955E1 /* libMobileNetClassifier.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 032C01CB2AC34632002955E1 /* libMobileNetClassifier.a */; };
2221
032C02032AC47CFB002955E1 /* mv3_xnnpack_fp32.pte in Resources */ = {isa = PBXBuildFile; fileRef = 032C01FC2AC47CFB002955E1 /* mv3_xnnpack_fp32.pte */; };
2322
032C02082AC47CFB002955E1 /* imagenet_classes.txt in Resources */ = {isa = PBXBuildFile; fileRef = 032C02012AC47CFB002955E1 /* imagenet_classes.txt */; };
@@ -109,8 +108,6 @@
109108
032C018E2AC22B16002955E1 /* MobileNet-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MobileNet-Bridging-Header.h"; sourceTree = "<group>"; };
110109
032C01902AC22B16002955E1 /* MobileNetClassifier.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MobileNetClassifier.mm; sourceTree = "<group>"; };
111110
032C01912AC22B16002955E1 /* MobileNetClassifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobileNetClassifier.h; sourceTree = "<group>"; };
112-
032C01932AC22B16002955E1 /* Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Module.h; sourceTree = "<group>"; };
113-
032C01942AC22B16002955E1 /* Module.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Module.cpp; sourceTree = "<group>"; };
114111
032C01B62AC329B6002955E1 /* CustomViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomViews.swift; sourceTree = "<group>"; };
115112
032C01B82AC32ADF002955E1 /* CameraController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraController.swift; sourceTree = "<group>"; };
116113
032C01CB2AC34632002955E1 /* libMobileNetClassifier.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMobileNetClassifier.a; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -242,8 +239,6 @@
242239
032C018E2AC22B16002955E1 /* MobileNet-Bridging-Header.h */,
243240
032C01912AC22B16002955E1 /* MobileNetClassifier.h */,
244241
032C01902AC22B16002955E1 /* MobileNetClassifier.mm */,
245-
032C01932AC22B16002955E1 /* Module.h */,
246-
032C01942AC22B16002955E1 /* Module.cpp */,
247242
);
248243
path = MobileNet;
249244
sourceTree = "<group>";
@@ -488,7 +483,6 @@
488483
files = (
489484
03C818252AC75E580084CC29 /* MobileNetClassifier.swift in Sources */,
490485
032C01E82AC34B60002955E1 /* MobileNetClassifier.mm in Sources */,
491-
032C01E92AC34B63002955E1 /* Module.cpp in Sources */,
492486
);
493487
runOnlyForDeploymentPostprocessing = 0;
494488
};

examples/demo-apps/apple_ios/ExecuTorchDemo/ExecuTorchDemo/Sources/MobileNet/MobileNetClassifier.mm

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#import "MobileNetClassifier.h"
1010

11-
#import <executorch/extension/runner/module.h>
11+
#import <executorch/extension/runner/module/module.h>
1212

1313
using namespace ::torch::executor;
1414

@@ -50,11 +50,8 @@ - (BOOL)classifyWithInput:(float*)input
5050
outputSize:(NSInteger)outputSize
5151
error:(NSError**)error {
5252
int32_t sizes[] = {1, kChannels, kSize, kSize};
53-
uint8_t order[] = {0, 1, 2, 3};
54-
int32_t strides[] = {kChannels * kSize * kSize, kSize * kSize, kSize, 1};
55-
TensorImpl tensorImpl(
56-
ScalarType::Float, std::size(sizes), sizes, input, order, strides);
57-
std::vector<EValue> inputs = {EValue(Tensor(&tensorImpl))};
53+
TensorImpl tensorImpl(ScalarType::Float, std::size(sizes), sizes, input);
54+
std::vector<EValue> inputs{EValue(Tensor(&tensorImpl))};
5855
std::vector<EValue> outputs;
5956

6057
const auto torchError = _module->forward(inputs, outputs);

extension/runner/module/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cmake_minimum_required(VERSION 3.19)
1313

1414
# Source root directory for executorch.
1515
if(NOT EXECUTORCH_ROOT)
16-
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
16+
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
1717
endif()
1818

1919
list(TRANSFORM _extension_runner_module__srcs PREPEND "${EXECUTORCH_ROOT}/")

0 commit comments

Comments
 (0)