forked from pytorch/executorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtargets.bzl
More file actions
64 lines (58 loc) · 2.49 KB
/
targets.bzl
File metadata and controls
64 lines (58 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "get_aten_mode_options", "runtime")
def define_common_targets():
"""Defines targets that should be shared between fbcode and xplat.
The directory containing this targets.bzl file should also contain both
TARGETS and BUCK files that call this function.
"""
for aten_mode in get_aten_mode_options():
aten_suffix = ("_aten" if aten_mode else "")
runtime.cxx_library(
name = "et_copy_index" + aten_suffix,
srcs = ["et_copy_index.cpp"],
visibility = [], # Private
exported_headers = ["et_copy_index.h"],
deps = [
"//executorch/runtime/kernel:kernel_includes" + aten_suffix,
"//executorch/runtime/core:core",
],
exported_deps = [
"//executorch/runtime/core:evalue" + aten_suffix,
"//executorch/runtime/kernel:kernel_runtime_context" + aten_suffix,
],
)
runtime.cxx_library(
name = "et_view" + aten_suffix,
srcs = ["et_view.cpp"],
visibility = [], # Private
exported_headers = ["et_view.h"],
deps = [
"//executorch/runtime/kernel:kernel_includes" + aten_suffix,
"//executorch/runtime/core:core",
],
exported_deps = [
"//executorch/runtime/core:evalue" + aten_suffix,
"//executorch/runtime/kernel:kernel_runtime_context" + aten_suffix,
],
)
runtime.cxx_library(
name = "prim_ops_registry" + aten_suffix,
srcs = ["register_prim_ops.cpp"],
visibility = [
"//executorch/...",
"@EXECUTORCH_CLIENTS",
],
# @lint-ignore BUCKLINT link_whole, need this to register prim ops.
link_whole = True,
# prim ops are registered through a global table so the ctor needs to be allowed
compiler_flags = select({
"DEFAULT": ["-Wno-global-constructors"],
"ovr_config//os:windows": [],
}),
deps = [
":et_copy_index" + aten_suffix,
":et_view" + aten_suffix,
"//executorch/runtime/core:evalue" + aten_suffix,
"//executorch/runtime/kernel:operator_registry" + aten_suffix,
"//executorch/runtime/kernel:kernel_includes" + aten_suffix,
],
)