MCPcopy Create free account
hub / github.com/pytorch/executorch / main

Function main

codegen/gen.py:868–1045  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

866
867
868def main() -> None:
869 parser = argparse.ArgumentParser(description="Generate operator source files")
870 # Although we don't refer to --source-path directly, make_file_manager()
871 # expects it to point to a directory that contains a templates/ subdirectory
872 # containing the file templates.
873 parser.add_argument(
874 "-s",
875 "--source-path",
876 help="path to source directory for kernel templates",
877 )
878 parser.add_argument(
879 "--functions-yaml-path",
880 "--functions_yaml_path",
881 help="path to the functions.yaml file to use. Optional, but at least "
882 "one of --functions-yaml-path and --custom-ops-yaml-path must be "
883 "specified.",
884 )
885 parser.add_argument(
886 "--custom-ops-yaml-path",
887 "--custom_ops_yaml_path",
888 help="path to the custom_ops.yaml file to use. Optional, but at least "
889 "one of --functions-yaml-path and --custom-ops-yaml-path must be "
890 "specified.",
891 )
892 parser.add_argument(
893 "--aten-yaml-path",
894 "--aten_yaml_path",
895 help="path to native_functions.yaml file.",
896 )
897 # Note that make_file_manager() also looks at --install-dir.
898 parser.add_argument(
899 "-d",
900 "--install-dir",
901 "--install_dir",
902 help="output directory",
903 default="build/generated",
904 )
905 parser.add_argument(
906 "-o",
907 "--output-dependencies",
908 help="output a list of dependencies into the given file and exit",
909 )
910 # Although we don't refer to --dry-run directly, make_file_manager() looks
911 # for it.
912 parser.add_argument(
913 "--dry-run",
914 action="store_true",
915 help="run without writing any files (still updates outputs)",
916 )
917 parser.add_argument(
918 "--static-dispatch-backend",
919 "--static_dispatch_backend",
920 nargs="*",
921 help="generate static dispatch code for the specific backend (if set)",
922 )
923 parser.add_argument(
924 "--op-registration-whitelist",
925 "--op_registration_whitelist",

Callers 1

gen.pyFile · 0.70

Calls 4

parse_yaml_filesFunction · 0.85
gen_headersFunction · 0.85
gen_unboxingFunction · 0.85
gen_custom_opsFunction · 0.85

Tested by

no test coverage detected