Skip to content

Commit 8ab3f20

Browse files
JakeStevensfacebook-github-bot
authored andcommitted
Update targets file
Summary: Quantized add was added but was not added to the operators in the bzl We also expose only q/dq, as many projects that fully delegate only use q/dq Differential Revision: D81992378
1 parent 879e7ba commit 8ab3f20

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

backends/cortex_m/ops/targets.bzl

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ def define_operator_target(name: str):
2525
OPERATORS = [
2626
"quantize_per_tensor",
2727
"dequantize_per_tensor",
28+
"quantized_add",
29+
]
30+
31+
# Q/DQ only operators for specialized builds
32+
Q_DQ_OPERATORS = [
33+
"quantize_per_tensor",
34+
"dequantize_per_tensor",
2835
]
2936

3037
def define_common_targets():
@@ -81,3 +88,50 @@ def define_common_targets():
8188
define_static_targets = True,
8289
support_exceptions = False,
8390
)
91+
92+
# Q/DQ only targets for specialized builds
93+
q_dq_op_targets = [":op_{}".format(op) for op in Q_DQ_OPERATORS]
94+
95+
runtime.cxx_library(
96+
name = "cortex_m_q_dq_operators",
97+
srcs = [],
98+
visibility = [
99+
"//executorch/...",
100+
"@EXECUTORCH_CLIENTS",
101+
],
102+
platforms = CXX,
103+
exported_deps = q_dq_op_targets,
104+
)
105+
106+
et_operator_library(
107+
name = "q_dq_ops_lib",
108+
ops = [
109+
"cortex_m::quantize_per_tensor.out",
110+
"cortex_m::dequantize_per_tensor.out",
111+
]
112+
)
113+
114+
executorch_generated_lib(
115+
name = "cortex_m_q_dq_generated_lib",
116+
deps = [
117+
":q_dq_ops_lib",
118+
":cortex_m_q_dq_operators",
119+
],
120+
functions_yaml_target = ":operators.yaml",
121+
platforms = CXX,
122+
visibility = ["PUBLIC"],
123+
define_static_targets = True,
124+
)
125+
126+
executorch_generated_lib(
127+
name = "cortex_m_q_dq_no_except_generated_lib",
128+
deps = [
129+
":q_dq_ops_lib",
130+
":cortex_m_q_dq_operators",
131+
],
132+
functions_yaml_target = ":operators.yaml",
133+
platforms = CXX,
134+
visibility = ["PUBLIC"],
135+
define_static_targets = True,
136+
support_exceptions = False,
137+
)

0 commit comments

Comments
 (0)