File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -104,13 +104,13 @@ option(BUILD_SELECTIVE_BUILD_TEST
104
104
105
105
option (EXECUTORCH_BUILD_SIZE_TEST "Whether to build size test" OFF )
106
106
107
+ # Option to register op list
108
+ option (SELECT_OPS_LIST "Register the following list of ops" OFF )
109
+
107
110
if (BUILD_SELECTIVE_BUILD_TEST )
108
111
option (SELECT_ALL_OPS
109
112
"Whether to register all ops defined in portable kernel library." OFF )
110
113
111
- # Option to register op list
112
- option (SELECT_OPS_LIST "Register the following list of ops" OFF )
113
-
114
114
# Option to register ops from yaml file
115
115
option (SELECT_OPS_YAML "Register all the ops from a given yaml file" OFF )
116
116
endif ()
Original file line number Diff line number Diff line change @@ -37,9 +37,19 @@ file(GLOB_RECURSE _portable_kernels__srcs
37
37
"${CMAKE_CURRENT_SOURCE_DIR} /cpu/*.cpp" )
38
38
list (FILTER _portable_kernels__srcs EXCLUDE REGEX "test/*.cpp" )
39
39
list (FILTER _portable_kernels__srcs EXCLUDE REGEX "codegen" )
40
- # Generate C++ bindings to register kernels into both PyTorch (for AOT) and
41
- # Executorch (for runtime). Here select all ops in functions.yaml
42
- gen_selected_ops ("${CMAKE_CURRENT_LIST_DIR} /functions.yaml" "" "" )
40
+
41
+ # If a filterlist is provided only generate wrappers for those
42
+ # Else for all - this is the default behavior.
43
+ if (SELECT_OPS_LIST )
44
+ message ("Selecting only ${SELECT_OPS_LIST} op(s)!" )
45
+ gen_selected_ops ("" "${SELECT_OPS_LIST} " "" )
46
+ else ()
47
+ # Generate C++ bindings to register kernels into both PyTorch (for AOT) and
48
+ # Executorch (for runtime). Here select all ops in functions.yaml
49
+ message ("Selecting all ops" )
50
+ gen_selected_ops ("${CMAKE_CURRENT_LIST_DIR} /functions.yaml" "" "" )
51
+ endif ()
52
+
43
53
# Expect gen_selected_ops output file to be selected_operators.yaml
44
54
generate_bindings_for_kernels (${CMAKE_CURRENT_SOURCE_DIR} /functions.yaml "" )
45
55
message ("Generated files ${gen_command_sources} " )
You can’t perform that action at this time.
0 commit comments