Skip to content

Commit c032194

Browse files
perfacebook-github-bot
authored andcommitted
Fix Hard Fault in arm_executor_runner (#5302)
Summary: The introduction of the PlatformMemoryAllocator in #5121 introduced a hard fault in arm_executor_runner when not supplying the temp_allocator in the MemoryManager, so add it to get tests running again. Change-Id: I357244a15c1b1fdee567ad828e09e3607e43e2e7 Pull Request resolved: #5302 Reviewed By: manuelcandales Differential Revision: D62582281 Pulled By: digantdesai fbshipit-source-id: c650771d5ad2eddf80b30fcbafaf6e731ca9eed3
1 parent 4b3f1c5 commit c032194

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/arm/executor_runner/arm_executor_runner.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ unsigned char __attribute__((
5252
section("network_model_sec"),
5353
aligned(16))) method_allocation_pool[METHOD_ALLOCATOR_POOL_SIZE];
5454

55+
const size_t temp_allocation_pool_size = 1 * 1024 * 1024;
56+
unsigned char __attribute__((
57+
section("network_model_sec"),
58+
aligned(16))) temp_allocation_pool[temp_allocation_pool_size];
59+
5560
void et_pal_init(void) {}
5661

5762
ET_NORETURN void et_pal_abort(void) {
@@ -323,8 +328,11 @@ int main(int argc, const char* argv[]) {
323328
torch::executor::HierarchicalAllocator planned_memory(
324329
{planned_spans.data(), planned_spans.size()});
325330

331+
torch::executor::MemoryAllocator temp_allocator(
332+
temp_allocation_pool_size, temp_allocation_pool);
333+
326334
torch::executor::MemoryManager memory_manager(
327-
&method_allocator, &planned_memory);
335+
&method_allocator, &planned_memory, &temp_allocator);
328336

329337
Result<torch::executor::Method> method =
330338
program->load_method(method_name, &memory_manager);

0 commit comments

Comments
 (0)