|
11 | 11 | # arguments.
|
12 | 12 | function(gen_selected_ops)
|
13 | 13 | set(arg_names LIB_NAME OPS_SCHEMA_YAML ROOT_OPS INCLUDE_ALL_OPS)
|
14 |
| - cmake_parse_arguments(GEN "" "" "${arg_names}" ${ARGN}) |
| 14 | + cmake_parse_arguments(GEN "${options}" "" "${arg_names}" ${ARGN}) |
15 | 15 |
|
16 | 16 | message(STATUS "Generating operator lib:")
|
17 | 17 | message(STATUS " LIB_NAME: ${GEN_LIB_NAME}")
|
18 | 18 | message(STATUS " OPS_SCHEMA_YAML: ${GEN_OPS_SCHEMA_YAML}")
|
19 | 19 | message(STATUS " ROOT_OPS: ${GEN_ROOT_OPS}")
|
20 | 20 | message(STATUS " INCLUDE_ALL_OPS: ${GEN_INCLUDE_ALL_OPS}")
|
| 21 | + message(STATUS " ADD_EXCEPTION_BOUNDARY: ${GEN_ADD_EXCEPTION_BOUNDARTY}") |
21 | 22 |
|
22 | 23 | set(_oplist_yaml
|
23 | 24 | ${CMAKE_CURRENT_BINARY_DIR}/${GEN_LIB_NAME}/selected_operators.yaml
|
@@ -59,13 +60,15 @@ endfunction()
|
59 | 60 | # Invoked as generate_bindings_for_kernels( LIB_NAME lib_name FUNCTIONS_YAML
|
60 | 61 | # functions_yaml CUSTOM_OPS_YAML custom_ops_yaml )
|
61 | 62 | function(generate_bindings_for_kernels)
|
| 63 | + set(options ADD_EXCEPTION_BOUNDARY) |
62 | 64 | set(arg_names LIB_NAME FUNCTIONS_YAML CUSTOM_OPS_YAML)
|
63 |
| - cmake_parse_arguments(GEN "" "${arg_names}" "" ${ARGN}) |
| 65 | + cmake_parse_arguments(GEN "${options}" "${arg_names}" "" ${ARGN}) |
64 | 66 |
|
65 | 67 | message(STATUS "Generating kernel bindings:")
|
66 | 68 | message(STATUS " LIB_NAME: ${GEN_LIB_NAME}")
|
67 | 69 | message(STATUS " FUNCTIONS_YAML: ${GEN_FUNCTIONS_YAML}")
|
68 | 70 | message(STATUS " CUSTOM_OPS_YAML: ${GEN_CUSTOM_OPS_YAML}")
|
| 71 | + message(STATUS " ADD_EXCEPTION_BOUNDARY: ${GEN_ADD_EXCEPTION_BOUNDARY}") |
69 | 72 |
|
70 | 73 | # Command to generate selected_operators.yaml from custom_ops.yaml.
|
71 | 74 | file(GLOB_RECURSE _codegen_templates "${EXECUTORCH_ROOT}/codegen/templates/*")
|
@@ -93,7 +96,10 @@ function(generate_bindings_for_kernels)
|
93 | 96 | --tags-path=${site-packages-out}/torchgen/packaged/ATen/native/tags.yaml
|
94 | 97 | --aten-yaml-path=${site-packages-out}/torchgen/packaged/ATen/native/native_functions.yaml
|
95 | 98 | --op-selection-yaml-path=${_oplist_yaml}
|
96 |
| - ) |
| 99 | + ) |
| 100 | + if(GEN_ADD_EXCEPTION_BOUNDARY) |
| 101 | + set(_gen_command "${_gen_command} --add-exception-boundary") |
| 102 | + endif() |
97 | 103 |
|
98 | 104 | set(_gen_command_sources
|
99 | 105 | ${_out_dir}/RegisterCodegenUnboxedKernelsEverything.cpp
|
|
0 commit comments