Skip to content

Commit 8a5668a

Browse files
lucylqfacebook-github-bot
authored andcommitted
Size test all ops (#3522)
Summary: Pull Request resolved: #3522 Test Plan: Imported from GitHub, without a `Test Plan:` line. ``` bash test/build_size_test.sh ExecuTorch with no ops binary size, unstripped: -rwxr-xr-x 1 lfq users 68448 May 6 13:57 cmake-out/test/size_test ExecuTorch with portable ops binary size, unstripped: -rwxr-xr-x 1 lfq users 27129992 May 6 13:57 cmake-out/test/size_test_all_ops ``` Reviewed By: mergennachin Differential Revision: D57017805 Pulled By: lucylq fbshipit-source-id: 330645325a5e784670092e5b34b19a2531b99ea1
1 parent b0c0e30 commit 8a5668a

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

test/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,16 @@ if(CMAKE_BUILD_TYPE EQUAL "Release")
5757
target_link_options(size_test PRIVATE "LINKER:--gc-sections")
5858
endif()
5959

60+
#
61+
# size_test_all_ops: binary with portable ops and no delegate backend
62+
#
63+
add_executable(size_test_all_ops ${_size_test__srcs})
64+
target_link_options_shared_lib(portable_ops_lib)
65+
target_link_libraries(size_test_all_ops executorch
66+
portable_ops_lib portable_kernels)
67+
if(CMAKE_BUILD_TYPE EQUAL "Release")
68+
target_link_options(size_test_all_ops PRIVATE "LINKER:--gc-sections")
69+
endif()
70+
6071
# Print all summary
6172
executorch_print_configuration_summary()

test/build_size_test.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,14 @@ cmake_install_executorch_lib() {
4646
test_cmake_size_test() {
4747
retry cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test
4848

49-
echo "Build selective build test"
49+
echo "Build size test"
5050
cmake --build cmake-out/test -j9 --config Release
5151

52-
echo 'Size of the binary:'
52+
echo 'ExecuTorch with no ops binary size, unstripped:'
5353
ls -al cmake-out/test/size_test
54+
55+
echo 'ExecuTorch with portable ops binary size, unstripped:'
56+
ls -al cmake-out/test/size_test_all_ops
5457
}
5558

5659
if [[ -z $BUCK2 ]]; then

0 commit comments

Comments
 (0)