Skip to content

Commit e789002

Browse files
authored
Dtype selective build: fail if not xplat, if portable/optimized not in kernel_deps
Differential Revision: D75027794 Pull Request resolved: #10990
1 parent 61c41e2 commit e789002

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

shim_et/xplat/executorch/codegen/codegen.bzl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,21 @@ def executorch_generated_lib(
641641
if not aten_mode and not functions_yaml_target and not custom_ops_yaml_target:
642642
fail("At least one of functions_yaml_target, custom_ops_yaml_target needs to be provided")
643643

644+
if dtype_selective_build:
645+
if (not "//executorch/kernels/portable:operators" in kernel_deps) and (not "//executorch/kernels/optimized:optimized_operators" in kernel_deps):
646+
fail("""
647+
!!WARNING!! Dtype selective build is available for the portable and optimized kernel libraries.
648+
If you are using those, please add them to `kernel_deps` in `executorch_generated_lib`:
649+
//executorch/kernels/portable:operators
650+
//executorch/kernels/optimized:optimized_operators
651+
This will tell the build system to rebuild portable/optimized with the dtype selective build header.
652+
For examples, see: //executorch/examples/selective_build/targets.bzl
653+
Currently, kernel_deps contains {}.
654+
655+
If you have a custom kernel library, please remove `dtype_selective_build=True`
656+
and use regular selective build.
657+
""".format(kernel_deps))
658+
644659
aten_suffix = "_aten" if aten_mode else ""
645660

646661
# merge functions.yaml with fallback yaml

0 commit comments

Comments
 (0)