From 8cc5f24292dd4c80c442a78f408e15158db39e30 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 25 Nov 2019 19:15:56 +0000 Subject: COMPMID-2952: NEON failing with 'bus_error' on 32-bit 32-bit requires aligned accesses thus enforcing a default alignment of 64-byte when it's not explicitly specified. Change-Id: I4aed2ed4c8147884dcdeabfa3c043c685adc4fd5 Signed-off-by: Georgios Pinitas Reviewed-on: https://review.mlplatform.org/c/2357 Reviewed-by: SiCong Li Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins (cherry picked from commit 646d4e4c8289580eb38895d2b0d7c691441d776a) Reviewed-on: https://review.mlplatform.org/c/2359 --- src/runtime/TensorAllocator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime/TensorAllocator.cpp b/src/runtime/TensorAllocator.cpp index 7352932ac7..34ea929f28 100644 --- a/src/runtime/TensorAllocator.cpp +++ b/src/runtime/TensorAllocator.cpp @@ -132,13 +132,15 @@ uint8_t *TensorAllocator::data() const void TensorAllocator::allocate() { + // Align to 64-byte boundaries by default if alignment is not specified + const size_t alignment_to_use = (alignment() != 0) ? alignment() : 64; if(_associated_memory_group == nullptr) { - _memory.set_owned_region(support::cpp14::make_unique(info().total_size(), alignment())); + _memory.set_owned_region(support::cpp14::make_unique(info().total_size(), alignment_to_use)); } else { - _associated_memory_group->finalize_memory(_owner, _memory, info().total_size(), alignment()); + _associated_memory_group->finalize_memory(_owner, _memory, info().total_size(), alignment_to_use); } info().set_is_resizable(false); } -- cgit v1.2.1