From 3d1489de593574e65ef1e64a7ae64e4e56c2978b Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 3 May 2018 20:47:16 +0100 Subject: COMPMID-605: Transition buffer memory manager Change-Id: Ide7c6124eb19f13f15f517e62d705646a0cd1ecd Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/130184 Reviewed-by: Georgios Pinitas Tested-by: Jenkins Reviewed-by: Anthony Barbier --- src/graph/backends/NEON/NESubTensorHandle.cpp | 35 ++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'src/graph/backends/NEON/NESubTensorHandle.cpp') diff --git a/src/graph/backends/NEON/NESubTensorHandle.cpp b/src/graph/backends/NEON/NESubTensorHandle.cpp index c48ba6b9d6..c0acedd9f2 100644 --- a/src/graph/backends/NEON/NESubTensorHandle.cpp +++ b/src/graph/backends/NEON/NESubTensorHandle.cpp @@ -30,10 +30,11 @@ namespace graph namespace backends { NESubTensorHandle::NESubTensorHandle(ITensorHandle *parent_handle, const TensorShape &shape, const Coordinates &coords, bool extend_parent) - : _sub_tensor() + : _sub_tensor(), _parent_handle(nullptr) { ARM_COMPUTE_ERROR_ON(!parent_handle); - _sub_tensor = arm_compute::SubTensor(&parent_handle->tensor(), shape, coords, extend_parent); + _sub_tensor = arm_compute::SubTensor(&parent_handle->tensor(), shape, coords, extend_parent); + _parent_handle = parent_handle; } void NESubTensorHandle::allocate() @@ -41,14 +42,15 @@ void NESubTensorHandle::allocate() // noop } -const arm_compute::ITensor &NESubTensorHandle::tensor() const +void NESubTensorHandle::free() { - return _sub_tensor; + // noop } -arm_compute::ITensor &NESubTensorHandle::tensor() +void NESubTensorHandle::manage(IMemoryGroup *mg) { - return _sub_tensor; + ARM_COMPUTE_UNUSED(mg); + // noop } void NESubTensorHandle::map(bool blocking) @@ -66,10 +68,31 @@ void NESubTensorHandle::release_if_unused() // noop } +const arm_compute::ITensor &NESubTensorHandle::tensor() const +{ + return _sub_tensor; +} + +arm_compute::ITensor &NESubTensorHandle::tensor() +{ + return _sub_tensor; +} + +ITensorHandle *NESubTensorHandle::parent_handle() +{ + ARM_COMPUTE_ERROR_ON(_parent_handle == nullptr); + return _parent_handle->parent_handle(); +} + bool NESubTensorHandle::is_subtensor() const { return true; } + +Target NESubTensorHandle::target() const +{ + return Target::NEON; +} } // namespace backends } // namespace graph } // namespace arm_compute \ No newline at end of file -- cgit v1.2.1