Skip to content

Commit 719bb4f

Browse files
committed
Update
[ghstack-poisoned]
1 parent 5be4b7b commit 719bb4f

File tree

7 files changed

+91
-9
lines changed

7 files changed

+91
-9
lines changed

CMakeLists.txt

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,16 @@ if(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER)
548548
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/data_loader)
549549
endif()
550550

551+
if(EXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL)
552+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/evalue_util)
553+
install(
554+
DIRECTORY extension/evalue_util/
555+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/extension/evalue_util
556+
FILES_MATCHING
557+
PATTERN "*.h"
558+
)
559+
endif()
560+
551561
if(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR)
552562
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/flat_tensor)
553563
endif()
@@ -576,6 +586,12 @@ endif()
576586

577587
if(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL)
578588
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/runner_util)
589+
install(
590+
DIRECTORY extension/runner_util/
591+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/executorch/extension/runner_util
592+
FILES_MATCHING
593+
PATTERN "*.h"
594+
)
579595
endif()
580596

581597
if(EXECUTORCH_BUILD_EXTENSION_TENSOR)
@@ -651,8 +667,7 @@ if(EXECUTORCH_BUILD_PYBIND)
651667

652668
# util lib
653669
add_library(
654-
util ${CMAKE_CURRENT_SOURCE_DIR}/extension/evalue_util/print_evalue.cpp
655-
${CMAKE_CURRENT_SOURCE_DIR}/extension/aten_util/aten_bridge.cpp
670+
util ${CMAKE_CURRENT_SOURCE_DIR}/extension/aten_util/aten_bridge.cpp
656671
)
657672
target_include_directories(
658673
util PUBLIC ${_common_include_directories} ${TORCH_INCLUDE_DIRS}
@@ -695,7 +710,9 @@ endif()
695710

696711
if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
697712
# Baseline libraries that executor_runner will link against.
698-
set(_executor_runner_libs executorch gflags)
713+
set(_executor_runner_libs executorch extension_evalue_util
714+
extension_runner_util gflags
715+
)
699716

700717
if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
701718
list(APPEND _executor_runner_libs optimized_native_cpu_ops_lib)

examples/apple/mps/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
105105
mps_executor_runner
106106
bundled_program
107107
executorch
108+
extension_evalue_util
109+
extension_runner_util
108110
gflags
109111
etdump
110112
flatccrt

examples/apple/mps/test_mps.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ cmake_install_executorch_devtools_lib() {
1919
-DCMAKE_INSTALL_PREFIX=cmake-out \
2020
-DCMAKE_BUILD_TYPE=Release \
2121
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
22+
-DEXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL=ON \
23+
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
2224
-DEXECUTORCH_BUILD_MPS=ON \
2325
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \
2426
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \

examples/qualcomm/executor_runner/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@ target_include_directories(
1919
qnn_executor_runner PUBLIC ${_common_include_directories}
2020
)
2121
target_link_libraries(
22-
qnn_executor_runner qnn_executorch_backend full_portable_ops_lib etdump
23-
flatccrt gflags
22+
qnn_executor_runner
23+
qnn_executorch_backend
24+
extension_evalue_util
25+
extension_runner_util
26+
full_portable_ops_lib
27+
etdump
28+
flatccrt
29+
gflags
2430
)
2531
set_target_properties(
2632
qnn_executor_runner PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
# Please this file formatted by running:
8+
# ~~~
9+
# cmake-format -i CMakeLists.txt
10+
# ~~~
11+
# Source root directory for executorch.
12+
if(NOT EXECUTORCH_ROOT)
13+
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
14+
endif()
15+
list(TRANSFORM _extension_evalue_util__srcs PREPEND "${EXECUTORCH_ROOT}/")
16+
add_library(extension_evalue_util ${_extension_evalue_util__srcs})
17+
target_link_libraries(extension_evalue_util executorch_core)
18+
target_include_directories(
19+
extension_evalue_util PUBLIC ${_common_include_directories}
20+
)
21+
target_compile_options(extension_evalue_util PUBLIC ${_common_compile_options})
22+
23+
# Install libraries
24+
install(
25+
TARGETS extension_evalue_util
26+
DESTINATION ${CMAKE_BINARY_DIR}/lib
27+
INCLUDES
28+
DESTINATION ${_common_include_directories}
29+
)

tools/cmake/cmake_deps.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,17 @@ deps = [
198198
"executorch_core",
199199
]
200200

201+
[targets.extension_evalue_util]
202+
buck_targets = [
203+
"//extension/evalue_util:print_evalue",
204+
]
205+
filters = [
206+
".cpp$",
207+
]
208+
deps = [
209+
"executorch_core",
210+
]
211+
201212
[targets.extension_flat_tensor_schema]
202213
buck_targets = [
203214
"//extension/flat_tensor/serialize:generated_headers",
@@ -340,6 +351,8 @@ excludes = [
340351
deps = [
341352
"executorch",
342353
"executorch_core",
354+
"extension_evalue_util",
355+
"extension_runner_util",
343356
"extension_threadpool",
344357
"kernels_util_all_deps",
345358
"portable_kernels",
@@ -376,6 +389,8 @@ excludes = [
376389
deps = [
377390
"executorch",
378391
"executorch_core",
392+
"extension_evalue_util",
393+
"extension_runner_util",
379394
"extension_threadpool",
380395
"kernels_util_all_deps",
381396
"portable_kernels",
@@ -417,6 +432,8 @@ excludes = [
417432
deps = [
418433
"executorch",
419434
"executorch_core",
435+
"extension_evalue_util",
436+
"extension_runner_util",
420437
"extension_threadpool",
421438
"kernels_util_all_deps",
422439
"xnnpack_backend",

tools/cmake/preset/default.cmake

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ define_overridable_option(
8282
define_overridable_option(
8383
EXECUTORCH_BUILD_EXTENSION_MODULE "Build the Module extension" BOOL OFF
8484
)
85-
define_overridable_option(
86-
EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL "Build the Runner Util extension" BOOL
87-
OFF
88-
)
8985
define_overridable_option(
9086
EXECUTORCH_BUILD_EXTENSION_TENSOR "Build the Tensor extension" BOOL OFF
9187
)
@@ -177,6 +173,14 @@ define_overridable_option(
177173
EXECUTORCH_BUILD_EXECUTOR_RUNNER "Build the executor_runner executable" BOOL
178174
${_default_executorch_build_executor_runner}
179175
)
176+
define_overridable_option(
177+
EXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL "Build the EValue util extension" BOOL
178+
${_default_executorch_build_executor_runner}
179+
)
180+
define_overridable_option(
181+
EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL "Build the Runner Util extension" BOOL
182+
${_default_executorch_build_executor_runner}
183+
)
180184

181185
# NB: Enabling this will serialize execution of delegate instances Keeping this
182186
# OFF by default to maintain existing behavior, to be revisited.
@@ -213,6 +217,11 @@ check_required_options_on(
213217
IF_ON EXECUTORCH_ENABLE_EVENT_TRACER REQUIRES EXECUTORCH_BUILD_DEVTOOLS
214218
)
215219

220+
check_required_options_on(
221+
IF_ON EXECUTORCH_BUILD_EXECUTOR_RUNNER REQUIRES
222+
EXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL
223+
EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL
224+
)
216225
check_required_options_on(
217226
IF_ON EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR REQUIRES
218227
EXECUTORCH_BUILD_EXTENSION_DATA_LOADER

0 commit comments

Comments
 (0)