Skip to content

Commit cf18ced

Browse files
zingofacebook-github-bot
authored andcommitted
Arm backend: Make memory pool sizes configrable from cmake (#5841)
Summary: Pull Request resolved: #5841 Reviewed By: mergennachin Differential Revision: D63832189 Pulled By: digantdesai fbshipit-source-id: 1ef435045b8821436f6b7272482ae0f7e30df33d
1 parent a8bc144 commit cf18ced

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

examples/arm/executor_runner/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ cmake_minimum_required(VERSION 3.20)
77
project(arm_executor_runner)
88

99
option(SEMIHOSTING "Enable semihosting" OFF)
10+
option(ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE "Set ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE to specify memory alloction pool size" OFF)
11+
option(ET_ARM_BAREMETAL_TEMP_ALLOCATOR_POOL_SIZE "Set ET_ARM_BAREMETAL_TEMP_ALLOCATOR_POOL_SIZE to specify temp alloction pool size" OFF)
12+
1013

1114
if(NOT DEFINED ET_PTE_FILE_PATH AND NOT ${SEMIHOSTING})
1215
message(
@@ -172,6 +175,14 @@ else()
172175
add_dependencies(arm_executor_runner gen_model_header)
173176
endif()
174177

178+
if(ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE)
179+
target_compile_definitions(arm_executor_runner PUBLIC ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE=${ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE})
180+
endif()
181+
182+
if(ET_ARM_BAREMETAL_TEMP_ALLOCATOR_POOL_SIZE)
183+
target_compile_definitions(arm_executor_runner PUBLIC ET_ARM_BAREMETAL_TEMP_ALLOCATOR_POOL_SIZE=${ET_ARM_BAREMETAL_TEMP_ALLOCATOR_POOL_SIZE})
184+
endif()
185+
175186
# Fixup compilation of retarget.c
176187
if(SEMIHOSTING)
177188
# Remove this when MLBEDSW-8910 is closed.

examples/arm/executor_runner/arm_executor_runner.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,11 @@ int main(int argc, const char* argv[]) {
392392
(unsigned int)method_meta.error());
393393
}
394394

395+
ET_LOG(
396+
Info,
397+
"Setup Method allocator pool. Size: %lu bytes.",
398+
method_allocation_pool_size);
399+
395400
ArmMemoryAllocator method_allocator(
396401
method_allocation_pool_size, method_allocation_pool);
397402

0 commit comments

Comments
 (0)