Skip to content

Commit 9e9373a

Browse files
committed
Update
[ghstack-poisoned]
1 parent 91fe6ad commit 9e9373a

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

examples/portable/custom_ops/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ list(TRANSFORM _executor_runner__srcs PREPEND "${EXECUTORCH_ROOT}/")
123123

124124
add_executable(custom_ops_executor_runner ${_executor_runner__srcs})
125125
target_link_libraries(
126-
custom_ops_executor_runner custom_ops_lib executorch gflags
126+
custom_ops_executor_runner custom_ops_lib executorch extension_evalue_util
127+
extension_runner_util gflags
127128
)
128129
target_compile_options(
129130
custom_ops_executor_runner PUBLIC ${_common_compile_options}

examples/selective_build/CMakeLists.txt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ if(NOT CMAKE_CXX_STANDARD)
3333
# Can't set to 11 due to executor_runner.cpp make_unique
3434
endif()
3535

36-
set(_common_compile_options -Wno-deprecated-declarations -fPIC -ffunction-sections -fdata-sections)
36+
set(_common_compile_options -Wno-deprecated-declarations -fPIC
37+
-ffunction-sections -fdata-sections
38+
)
3739

3840
# Let files say "include <executorch/path/to/header.h>".
3941
set(_common_include_directories ${EXECUTORCH_ROOT}/..)
@@ -43,7 +45,9 @@ find_package(
4345
gflags REQUIRED PATHS ${CMAKE_CURRENT_BINARY_DIR}/../../third-party
4446
)
4547

46-
target_include_directories(executorch_core INTERFACE ${_common_include_directories})
48+
target_include_directories(
49+
executorch_core INTERFACE ${_common_include_directories}
50+
)
4751

4852
# ------------------------------ OPTIONS BEGIN -------------------------------
4953

@@ -63,12 +67,13 @@ option(EXECUTORCH_SELECT_ALL_OPS
6367
)
6468

6569
# Option to enable parsing ops and dtypes directly from model pte file
66-
option(EXECUTORCH_SELECT_OPS_FROM_MODEL "Enable op selection from pte during build." OFF
70+
option(EXECUTORCH_SELECT_OPS_FROM_MODEL
71+
"Enable op selection from pte during build." OFF
6772
)
6873

69-
# Option to enable dtype selective build. Note: must be using selective build model API.
70-
option(EXECUTORCH_DTYPE_SELECTIVE_BUILD "Enable dtype selective build." OFF
71-
)
74+
# Option to enable dtype selective build. Note: must be using selective build
75+
# model API.
76+
option(EXECUTORCH_DTYPE_SELECTIVE_BUILD "Enable dtype selective build." OFF)
7277
# ------------------------------- OPTIONS END --------------------------------
7378

7479
#
@@ -155,7 +160,8 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
155160
target_link_options_gc_sections(selective_build_test)
156161
endif()
157162
target_link_libraries(
158-
selective_build_test PRIVATE executorch_core gflags select_build_lib
163+
selective_build_test PRIVATE executorch_core extension_evalue_util
164+
extension_runner_util gflags select_build_lib
159165
)
160166
executorch_target_link_options_shared_lib(select_build_lib)
161167
target_compile_options(selective_build_test PUBLIC ${_common_compile_options})

extension/evalue_util/print_evalue.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ int get_edge_items_xalloc() {
3939

4040
/// Returns the number of "edge items" to print at the beginning and end of
4141
/// lists when using the provided stream.
42-
long get_stream_edge_items(std::ostream& os) {
43-
long edge_items = os.iword(get_edge_items_xalloc());
42+
size_t get_stream_edge_items(std::ostream& os) {
43+
size_t edge_items = os.iword(get_edge_items_xalloc());
4444
return edge_items <= 0 ? kDefaultEdgeItems : edge_items;
4545
}
4646

@@ -78,21 +78,20 @@ void print_scalar_list(
7878
executorch::aten::ArrayRef<T> list,
7979
bool print_length = true,
8080
bool elide_inner_items = true) {
81-
long edge_items = elide_inner_items ? get_stream_edge_items(os)
82-
: std::numeric_limits<long>::max();
81+
size_t edge_items = elide_inner_items ? get_stream_edge_items(os)
82+
: std::numeric_limits<long>::max();
8383
if (print_length) {
8484
os << "(len=" << list.size() << ")";
8585
}
8686

8787
// See if we'll be printing enough elements to cause us to wrap.
8888
bool wrapping = false;
8989
{
90-
long num_printed_items;
90+
size_t num_printed_items;
9191
if (elide_inner_items) {
92-
num_printed_items =
93-
std::min(static_cast<long>(list.size()), edge_items * 2);
92+
num_printed_items = std::min(list.size(), edge_items * 2);
9493
} else {
95-
num_printed_items = static_cast<long>(list.size());
94+
num_printed_items = list.size();
9695
}
9796
wrapping = num_printed_items > kItemsPerLine;
9897
}

tools/cmake/executorch-config.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ set(lib_list
7171
qnn_executorch_backend
7272
portable_ops_lib
7373
custom_ops
74+
extension_evalue_util
7475
extension_module
7576
extension_module_static
7677
extension_runner_util

0 commit comments

Comments
 (0)