Skip to content

Commit c440c68

Browse files
author
Ashutosh Parkhi
committed
[CMSIS-NN] Reduction in code size of AOT test runner binary
Presently, integration tests for CMSIS-NN generate binary which includes all the CMSIS-NN kernels. This fix introduces additional compilation and runtime knobs to pick kernel sources for which TVM generates the code. Change-Id: I6d25addf465d35d1714fd5d2956f9a66b6733c53
1 parent e18b48b commit c440c68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/python/relay/aot/corstone300.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ETHOSU_PATH=/opt/arm/ethosu
4242
DRIVER_PATH=${ETHOSU_PATH}/core_driver
4343
CMSIS_PATH=${ETHOSU_PATH}/cmsis
4444
PLATFORM_PATH=${ETHOSU_PATH}/core_platform/targets/corstone-300
45-
PKG_COMPILE_OPTS = -g -Wall -O2 -Wno-incompatible-pointer-types -Wno-format -mcpu=${MCPU}${MCPU_FLAGS} -mthumb -mfloat-abi=${MFLOAT_ABI} -std=gnu99
45+
PKG_COMPILE_OPTS = -Wall -Ofast -Wno-incompatible-pointer-types -Wno-format -mcpu=${MCPU} -mthumb -mfloat-abi=${MFLOAT_ABI} -std=gnu99
4646
CMAKE = /opt/arm/cmake/bin/cmake
4747
CC = arm-none-eabi-gcc
4848
AR = arm-none-eabi-ar
@@ -64,7 +64,7 @@ DRIVER_CMAKE_FLAGS = -DCMAKE_TOOLCHAIN_FILE=$(ETHOSU_TEST_ROOT)/arm-none-eabi-gc
6464
-DETHOSU_LOG_SEVERITY=debug \
6565
-DCMAKE_SYSTEM_PROCESSOR=cortex-m55
6666

67-
PKG_LDFLAGS = -lm -specs=nosys.specs -static -T ${AOT_TEST_ROOT}/corstone300.ld
67+
PKG_LDFLAGS = -lm -specs=nosys.specs -static -Wl,--gc-sections -T ${AOT_TEST_ROOT}/corstone300.ld
6868

6969
$(ifeq VERBOSE,1)
7070
QUIET ?=
@@ -114,7 +114,7 @@ ${build_dir}/libcmsis_startup.a: $(CMSIS_STARTUP_SRCS)
114114

115115
${build_dir}/libcmsis_nn.a: $(CMSIS_NN_SRCS)
116116
$(QUIET)mkdir -p $(abspath $(build_dir)/libcmsis_nn)
117-
$(QUIET)cd $(abspath $(build_dir)/libcmsis_nn) && $(CC) -c $(PKG_CFLAGS) -D${ARM_CPU} $^
117+
$(QUIET)cd $(abspath $(build_dir)/libcmsis_nn) && $(CC) -c $(PKG_CFLAGS) -ffunction-sections -fdata-sections -D${ARM_CPU} $^
118118
$(QUIET)$(AR) -cr $(abspath $(build_dir)/libcmsis_nn.a) $(abspath $(build_dir))/libcmsis_nn/*.o
119119
$(QUIET)$(RANLIB) $(abspath $(build_dir)/libcmsis_nn.a)
120120

0 commit comments

Comments
 (0)