Skip to content

Commit 366c47a

Browse files
committed
Undoing git merge mistake
1 parent 326d046 commit 366c47a

File tree

1 file changed

+0
-85
lines changed

1 file changed

+0
-85
lines changed

tools/cmake/Codegen.cmake

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,14 @@
1212
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
1313

1414
function(gen_selected_ops)
15-
<<<<<<< Updated upstream
1615
set(arg_names LIB_NAME OPS_SCHEMA_YAML ROOT_OPS INCLUDE_ALL_OPS)
17-
=======
18-
set(arg_names LIB_NAME OPS_SCHEMA_YAML ROOT_OPS INCLUDE_ALL_OPS DTYPE_SELECTIVE_BUILD)
19-
>>>>>>> Stashed changes
2016
cmake_parse_arguments(GEN "" "" "${arg_names}" ${ARGN})
2117

2218
message(STATUS "Generating operator lib:")
2319
message(STATUS " LIB_NAME: ${GEN_LIB_NAME}")
2420
message(STATUS " OPS_SCHEMA_YAML: ${GEN_OPS_SCHEMA_YAML}")
2521
message(STATUS " ROOT_OPS: ${GEN_ROOT_OPS}")
2622
message(STATUS " INCLUDE_ALL_OPS: ${GEN_INCLUDE_ALL_OPS}")
27-
<<<<<<< Updated upstream
28-
=======
29-
message(STATUS " DTYPE_SELECTIVE_BUILD: ${GEN_DTYPE_SELECTIVE_BUILD}")
30-
>>>>>>> Stashed changes
3123

3224
set(_oplist_yaml
3325
${CMAKE_CURRENT_BINARY_DIR}/${GEN_LIB_NAME}/selected_operators.yaml
@@ -61,26 +53,6 @@ function(gen_selected_ops)
6153
WORKING_DIRECTORY ${EXECUTORCH_ROOT}
6254
)
6355

64-
<<<<<<< Updated upstream
65-
=======
66-
if(GEN_DTYPE_SELECTIVE_BUILD)
67-
set(_opvariant_h
68-
${CMAKE_CURRENT_BINARY_DIR}/${GEN_LIB_NAME}/selected_op_variants.h
69-
)
70-
set(_gen_opvariant_command "${PYTHON_EXECUTABLE}" -m codegen.tools.gen_selected_op_variants
71-
--yaml-file=${_oplist_yaml}
72-
--output-dir=${CMAKE_CURRENT_BINARY_DIR}/${GEN_LIB_NAME}/
73-
)
74-
message("Command - ${_gen_opvariant_command}")
75-
add_custom_command(
76-
COMMENT "Generating selected_op_variants.h for ${GEN_LIB_NAME}"
77-
OUTPUT ${_opvariant_h}
78-
COMMAND ${_gen_opvariant_command}
79-
DEPENDS ${_optlist_yaml} ${_codegen_tools_srcs}
80-
WORKING_DIRECTORY ${EXECUTORCH_ROOT}
81-
)
82-
endif()
83-
>>>>>>> Stashed changes
8456
endfunction()
8557

8658
# Codegen for registering kernels. Kernels are defined in functions_yaml and
@@ -90,22 +62,14 @@ endfunction()
9062
# functions_yaml CUSTOM_OPS_YAML custom_ops_yaml )
9163
function(generate_bindings_for_kernels)
9264
set(options ADD_EXCEPTION_BOUNDARY)
93-
<<<<<<< Updated upstream
9465
set(arg_names LIB_NAME FUNCTIONS_YAML CUSTOM_OPS_YAML)
95-
=======
96-
set(arg_names LIB_NAME FUNCTIONS_YAML CUSTOM_OPS_YAML DTYPE_SELECTIVE_BUILD)
97-
>>>>>>> Stashed changes
9866
cmake_parse_arguments(GEN "${options}" "${arg_names}" "" ${ARGN})
9967

10068
message(STATUS "Generating kernel bindings:")
10169
message(STATUS " LIB_NAME: ${GEN_LIB_NAME}")
10270
message(STATUS " FUNCTIONS_YAML: ${GEN_FUNCTIONS_YAML}")
10371
message(STATUS " CUSTOM_OPS_YAML: ${GEN_CUSTOM_OPS_YAML}")
10472
message(STATUS " ADD_EXCEPTION_BOUNDARY: ${GEN_ADD_EXCEPTION_BOUNDARY}")
105-
<<<<<<< Updated upstream
106-
=======
107-
message(STATUS " DTYPE_SELECTIVE_BUILD: ${GEN_DTYPE_SELECTIVE_BUILD}")
108-
>>>>>>> Stashed changes
10973

11074
# Command to generate selected_operators.yaml from custom_ops.yaml.
11175
file(GLOB_RECURSE _codegen_templates "${EXECUTORCH_ROOT}/codegen/templates/*")
@@ -114,16 +78,6 @@ function(generate_bindings_for_kernels)
11478
# By default selective build output is selected_operators.yaml
11579
set(_oplist_yaml ${_out_dir}/selected_operators.yaml)
11680

117-
<<<<<<< Updated upstream
118-
=======
119-
# If dtype selective build is enable, force header file to be preserved
120-
if(GEN_DTYPE_SELECTIVE_BUILD)
121-
set(_opvariant_h ${_out_dir}/selected_op_variants.h)
122-
else()
123-
set(_opvariant_h "")
124-
endif()
125-
126-
>>>>>>> Stashed changes
12781
# Command to codegen C++ wrappers to register custom ops to both PyTorch and
12882
# Executorch runtime.
12983
execute_process(
@@ -154,13 +108,6 @@ function(generate_bindings_for_kernels)
154108
${_out_dir}/Functions.h ${_out_dir}/NativeFunctions.h
155109
)
156110

157-
<<<<<<< Updated upstream
158-
=======
159-
if(GEN_DTYPE_SELECTIVE_BUILD)
160-
list(APPEND _gen_command_sources ${_out_dir}/selected_op_variants.h)
161-
endif()
162-
163-
>>>>>>> Stashed changes
164111
if(GEN_FUNCTIONS_YAML)
165112
list(APPEND _gen_command --functions-yaml-path=${GEN_FUNCTIONS_YAML})
166113
endif()
@@ -218,61 +165,29 @@ endfunction()
218165

219166
# Generate a runtime lib for registering operators in Executorch
220167
function(gen_operators_lib)
221-
<<<<<<< Updated upstream
222168
set(multi_arg_names LIB_NAME KERNEL_LIBS DEPS)
223-
=======
224-
set(multi_arg_names LIB_NAME KERNEL_LIBS DEPS DTYPE_SELECTIVE_BUILD)
225-
>>>>>>> Stashed changes
226169
cmake_parse_arguments(GEN "" "" "${multi_arg_names}" ${ARGN})
227170

228171
message(STATUS "Generating operator lib:")
229172
message(STATUS " LIB_NAME: ${GEN_LIB_NAME}")
230173
message(STATUS " KERNEL_LIBS: ${GEN_KERNEL_LIBS}")
231174
message(STATUS " DEPS: ${GEN_DEPS}")
232-
<<<<<<< Updated upstream
233-
=======
234-
message(STATUS " DTYPE_SELECTIVE_BUILD: ${GEN_DTYPE_SELECTIVE_BUILD}")
235-
>>>>>>> Stashed changes
236175

237176
set(_out_dir ${CMAKE_CURRENT_BINARY_DIR}/${GEN_LIB_NAME})
238177

239178
add_library(${GEN_LIB_NAME})
240-
<<<<<<< Updated upstream
241179
target_sources(
242180
${GEN_LIB_NAME}
243181
PRIVATE ${_out_dir}/RegisterCodegenUnboxedKernelsEverything.cpp
244182
${_out_dir}/Functions.h ${_out_dir}/NativeFunctions.h
245183
)
246-
=======
247-
if(GEN_DTYPE_SELECTIVE_BUILD)
248-
target_sources(
249-
${GEN_LIB_NAME}
250-
PRIVATE ${_out_dir}/RegisterCodegenUnboxedKernelsEverything.cpp
251-
${_out_dir}/Functions.h ${_out_dir}/NativeFunctions.h
252-
${_out_dir}/selected_op_variants.h
253-
)
254-
else()
255-
target_sources(
256-
${GEN_LIB_NAME}
257-
PRIVATE ${_out_dir}/RegisterCodegenUnboxedKernelsEverything.cpp
258-
${_out_dir}/Functions.h ${_out_dir}/NativeFunctions.h
259-
)
260-
endif()
261-
262-
>>>>>>> Stashed changes
263184
target_link_libraries(${GEN_LIB_NAME} PRIVATE ${GEN_DEPS})
264185
if(GEN_KERNEL_LIBS)
265186
target_link_libraries(${GEN_LIB_NAME} PUBLIC ${GEN_KERNEL_LIBS})
266187
endif()
267188

268189
target_link_options_shared_lib(${GEN_LIB_NAME})
269190
set(_generated_headers ${_out_dir}/Functions.h ${_out_dir}/NativeFunctions.h)
270-
<<<<<<< Updated upstream
271-
=======
272-
if(GEN_DTYPE_SELECTIVE_BUILD)
273-
list(APPEND _generated_headers ${_out_dir}/selected_op_variants.h)
274-
endif()
275-
>>>>>>> Stashed changes
276191
set_target_properties(
277192
${GEN_LIB_NAME} PROPERTIES PUBLIC_HEADER "${_generated_headers}"
278193
)

0 commit comments

Comments
 (0)