1
# @lint-ignore-every FBCODEBZLADDLOADS
2
load("//tools/build_defs:glob_defs.bzl", "subdir_glob")
4
# shared by internal and OSS BUCK
5
def define_tools_targets(
13
name = "substitutelib",
14
srcs = ["substitute.py"],
20
main_module = "substitute",
21
visibility = ["PUBLIC"],
29
# @lint-ignore BUCKRESTRICTEDSYNTAX
34
base_module = "tools",
35
visibility = ["PUBLIC"],
42
name = "gen_unboxing_bin",
43
main_module = "tools.jit.gen_unboxing",
53
name = "gen_selected_mobile_ops_header",
54
srcs = ["lite_interpreter/gen_selected_mobile_ops_header.py"],
55
base_module = "tools",
56
visibility = ["PUBLIC"],
60
name = "gen_oplist_lib",
62
("code_analyzer", "gen_oplist.py"),
63
("code_analyzer", "gen_op_registration_allowlist.py"),
65
base_module = "tools.code_analyzer",
69
visibility = ["PUBLIC"],
71
":gen_selected_mobile_ops_header",
73
third_party("pyyaml"),
79
main_module = "tools.code_analyzer.gen_oplist",
80
visibility = ["PUBLIC"],
87
name = "gen_operators_yaml_lib",
89
("code_analyzer", "gen_operators_yaml.py"),
90
("code_analyzer", "gen_op_registration_allowlist.py"),
94
":gen_operators_yaml_test",
97
third_party("pyyaml"),
103
name = "gen_operators_yaml",
104
main_module = "gen_operators_yaml",
105
visibility = ["PUBLIC"],
107
":gen_operators_yaml_lib",
113
# @lint-ignore BUCKRESTRICTEDSYNTAX
117
base_module = "tools",
119
"autograd/deprecated.yaml",
120
"autograd/derivatives.yaml",
121
"autograd/templates/ADInplaceOrViewType.cpp",
122
"autograd/templates/Functions.cpp",
123
"autograd/templates/Functions.h",
124
"autograd/templates/TraceType.cpp",
125
"autograd/templates/VariableType.cpp",
126
"autograd/templates/VariableType.h",
127
"autograd/templates/ViewFuncs.cpp",
128
"autograd/templates/ViewFuncs.h",
129
"autograd/templates/annotated_fn_args.py.in",
130
"autograd/templates/python_enum_tag.cpp",
131
"autograd/templates/python_fft_functions.cpp",
132
"autograd/templates/python_functions.cpp",
133
"autograd/templates/python_functions.h",
134
"autograd/templates/python_linalg_functions.cpp",
135
"autograd/templates/python_nested_functions.cpp",
136
"autograd/templates/python_nn_functions.cpp",
137
"autograd/templates/python_return_types.h",
138
"autograd/templates/python_return_types.cpp",
139
"autograd/templates/python_sparse_functions.cpp",
140
"autograd/templates/python_special_functions.cpp",
141
"autograd/templates/python_torch_functions.cpp",
142
"autograd/templates/python_variable_methods.cpp",
143
"autograd/templates/variable_factories.h",
145
visibility = ["PUBLIC"],
147
third_party("pyyaml"),
153
name = "generate_code",
155
"setup_helpers/generate_code.py",
157
base_module = "tools",
166
name = "generate_code_bin",
167
main_module = "tools.setup_helpers.generate_code",
168
# Windows does not support inplace:
169
# https://github.com/facebook/buck/issues/2161.
171
# Note that //arvr/mode/embedded/win/clang-aarch64-release sets
172
# its target platform to
173
# ovr_config//platform/embedded:clang-aarch64-linux-release, hence
174
# that is why we are selecting that OS to trigger this behavior.
175
package_style = select({
176
"DEFAULT": "inplace",
177
"ovr_config//os:linux-arm64": "standalone",
179
visibility = ["PUBLIC"],
180
# Because Windows does not support inplace packaging, we need to
181
# ensure it is unzipped before executing it, otherwise it will not
182
# be able to find any resources using path manipulation.
184
# See note above about why the OS is Linux here and not Windows.
187
"ovr_config//os:linux-arm64": False,
195
name = "gen-version-header-lib",
197
"setup_helpers/gen_version_header.py",
204
name = "gen-version-header",
205
main_module = "setup_helpers.gen_version_header",
206
visibility = ["PUBLIC"],
208
":gen-version-header-lib",
213
name = "gen_aten_vulkan_spv_lib",
217
base_module = "tools",
224
name = "gen_aten_vulkan_spv_bin",
225
main_module = "tools.gen_vulkan_spv",
230
":gen_aten_vulkan_spv_lib",
235
name = "vulkan_codegen_test",
237
"test/test_vulkan_codegen.py",
240
visibility = ["PUBLIC"],
242
":gen_aten_vulkan_spv_lib",
247
name = "selective_build_test",
249
"test/test_selective_build.py",
252
visibility = ["PUBLIC"],
259
name = "gen_oplist_test",
261
"test/gen_oplist_test.py",
264
visibility = ["PUBLIC"],
271
name = "gen_operators_yaml_test",
273
"test/gen_operators_yaml_test.py",
275
visibility = ["PUBLIC"],
278
":gen_operators_yaml_lib",
283
name = "test_codegen",
285
"test/test_codegen.py",
288
visibility = ["PUBLIC"],
296
name = "test_torchgen_executorch",
298
"test/test_executorch_gen.py",
299
"test/test_executorch_signatures.py",
300
"test/test_executorch_types.py",
301
"test/test_executorch_unboxing.py",
304
visibility = ["PUBLIC"],