diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-11-25 19:15:56 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-11-25 21:20:28 +0000 |
commit | 646d4e4c8289580eb38895d2b0d7c691441d776a (patch) | |
tree | 5ae0a53029b5978884dbfbe28d3a2ff46a138af2 | |
parent | 0922dbbfe403716e79541115ac17a1544022836f (diff) | |
download | ComputeLibrary-646d4e4c8289580eb38895d2b0d7c691441d776a.tar.gz |
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 <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2357
Reviewed-by: SiCong Li <sicong.li@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r-- | src/runtime/TensorAllocator.cpp | 6 |
1 files 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<MemoryRegion>(info().total_size(), alignment())); + _memory.set_owned_region(support::cpp14::make_unique<MemoryRegion>(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); } |