Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion examples/arm/executor_runner/arm_executor_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ unsigned char __attribute__((
section("network_model_sec"),
aligned(16))) method_allocation_pool[METHOD_ALLOCATOR_POOL_SIZE];

const size_t temp_allocation_pool_size = 1 * 1024 * 1024;
unsigned char __attribute__((
section("network_model_sec"),
aligned(16))) temp_allocation_pool[temp_allocation_pool_size];

void et_pal_init(void) {}

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

torch::executor::MemoryAllocator temp_allocator(
temp_allocation_pool_size, temp_allocation_pool);

torch::executor::MemoryManager memory_manager(
&method_allocator, &planned_memory);
&method_allocator, &planned_memory, &temp_allocator);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manuelcandales shouldn't we fall back to using method allocator if null?


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