Skip to content

Commit 5541a50

Browse files
committed
Rename executorch_no_prim_ops to executorch_core (pytorch#5740)
Summary: Minor CMake target cleanup for beta. Pull Request resolved: pytorch#5740 Reviewed By: shoumikhin Differential Revision: D63576097 Pulled By: GregoryComer fbshipit-source-id: b10f9f15cfcae3bce769d07cd014e8064d735dbd
1 parent c678cbd commit 5541a50

File tree

22 files changed

+78
-73
lines changed

22 files changed

+78
-73
lines changed

CMakeLists.txt

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -456,22 +456,22 @@ endif()
456456
add_subdirectory(schema)
457457

458458
#
459-
# executorch_no_prim_ops: Minimal runtime library
459+
# executorch_core: Minimal runtime library
460460
#
461461
# The bare-minimum runtime library, supporting the Program and Method
462462
# interfaces. Does not contain any operators, including primitive ops. Does not
463463
# contain any backends.
464464
#
465465

466466
# Remove any PAL-definition files from the sources.
467-
list(FILTER _executorch_no_prim_ops__srcs EXCLUDE REGEX
467+
list(FILTER _executorch_core__srcs EXCLUDE REGEX
468468
"runtime/platform/default/[^/]*.cpp$"
469469
)
470470

471471
# Add the source file that maps to the requested default PAL implementation.
472472
if(EXECUTORCH_PAL_DEFAULT MATCHES "^(posix|minimal)$")
473473
message(STATUS "executorch: Using PAL default '${EXECUTORCH_PAL_DEFAULT}'")
474-
list(APPEND _executorch_no_prim_ops__srcs
474+
list(APPEND _executorch_core__srcs
475475
"runtime/platform/default/${EXECUTORCH_PAL_DEFAULT}.cpp"
476476
)
477477
else()
@@ -481,45 +481,49 @@ else()
481481
)
482482
endif()
483483

484-
add_library(executorch_no_prim_ops ${_executorch_no_prim_ops__srcs})
485-
target_link_libraries(executorch_no_prim_ops PRIVATE program_schema)
484+
add_library(executorch_core ${_executorch_core__srcs})
485+
486+
# Legacy name alias.
487+
add_library(executorch_no_prim_ops ALIAS executorch_core)
488+
489+
target_link_libraries(executorch_core PRIVATE program_schema)
486490
if(EXECUTORCH_USE_DL)
487491
# Check if dl exists for this toolchain and only then link it.
488492
find_library(DL_LIBRARY_EXISTS NAMES dl)
489493
# Check if the library was found
490494
if(DL_LIBRARY_EXISTS)
491-
target_link_libraries(executorch_no_prim_ops PRIVATE dl) # For dladdr()
495+
target_link_libraries(executorch_core PRIVATE dl) # For dladdr()
492496
endif()
493497
endif()
494498
target_include_directories(
495-
executorch_no_prim_ops PUBLIC ${_common_include_directories}
499+
executorch_core PUBLIC ${_common_include_directories}
496500
)
497-
target_compile_options(executorch_no_prim_ops PUBLIC ${_common_compile_options})
501+
target_compile_options(executorch_core PUBLIC ${_common_compile_options})
498502
if(MAX_KERNEL_NUM)
499503
target_compile_definitions(
500-
executorch_no_prim_ops PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM}
504+
executorch_core PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM}
501505
)
502506
endif()
503507

504508
if(EXECUTORCH_BUILD_PYBIND AND APPLE)
505509
# shared version
506510
add_library(
507-
executorch_no_prim_ops_shared SHARED ${_executorch_no_prim_ops__srcs}
511+
executorch_core_shared SHARED ${_executorch_core__srcs}
508512
)
509-
target_link_libraries(executorch_no_prim_ops_shared PRIVATE program_schema)
513+
target_link_libraries(executorch_core_shared PRIVATE program_schema)
510514
if(DL_LIBRARY_EXISTS)
511515
# For dladdr()
512-
target_link_libraries(executorch_no_prim_ops_shared PRIVATE dl)
516+
target_link_libraries(executorch_core_shared PRIVATE dl)
513517
endif()
514518
target_include_directories(
515-
executorch_no_prim_ops_shared PUBLIC ${_common_include_directories}
519+
executorch_core_shared PUBLIC ${_common_include_directories}
516520
)
517521
target_compile_options(
518-
executorch_no_prim_ops_shared PUBLIC ${_common_compile_options}
522+
executorch_core_shared PUBLIC ${_common_compile_options}
519523
)
520524
if(MAX_KERNEL_NUM)
521525
target_compile_definitions(
522-
executorch_no_prim_ops_shared PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM}
526+
executorch_core_shared PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM}
523527
)
524528
endif()
525529
endif()
@@ -532,7 +536,7 @@ endif()
532536
# any backends.
533537
#
534538
add_library(executorch ${_executorch__srcs})
535-
target_link_libraries(executorch PRIVATE executorch_no_prim_ops)
539+
target_link_libraries(executorch PRIVATE executorch_core)
536540
target_include_directories(executorch PUBLIC ${_common_include_directories})
537541
target_compile_options(executorch PUBLIC ${_common_compile_options})
538542
target_link_options_shared_lib(executorch)
@@ -568,7 +572,7 @@ endif()
568572
# Install `executorch` library as well as `executorch-config.cmake` under
569573
# ${CMAKE_INSTALL_PREFIX}/
570574
install(
571-
TARGETS executorch executorch_no_prim_ops
575+
TARGETS executorch executorch_core
572576
DESTINATION lib
573577
INCLUDES
574578
DESTINATION ${_common_include_directories}

backends/apple/coreml/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ target_include_directories(
134134
coremldelegate PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util
135135
)
136136
target_include_directories(coremldelegate PRIVATE ${EXECUTORCH_ROOT}/..)
137-
target_link_libraries(coremldelegate PRIVATE executorch_no_prim_ops)
137+
target_link_libraries(coremldelegate PRIVATE executorch_core)
138138

139139
if(EXECUTORCH_BUILD_DEVTOOLS)
140140
target_sources(coremldelegate PRIVATE ${SDK_SOURCES} ${PROTOBUF_SOURCES})
@@ -159,7 +159,7 @@ find_library(SQLITE_LIBRARY sqlite3)
159159

160160
target_link_libraries(
161161
coremldelegate
162-
PRIVATE executorch_no_prim_ops ${ACCELERATE_FRAMEWORK} ${COREML_FRAMEWORK}
162+
PRIVATE executorch_core ${ACCELERATE_FRAMEWORK} ${COREML_FRAMEWORK}
163163
${FOUNDATION_FRAMEWORK} ${SQLITE_LIBRARY}
164164
)
165165

@@ -176,7 +176,7 @@ target_compile_options(coremldelegate PRIVATE "-fno-exceptions")
176176

177177
if(EXECUTORCH_BUILD_DEVTOOLS)
178178
target_compile_options(
179-
executorch_no_prim_ops PUBLIC -DET_EVENT_TRACER_ENABLED
179+
executorch_core PUBLIC -DET_EVENT_TRACER_ENABLED
180180
)
181181
target_compile_options(coremldelegate PRIVATE "-frtti")
182182
target_compile_options(libprotobuf-lite PRIVATE "-frtti")

backends/apple/coreml/runtime/workspace/executorchcoreml.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
C9E7D7962AB3F9BF00CCAE5D /* KeyValueStoreTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9E7D78E2AB3F9BF00CCAE5D /* KeyValueStoreTests.mm */; };
106106
C9E7D7A22AB3FBB200CCAE5D /* CoreMLBackendDelegateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9E7D7A12AB3FBB200CCAE5D /* CoreMLBackendDelegateTests.mm */; };
107107
C9EC7E1B2BC73B3200A6B166 /* MultiArrayTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9EC7E1A2BC73B3200A6B166 /* MultiArrayTests.mm */; };
108-
F24817E52BC655E100E80D98 /* libexecutorch_no_prim_ops.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F24817E42BC655E100E80D98 /* libexecutorch_no_prim_ops.a */; };
108+
F24817E52BC655E100E80D98 /* libexecutorch_core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F24817E42BC655E100E80D98 /* libexecutorch_core.a */; };
109109
/* End PBXBuildFile section */
110110

111111
/* Begin PBXCopyFilesBuildPhase section */
@@ -310,7 +310,7 @@
310310
C9EA3FE52B73EF6300B7D7BD /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
311311
C9EC7E092BC662A300A6B166 /* objc_array_util.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = objc_array_util.h; path = ../util/objc_array_util.h; sourceTree = "<group>"; };
312312
C9EC7E1A2BC73B3200A6B166 /* MultiArrayTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = MultiArrayTests.mm; path = ../test/MultiArrayTests.mm; sourceTree = "<group>"; };
313-
F24817E42BC655E100E80D98 /* libexecutorch_no_prim_ops.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexecutorch_no_prim_ops.a; path = ../libraries/libexecutorch_no_prim_ops.a; sourceTree = "<group>"; };
313+
F24817E42BC655E100E80D98 /* libexecutorch_core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexecutorch_core.a; path = ../libraries/libexecutorch_core.a; sourceTree = "<group>"; };
314314
/* End PBXFileReference section */
315315

316316
/* Begin PBXFrameworksBuildPhase section */
@@ -319,7 +319,7 @@
319319
buildActionMask = 2147483647;
320320
files = (
321321
C94D510F2ABDF87500AF47FD /* Accelerate.framework in Frameworks */,
322-
F24817E52BC655E100E80D98 /* libexecutorch_no_prim_ops.a in Frameworks */,
322+
F24817E52BC655E100E80D98 /* libexecutorch_core.a in Frameworks */,
323323
C94D510E2ABDF86800AF47FD /* libsqlite3.tbd in Frameworks */,
324324
C94D50D92ABD7B2400AF47FD /* CoreML.framework in Frameworks */,
325325
C99883862B95AD7D000953A3 /* libprotobuf-lite.a in Frameworks */,
@@ -540,7 +540,7 @@
540540
C96560942AABFDCE005F8126 /* libsqlite3.tbd */,
541541
C96560922AABF992005F8126 /* CoreML.framework */,
542542
C96560902AABF982005F8126 /* Accelerate.framework */,
543-
F24817E42BC655E100E80D98 /* libexecutorch_no_prim_ops.a */,
543+
F24817E42BC655E100E80D98 /* libexecutorch_core.a */,
544544
C965608D2AABF72A005F8126 /* libexecutorch.a */,
545545
);
546546
name = "Recovered References";

backends/apple/coreml/scripts/build_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ cmake --build "$CMAKE_PROTOBUF_BUILD_DIR_PATH" -j9 -t libprotobuf-lite
5959
echo "ExecuTorch: Copying libraries"
6060
mkdir "$LIBRARIES_DIR_PATH"
6161
cp -f "$CMAKE_EXECUTORCH_BUILD_DIR_PATH/libexecutorch.a" "$LIBRARIES_DIR_PATH"
62-
cp -f "$CMAKE_EXECUTORCH_BUILD_DIR_PATH/libexecutorch_no_prim_ops.a" "$LIBRARIES_DIR_PATH"
62+
cp -f "$CMAKE_EXECUTORCH_BUILD_DIR_PATH/libexecutorch_core.a" "$LIBRARIES_DIR_PATH"
6363
cp -f "$CMAKE_PROTOBUF_BUILD_DIR_PATH/libprotobuf-lite.a" "$LIBRARIES_DIR_PATH"
6464

6565
#Copy ExecuTorch headers

backends/apple/mps/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ target_link_libraries(
7575
mpsdelegate
7676
PRIVATE bundled_program
7777
mps_schema
78-
executorch_no_prim_ops
78+
executorch_core
7979
${FOUNDATION_FRAMEWORK}
8080
${METAL_FRAMEWORK}
8181
${MPS_FRAMEWORK}

backends/mediatek/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/include)
2727
add_library(neuron_backend SHARED)
2828
target_link_libraries(neuron_backend
2929
PRIVATE
30-
executorch_no_prim_ops
30+
executorch_core
3131
portable_ops_lib
3232
android
3333
log

backends/qualcomm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ target_link_libraries(
181181
)
182182
target_link_libraries(
183183
qnn_executorch_backend PRIVATE qnn_executorch_header qnn_schema qnn_manager
184-
executorch_no_prim_ops qcir_utils extension_tensor
184+
executorch_core qcir_utils extension_tensor
185185
)
186186
set_target_properties(
187187
qnn_executorch_backend PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'"

backends/xnnpack/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ include(cmake/Dependencies.cmake)
9393
list(TRANSFORM _xnnpack_backend__srcs PREPEND "${EXECUTORCH_ROOT}/")
9494
add_library(xnnpack_backend STATIC ${_xnnpack_backend__srcs})
9595
target_link_libraries(
96-
xnnpack_backend PRIVATE ${xnnpack_third_party} executorch_no_prim_ops
96+
xnnpack_backend PRIVATE ${xnnpack_third_party} executorch_core
9797
xnnpack_schema
9898
)
9999

build/Codegen.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function(gen_custom_ops_aot_lib)
154154
if(TARGET portable_lib)
155155
target_link_libraries(${GEN_LIB_NAME} PRIVATE portable_lib)
156156
else()
157-
target_link_libraries(${GEN_LIB_NAME} PRIVATE executorch_no_prim_ops)
157+
target_link_libraries(${GEN_LIB_NAME} PRIVATE executorch_core)
158158
endif()
159159
endfunction()
160160

build/build_apple_frameworks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ PLATFORM_TARGET=("17.0" "17.0" "10.15")
2929

3030
FRAMEWORK_EXECUTORCH="executorch:\
3131
libexecutorch.a,\
32-
libexecutorch_no_prim_ops.a,\
32+
libexecutorch_core.a,\
3333
libextension_apple.a,\
3434
libextension_data_loader.a,\
3535
libextension_module.a,\

0 commit comments

Comments
 (0)