Skip to content

Commit e3e8e60

Browse files
authored
Add -fexceptions to quantized kernel generated libs
Differential Revision: D84284541 Pull Request resolved: #14962
1 parent 4b7bea2 commit e3e8e60

File tree

1 file changed

+39
-34
lines changed

1 file changed

+39
-34
lines changed

kernels/quantized/targets.bzl

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -96,41 +96,46 @@ def define_common_targets():
9696
],
9797
)
9898

99-
executorch_generated_lib(
100-
name = "generated_lib" + aten_suffix,
101-
deps = [
102-
":quantized_operators" + aten_suffix,
103-
":all_quantized_ops",
104-
],
105-
custom_ops_yaml_target = ":quantized.yaml",
106-
custom_ops_aten_kernel_deps = [":quantized_operators_aten"] if aten_mode else [],
107-
custom_ops_requires_aot_registration = False,
108-
aten_mode = aten_mode,
109-
visibility = [
110-
"//executorch/...",
111-
"@EXECUTORCH_CLIENTS",
112-
],
113-
define_static_targets = True,
114-
)
99+
for support_exceptions in [True, False]:
100+
exception_suffix = "_no_exceptions" if not support_exceptions else ""
115101

116-
# On Windows we can only compile these two ops currently, so adding a
117-
# separate target for this.
118-
executorch_generated_lib(
119-
name = "q_dq_ops_generated_lib" + aten_suffix,
120-
custom_ops_yaml_target = ":quantized.yaml",
121-
kernel_deps = [
122-
"//executorch/kernels/quantized/cpu:op_quantize" + aten_suffix,
123-
"//executorch/kernels/quantized/cpu:op_dequantize" + aten_suffix,
124-
],
125-
aten_mode = aten_mode,
126-
deps = [
127-
":q_dq_ops",
128-
],
129-
visibility = [
130-
"//executorch/...",
131-
"@EXECUTORCH_CLIENTS",
132-
],
133-
)
102+
executorch_generated_lib(
103+
name = "generated_lib" + aten_suffix + exception_suffix,
104+
deps = [
105+
":quantized_operators" + aten_suffix,
106+
":all_quantized_ops",
107+
],
108+
custom_ops_yaml_target = ":quantized.yaml",
109+
custom_ops_aten_kernel_deps = [":quantized_operators_aten"] if aten_mode else [],
110+
custom_ops_requires_aot_registration = False,
111+
aten_mode = aten_mode,
112+
support_exceptions = support_exceptions,
113+
visibility = [
114+
"//executorch/...",
115+
"@EXECUTORCH_CLIENTS",
116+
],
117+
define_static_targets = True,
118+
)
119+
120+
# On Windows we can only compile these two ops currently, so adding a
121+
# separate target for this.
122+
executorch_generated_lib(
123+
name = "q_dq_ops_generated_lib" + aten_suffix + exception_suffix,
124+
custom_ops_yaml_target = ":quantized.yaml",
125+
kernel_deps = [
126+
"//executorch/kernels/quantized/cpu:op_quantize" + aten_suffix,
127+
"//executorch/kernels/quantized/cpu:op_dequantize" + aten_suffix,
128+
],
129+
aten_mode = aten_mode,
130+
deps = [
131+
":q_dq_ops",
132+
],
133+
support_exceptions = support_exceptions,
134+
visibility = [
135+
"//executorch/...",
136+
"@EXECUTORCH_CLIENTS",
137+
],
138+
)
134139

135140
runtime.python_library(
136141
name = "quantized_ops_lib",

0 commit comments

Comments
 (0)