aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/ITensorAllocator.h
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 /arm_compute/runtime/ITensorAllocator.h
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 'arm_compute/runtime/ITensorAllocator.h')
-rw-r--r--arm_compute/runtime/ITensorAllocator.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/arm_compute/runtime/ITensorAllocator.h b/arm_compute/runtime/ITensorAllocator.h
index 6103e436bc..bb708f0b97 100644
--- a/arm_compute/runtime/ITensorAllocator.h
+++ b/arm_compute/runtime/ITensorAllocator.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -50,9 +50,10 @@ public:
/** Initialize a tensor based on the passed @ref TensorInfo.
*
- * @param[in] input TensorInfo object containing the description of the tensor to initialize.
+ * @param[in] input TensorInfo object containing the description of the tensor to initialize.
+ * @param[in] alignment Alignment in bytes that the underlying base pointer should comply with.
*/
- void init(const TensorInfo &input);
+ void init(const TensorInfo &input, size_t alignment = 0);
/** Return a reference to the tensor's metadata
*
* @return Reference to the tensor's metadata.
@@ -63,6 +64,11 @@ public:
* @return Constant reference to the tensor's metadata.
*/
const TensorInfo &info() const;
+ /** Return underlying's tensor buffer alignment
+ *
+ * @return Tensor buffer alignment
+ */
+ size_t alignment() const;
/** Interface to be implemented by the child class to allocate the tensor.
*
@@ -87,7 +93,8 @@ protected:
virtual void unlock() = 0;
private:
- TensorInfo _info; /**< Tensor's metadata. */
+ TensorInfo _info; /**< Tensor's metadata. */
+ size_t _alignment; /**< Tensor's alignment in bytes */
};
}
#endif /*__ARM_COMPUTE_ITENSORALLOCATOR_H__ */