Skip to content

Commit 73c561c

Browse files
Add buck files (#16568)
Co-authored-by: meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com>
1 parent 9510334 commit 73c561c

172 files changed

Lines changed: 2081 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backends/apple/coreml/BUCK

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Any targets that should be shared between fbcode and xplat must be defined in
2+
# targets.bzl. This file can contain xplat-only targets.
3+
4+
load(
5+
"@fbsource//tools/build_defs:default_platform_defs.bzl",
6+
"APPLE",
7+
)
8+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
9+
load("@fbsource//xplat/executorch/runtime/core:targets.bzl", "build_sdk")
10+
11+
oncall("executorch")
12+
13+
runtime.cxx_library(
14+
name = "coreml",
15+
srcs = [
16+
"runtime/delegate/ETCoreMLAsset.mm",
17+
"runtime/delegate/ETCoreMLAssetManager.mm",
18+
"runtime/delegate/ETCoreMLDefaultModelExecutor.mm",
19+
"runtime/delegate/ETCoreMLLogging.mm",
20+
"runtime/delegate/ETCoreMLModel.mm",
21+
"runtime/delegate/ETCoreMLModelCompiler.mm",
22+
"runtime/delegate/ETCoreMLModelLoader.mm",
23+
"runtime/delegate/ETCoreMLModelManager.mm",
24+
"runtime/delegate/ETCoreMLStrings.mm",
25+
"runtime/delegate/MLModel_Prewarm.mm",
26+
"runtime/delegate/MLMultiArray_Copy.mm",
27+
"runtime/delegate/asset.mm",
28+
"runtime/delegate/backend_delegate.mm",
29+
"runtime/delegate/coreml_backend_delegate.mm",
30+
"runtime/delegate/multiarray.mm",
31+
"runtime/delegate/executorch_operations.mm",
32+
"runtime/delegate/serde_json.mm",
33+
"runtime/inmemoryfs/inmemory_filesystem.cpp",
34+
"runtime/inmemoryfs/inmemory_filesystem_utils.mm",
35+
"runtime/inmemoryfs/memory_buffer.cpp",
36+
"runtime/inmemoryfs/memory_stream.cpp",
37+
"runtime/inmemoryfs/reversed_memory_stream.cpp",
38+
"runtime/kvstore/database.cpp",
39+
"runtime/kvstore/json_key_value_store.cpp",
40+
"runtime/kvstore/key_value_store.cpp",
41+
"runtime/kvstore/sqlite_error.cpp",
42+
"runtime/kvstore/statement.cpp",
43+
"runtime/util/json_util.cpp",
44+
"runtime/util/objc_json_serde.mm",
45+
] + (glob([
46+
"runtime/sdk/*.mm",
47+
]) if build_sdk() else []),
48+
headers = glob([
49+
"runtime/include/coreml_backend/delegate.h",
50+
"runtime/kvstore/*.hpp",
51+
"runtime/inmemoryfs/*.hpp",
52+
"runtime/delegate/*.h",
53+
"runtime/delegate/*.hpp",
54+
"runtime/util/*.h",
55+
"runtime/util/*.hpp",
56+
]) + (glob([
57+
"runtime/sdk/*.h",
58+
]) if build_sdk() else []),
59+
compiler_flags = [
60+
"-fobjc-arc",
61+
"-fno-exceptions",
62+
"-fno-rtti",
63+
"-Wno-null-character",
64+
"-Wno-receiver-expr",
65+
"-Wno-error",
66+
],
67+
define_static_target = True,
68+
header_namespace = "backends/apple/coreml",
69+
exported_headers = ["runtime/delegate/executorch_operations.h", "runtime/include/coreml_backend/delegate.h"],
70+
fbobjc_ios_target_sdk_version = "13.0",
71+
fbobjc_frameworks = [
72+
"Accelerate",
73+
"CoreML",
74+
"Foundation",
75+
],
76+
include_directories = [
77+
"runtime/include",
78+
"runtime/kvstore",
79+
"runtime/inmemoryfs",
80+
"runtime/delegate",
81+
"runtime/util",
82+
] + ([
83+
"runtime/sdk",
84+
] if build_sdk() else []),
85+
fbobjc_libraries = [
86+
"libsqlite3",
87+
],
88+
link_whole = True,
89+
platforms = [APPLE],
90+
visibility = ["PUBLIC"],
91+
deps = [
92+
"//executorch/runtime/backend:interface",
93+
"//executorch/runtime/core:core",
94+
"//executorch/runtime/kernel:kernel_includes",
95+
] + ([
96+
":proto",
97+
] if build_sdk() else []),
98+
)
99+
100+
_PROTOS = [
101+
"ArrayFeatureExtractor",
102+
"AudioFeaturePrint",
103+
"BayesianProbitRegressor",
104+
"CategoricalMapping",
105+
"ClassConfidenceThresholding",
106+
"CustomModel",
107+
"DataStructures",
108+
"DictVectorizer",
109+
"FeatureTypes",
110+
"FeatureVectorizer",
111+
"Gazetteer",
112+
"GLMClassifier",
113+
"GLMRegressor",
114+
"Identity",
115+
"Imputer",
116+
"ItemSimilarityRecommender",
117+
"LinkedModel",
118+
"MIL",
119+
"Model",
120+
"NearestNeighbors",
121+
"NeuralNetwork",
122+
"NonMaximumSuppression",
123+
"Normalizer",
124+
"OneHotEncoder",
125+
"Parameters",
126+
"Scaler",
127+
"SoundAnalysisPreprocessing",
128+
"SVM",
129+
"TextClassifier",
130+
"TreeEnsemble",
131+
"VisionFeaturePrint",
132+
"WordEmbedding",
133+
"WordTagger",
134+
]
135+
136+
runtime.cxx_library(
137+
name = "proto",
138+
srcs = [
139+
"fbsource//third-party/pypi/coremltools:exported-cpp-protoc[{}.pb.cc]".format(name)
140+
for name in _PROTOS
141+
],
142+
exported_headers = {
143+
"format/{}.pb.h".format(name): "fbsource//third-party/pypi/coremltools:exported-cpp-protoc[{}.pb.h]".format(name)
144+
for name in _PROTOS
145+
},
146+
compiler_flags = [
147+
"-Wno-global-constructors",
148+
],
149+
public_include_directories = [
150+
"",
151+
],
152+
deps = [
153+
"//third-party/protobuf:fb-protobuf-lite",
154+
],
155+
)

backends/apple/mps/BUCK

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#
2+
# Copyright (c) 2023 Apple Inc. All rights reserved.
3+
# Provided subject to the LICENSE file in the top level directory.
4+
#
5+
6+
# Any targets that should be shared between fbcode and xplat must be defined in
7+
# targets.bzl. This file can contain xplat-only targets.
8+
9+
load("@fbsource//tools/build_defs:default_platform_defs.bzl", "APPLE")
10+
load(":targets.bzl", "define_common_targets")
11+
12+
oncall("executorch")
13+
14+
define_common_targets(
15+
is_xplat = True,
16+
platforms = [APPLE],
17+
)

backends/arm/runtime/BUCK

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load("targets.bzl", "define_common_targets")
2+
3+
oncall("odai_jarvis")
4+
5+
define_common_targets()

backends/cadence/common/BUCK

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
load("@fbsource//tools/build_defs:platform_defs.bzl", "CXX")
2+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
3+
4+
oncall("odai_jarvis")
5+
6+
runtime.cxx_library(
7+
name = "xt_macros",
8+
exported_headers=["xt_macros.h"],
9+
platforms = CXX,
10+
visibility = ["PUBLIC"],
11+
compatible_with = ["ovr_config//cpu:xtensa"],
12+
deps = [
13+
"//executorch/runtime/core/exec_aten/util:tensor_util",
14+
]
15+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load("targets.bzl", "define_common_targets")
2+
3+
oncall("odai_jarvis")
4+
5+
define_common_targets()
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
load("@fbcode//on_device_ai/Assistant/Jarvis/build:cxx_wrapper.bzl", "jarvis_wrapper")
2+
load("@fbsource//arvr/firmware/ar/build_defs:xtensa.bzl", "XTENSA_TEST_REMOTE_EXECUTION_ASIC")
3+
load("@fbsource//tools/build_defs:platform_defs.bzl", "CXX")
4+
load("@fbsource//tools/target_determinator/macros:ci.bzl", "ci")
5+
6+
oncall("odai_jarvis")
7+
8+
jarvis_wrapper.cxx_test(
9+
name = "test_op_add",
10+
srcs = [
11+
"test_op_add.cpp",
12+
],
13+
compatible_backends = ["g3"],
14+
labels = [ci.skip_target()],
15+
remote_execution = XTENSA_TEST_REMOTE_EXECUTION_ASIC,
16+
compiler_flags = [
17+
"-Wno-ignored-attributes",
18+
],
19+
platforms = CXX,
20+
visibility = [
21+
"fbsource//xplat/executorch/backends/cadence/...",
22+
"fbcode//executorch/backends/cadence/...",
23+
],
24+
deps = [
25+
"fbsource//xplat/executorch/backends/cadence/fusion_g3/operators:op_add",
26+
"fbsource//xplat/executorch/backends/cadence/runtime:et_pal",
27+
"fbsource//xplat/executorch/kernels/test:gtest_utils",
28+
"fbsource//xplat/executorch/runtime/core/exec_aten/testing_util:tensor_util",
29+
],
30+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load("targets.bzl", "define_common_targets")
2+
3+
oncall("odai_jarvis")
4+
5+
define_common_targets()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load("targets.bzl", "define_common_targets")
2+
3+
oncall("odai_jarvis")
4+
5+
define_common_targets()

backends/cadence/hifi/kernels/BUCK

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load("targets.bzl", "define_common_targets")
2+
3+
oncall("odai_jarvis")
4+
5+
define_common_targets()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
load("targets.bzl", "define_common_targets")
2+
3+
oncall("odai_jarvis")
4+
5+
define_common_targets()

0 commit comments

Comments
 (0)