Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions backends/arm/runtime/EthosUBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,9 @@ class EthosUBackend final : public ::executorch::runtime::BackendInterface {
// Use a temporary allocator for the intermediate tensors of the
// computation. The allocator is released in runtime/executor/method.cpp at
// the end of the execution of the Ethos-U custom delegate
char* ethosu_scratch =
static_cast<char*>(temp_allocator->allocate(handles.scratch_data_size));
// Ethos-U driver requires 16 bit alignment.
char* ethosu_scratch = static_cast<char*>(
temp_allocator->allocate(handles.scratch_data_size, 16UL));
if (ethosu_scratch == nullptr) {
ET_LOG(
Error,
Expand Down
5 changes: 3 additions & 2 deletions examples/arm/executor_runner/arm_executor_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,9 @@ void runner_init(
ET_LOG(Info, "Setting up planned buffer %zu, size %zu.", id, buffer_size);

/* Move to it's own allocator when MemoryPlanner is in place. */
uint8_t* buffer =
reinterpret_cast<uint8_t*>(ctx.method_allocator->allocate(buffer_size));
/* Ethos-U driver requires 16 bit alignment. */
uint8_t* buffer = reinterpret_cast<uint8_t*>(
ctx.method_allocator->allocate(buffer_size, 16UL));
ET_CHECK_MSG(
buffer != nullptr,
"Could not allocate memory for memory planned buffer size %zu",
Expand Down
Loading