Skip to content

Commit 2bd37ca

Browse files
committed
Update on "[Executorch][optimized] Fix op_div impl to use portable for fallback path"
Earlier we just copy pasted from portable impl. This diff refactors portable to make it usable from optimized lib. As a result we get all the size reduction benefit from build and size optimizations landed in portable. Differential Revision: [D65606665](https://our.internmc.facebook.com/intern/diff/D65606665/) [ghstack-poisoned]
2 parents d992a94 + efcb000 commit 2bd37ca

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

shim/xplat/executorch/kernels/portable/op_registration_util.bzl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,9 +1265,16 @@ CUSTOM_OPS = (
12651265
),
12661266
)
12671267

1268+
# Lists which ops are refactored into separate impl files that can be reused elsewhere.
1269+
# Not the best way to track this since we should not have list files like this at all
1270+
# but maybe we can figure out how to refactor selective build.
1271+
ATEN_OP_IMPLS = ["op_div"]
1272+
12681273
def portable_source_list():
12691274
"""All the source file names from //executorch/kernels/portable/cpu/"""
1270-
return [op["name"] + ".cpp" for op in ATEN_OPS + CUSTOM_OPS]
1275+
sources = [op["name"] + ".cpp" for op in ATEN_OPS + CUSTOM_OPS]
1276+
sources = sources + [op + "_impl.cpp" for op in ATEN_OP_IMPLS]
1277+
return sources
12711278

12721279
def portable_header_list():
12731280
"""All the header file names from //executorch/kernels/portable/cpu/"""

0 commit comments

Comments
 (0)