Skip to content

Commit 90acc60

Browse files
Rename executorch cmake target to prim_ops_lib
1 parent 12668f8 commit 90acc60

13 files changed

Lines changed: 28 additions & 29 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -707,15 +707,15 @@ endif()
707707
# Does not contain portable kernels or other full operators. Does not contain
708708
# any backends.
709709
#
710-
add_library(executorch ${_executorch__srcs})
711-
target_link_libraries(executorch PRIVATE executorch_core)
712-
target_include_directories(executorch PUBLIC ${_common_include_directories})
713-
target_compile_definitions(executorch PUBLIC C10_USING_CUSTOM_GENERATED_MACROS)
710+
add_library(prim_ops_lib ${_executorch__srcs})
711+
target_link_libraries(prim_ops_lib PRIVATE executorch_core)
712+
target_include_directories(prim_ops_lib PUBLIC ${_common_include_directories})
713+
target_compile_definitions(prim_ops_lib PUBLIC C10_USING_CUSTOM_GENERATED_MACROS)
714714
if(NOT EXECUTORCH_ENABLE_LOGGING)
715-
target_compile_definitions(executorch PUBLIC ET_LOG_ENABLED=0)
715+
target_compile_definitions(prim_ops_lib PUBLIC ET_LOG_ENABLED=0)
716716
endif()
717-
target_compile_options(executorch PUBLIC ${_common_compile_options})
718-
executorch_target_link_options_shared_lib(executorch)
717+
target_compile_options(prim_ops_lib PUBLIC ${_common_compile_options})
718+
executorch_target_link_options_shared_lib(prim_ops_lib)
719719

720720
#
721721
# portable_ops_lib: A library to register core ATen ops using portable kernels,
@@ -805,7 +805,7 @@ install(
805805
PATTERN "*.h"
806806
)
807807
install(
808-
TARGETS executorch executorch_core
808+
TARGETS prim_ops_lib executorch_core
809809
EXPORT ExecuTorchTargets
810810
INCLUDES
811811
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
@@ -1070,7 +1070,7 @@ if(EXECUTORCH_BUILD_SHARED)
10701070
# the WHOLE_ARCHIVE link feature, because these archives also reference each
10711071
# other plainly and CMake before 3.29 refuses to mix a feature with a plain
10721072
# reference to the same item.
1073-
target_link_libraries(executorch_shared PRIVATE executorch)
1073+
target_link_libraries(executorch_shared PRIVATE prim_ops_lib)
10741074
set(_executorch_shared_whole_archive executorch_core)
10751075
foreach(_ext_target
10761076
extension_data_loader extension_flat_tensor extension_named_data_map
@@ -1129,7 +1129,7 @@ endif()
11291129
# when it is named.
11301130
if(EXECUTORCH_ENABLE_EVENT_TRACER)
11311131
target_compile_definitions(executorch_core INTERFACE ET_EVENT_TRACER_ENABLED)
1132-
target_compile_definitions(executorch INTERFACE ET_EVENT_TRACER_ENABLED)
1132+
target_compile_definitions(prim_ops_lib INTERFACE ET_EVENT_TRACER_ENABLED)
11331133
if(TARGET executorch_shared)
11341134
target_compile_definitions(
11351135
executorch_shared INTERFACE ET_EVENT_TRACER_ENABLED
@@ -1452,7 +1452,7 @@ if(EXECUTORCH_BUILD_PYBIND)
14521452
if(EXECUTORCH_BUILD_SHARED)
14531453
target_link_libraries(util PRIVATE torch c10 executorch_shared)
14541454
else()
1455-
target_link_libraries(util PRIVATE torch c10 executorch extension_tensor)
1455+
target_link_libraries(util PRIVATE torch c10 prim_ops_lib extension_tensor)
14561456
endif()
14571457

14581458
# pybind portable_lib
@@ -1562,7 +1562,7 @@ if(EXECUTORCH_BUILD_PYBIND)
15621562
data_loader "extension/pybindings" "executorch/extension/pybindings"
15631563
)
15641564
else()
1565-
target_link_libraries(data_loader PRIVATE executorch)
1565+
target_link_libraries(data_loader PRIVATE prim_ops_lib)
15661566
endif()
15671567
install(TARGETS data_loader
15681568
LIBRARY DESTINATION executorch/extension/pybindings
@@ -1753,7 +1753,7 @@ install(TARGETS executorch_backends executorch_extensions executorch_kernels
17531753

17541754
if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
17551755
# Baseline libraries that executor_runner will link against.
1756-
set(_executor_runner_libs executorch extension_evalue_util
1756+
set(_executor_runner_libs prim_ops_lib extension_evalue_util
17571757
extension_runner_util gflags executorch_backends
17581758
)
17591759

‎backends/cadence/fusion_g3/operators/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ set(_aten_ops__srcs
6565
"${EXECUTORCH_ROOT}/kernels/portable/cpu/pattern/unary_ufunc_realhbbf16_to_floathbf16.cpp"
6666
)
6767
add_library(aten_ops_cadence ${_aten_ops__srcs})
68-
target_link_libraries(aten_ops_cadence PUBLIC executorch)
68+
target_link_libraries(aten_ops_cadence PUBLIC prim_ops_lib)
6969
target_link_libraries(aten_ops_cadence PRIVATE xa_nnlib)
7070

7171
# Let files say "include <executorch/path/to/header.h>".

‎backends/cadence/generic/operators/CMakeLists.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ set(_aten_ops__srcs
6868
"${EXECUTORCH_ROOT}/kernels/portable/cpu/util/select_copy_util.cpp"
6969
)
7070
add_library(aten_ops_cadence ${_aten_ops__srcs})
71-
target_link_libraries(aten_ops_cadence PUBLIC executorch)
71+
target_link_libraries(aten_ops_cadence PUBLIC prim_ops_lib)
7272
target_link_libraries(aten_ops_cadence PRIVATE cadence_kernels)
7373

7474
# Let files say "include <executorch/path/to/header.h>".
@@ -90,7 +90,7 @@ target_include_directories(
9090
${_common_include_directories}
9191
)
9292

93-
target_link_libraries(custom_ops PUBLIC executorch)
93+
target_link_libraries(custom_ops PUBLIC prim_ops_lib)
9494
target_link_libraries(custom_ops PRIVATE cadence_kernels)
9595

9696
# Generate C++ bindings to register kernels into both PyTorch (for AOT) and

‎backends/cadence/hifi/operators/CMakeLists.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ set(_aten_ops__srcs
8080
"${EXECUTORCH_ROOT}/kernels/portable/cpu/util/delinearize_index.cpp"
8181
)
8282
add_library(aten_ops_cadence ${_aten_ops__srcs})
83-
target_link_libraries(aten_ops_cadence PUBLIC executorch)
83+
target_link_libraries(aten_ops_cadence PUBLIC prim_ops_lib)
8484
target_link_libraries(aten_ops_cadence PRIVATE cadence_kernels)
8585

8686
# Let files say "include <executorch/path/to/header.h>".
@@ -159,7 +159,7 @@ target_include_directories(
159159
${_common_include_directories}
160160
)
161161

162-
target_link_libraries(custom_ops PUBLIC executorch)
162+
target_link_libraries(custom_ops PUBLIC prim_ops_lib)
163163
target_link_libraries(custom_ops PRIVATE cadence_kernels)
164164

165165
# Generate C++ bindings to register kernels into both PyTorch (for AOT) and

‎backends/cadence/vision/operators/CMakeLists.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ set(_aten_ops__srcs
6868
"${EXECUTORCH_ROOT}/kernels/portable/cpu/util/select_copy_util.cpp"
6969
)
7070
add_library(aten_ops_cadence ${_aten_ops__srcs})
71-
target_link_libraries(aten_ops_cadence PUBLIC executorch)
71+
target_link_libraries(aten_ops_cadence PUBLIC prim_ops_lib)
7272
target_link_libraries(aten_ops_cadence PRIVATE cadence_kernels)
7373

7474
# Let files say "include <executorch/path/to/header.h>".
@@ -101,7 +101,7 @@ target_include_directories(
101101
${_common_include_directories}
102102
)
103103

104-
target_link_libraries(custom_ops PUBLIC executorch)
104+
target_link_libraries(custom_ops PUBLIC prim_ops_lib)
105105
target_link_libraries(custom_ops PRIVATE cadence_kernels)
106106

107107
# Generate C++ bindings to register kernels into both PyTorch (for AOT) and

‎backends/qualcomm/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|AMD64")
415415
"${CMAKE_INSTALL_LIBDIR}/executorch/backends/qualcomm/python"
416416
)
417417
else()
418-
target_link_libraries(PyQnnManagerAdaptor PRIVATE executorch)
418+
target_link_libraries(PyQnnManagerAdaptor PRIVATE prim_ops_lib)
419419
endif()
420420

421421
pybind11_extension(PyQnnManagerAdaptor)

‎devtools/bundled_program/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ add_library(
4646
if(EXECUTORCH_BUILD_SHARED)
4747
target_link_libraries(bundled_program PUBLIC executorch_shared)
4848
else()
49-
target_link_libraries(bundled_program PUBLIC executorch)
49+
target_link_libraries(bundled_program PUBLIC prim_ops_lib)
5050
endif()
5151
target_include_directories(
5252
bundled_program

‎devtools/etdump/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ if(EXECUTORCH_BUILD_SHARED)
7676
executorch_target_shipped_runtime_path(etdump)
7777
else()
7878
target_link_libraries(etdump PUBLIC flatccrt)
79-
target_link_libraries(etdump PRIVATE executorch)
79+
target_link_libraries(etdump PRIVATE prim_ops_lib)
8080
endif()
8181

8282
target_include_directories(

‎docs/source/kernel-library-custom-aten-kernel.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ gen_selected_ops("" "${SELECT_OPS_LIST}" "")
170170
generate_bindings_for_kernels(FUNCTIONS_YAML ${EXECUTORCH_ROOT}/kernels/portable/functions.yaml)
171171
172172
# Prepare a C++ library called "generated_lib" with _kernel_lib being the portable library, executorch is a dependency of it.
173-
gen_operators_lib("generated_lib" KERNEL_LIBS ${_kernel_lib} DEPS executorch)
173+
gen_operators_lib("generated_lib" KERNEL_LIBS ${_kernel_lib} DEPS prim_ops_lib)
174174
175175
# Link "generated_lib" into the application:
176176
target_link_libraries(executorch_binary generated_lib)
@@ -276,7 +276,7 @@ add_library(custom_op_lib SHARED ${CMAKE_CURRENT_SOURCE_DIR}/custom_op.cpp)
276276
target_include_directory(custom_op_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
277277
278278
# Link ExecuTorch library
279-
target_link_libraries(custom_op_lib PUBLIC executorch)
279+
target_link_libraries(custom_op_lib PUBLIC prim_ops_lib)
280280
281281
# Define a binary target
282282
add_executable(custom_op_runner PUBLIC main.cpp)

‎examples/models/llama/CMakeLists.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ find_package(gflags REQUIRED)
8484
# cross-compiling (e.g., to Android) to work as well.
8585
list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_BINARY_DIR}/../../..)
8686
find_package(executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH)
87-
executorch_target_link_options_shared_lib(executorch)
8887

8988
# llama_runner library
9089
add_subdirectory(runner)

0 commit comments

Comments
 (0)