aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-06-18 18:13:51 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:53:20 +0000
commit17b12307edeaf488cfdf0cc3fa00b8f08293c93e (patch)
treed7025d84a03d9897b4811ade16a2a1952bdb09c4 /src
parent09b19129b65c5b8d1ca1c3851bab919bb9b7e1a1 (diff)
downloadComputeLibrary-17b12307edeaf488cfdf0cc3fa00b8f08293c93e.tar.gz
COMPMID-1293: Handle aligned allocations
Change-Id: I6e642c8cd968240f883c327464519e57e5d0c3e3 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/136088 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/ITensorAllocator.cpp14
-rw-r--r--src/runtime/TensorAllocator.cpp2
2 files changed, 11 insertions, 5 deletions
diff --git a/src/runtime/ITensorAllocator.cpp b/src/runtime/ITensorAllocator.cpp
index 8294201384..087f324922 100644
--- a/src/runtime/ITensorAllocator.cpp
+++ b/src/runtime/ITensorAllocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -31,13 +31,14 @@
using namespace arm_compute;
ITensorAllocator::ITensorAllocator()
- : _info()
+ : _info(), _alignment(0)
{
}
-void ITensorAllocator::init(const TensorInfo &input)
+void ITensorAllocator::init(const TensorInfo &input, size_t alignment)
{
- _info = input;
+ _info = input;
+ _alignment = alignment;
}
TensorInfo &ITensorAllocator::info()
@@ -49,3 +50,8 @@ const TensorInfo &ITensorAllocator::info() const
{
return _info;
}
+
+size_t ITensorAllocator::alignment() const
+{
+ return _alignment;
+}
diff --git a/src/runtime/TensorAllocator.cpp b/src/runtime/TensorAllocator.cpp
index 993a95b6c3..c84a2719d8 100644
--- a/src/runtime/TensorAllocator.cpp
+++ b/src/runtime/TensorAllocator.cpp
@@ -138,7 +138,7 @@ void TensorAllocator::allocate()
if(_associated_memory_group == nullptr)
{
- _memory = Memory(std::make_shared<MemoryRegion>(info().total_size()));
+ _memory = Memory(std::make_shared<MemoryRegion>(info().total_size(), alignment()));
}
else
{