aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2019-11-25 19:15:56 +0000
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-11-25 21:25:05 +0000
commit8cc5f24292dd4c80c442a78f408e15158db39e30 (patch)
tree81aa5990347eda0e10b7643b921b171caf0b62ca
parent05187f2521ad50478e389a439fca7186bca6d349 (diff)
downloadComputeLibrary-8cc5f24292dd4c80c442a78f408e15158db39e30.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> (cherry picked from commit 646d4e4c8289580eb38895d2b0d7c691441d776a) Reviewed-on: https://review.mlplatform.org/c/2359
-rw-r--r--src/runtime/TensorAllocator.cpp6
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);
}