From 1562be3e8a449360a90af75f6f1481a30d41be75 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 8 Mar 2018 19:09:19 +0000 Subject: COMPMID-998: Release unused trainable parameters. Change-Id: I361a520f34080016a25bc86e1e6789777c5152c1 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/124432 Reviewed-by: Anthony Barbier Tested-by: Jenkins --- src/graph2/backends/GLES/GCTensorHandle.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/graph2/backends/GLES/GCTensorHandle.cpp') diff --git a/src/graph2/backends/GLES/GCTensorHandle.cpp b/src/graph2/backends/GLES/GCTensorHandle.cpp index aa9ac8c2e9..2165cd2de6 100644 --- a/src/graph2/backends/GLES/GCTensorHandle.cpp +++ b/src/graph2/backends/GLES/GCTensorHandle.cpp @@ -60,6 +60,15 @@ void GCTensorHandle::unmap() _tensor.unmap(); } +void GCTensorHandle::release_if_unused() +{ + // TODO (geopin01): Release tensor only if all sub-tensors are marked as not used + if(!_tensor.is_used()) + { + _tensor.allocator()->free(); + } +} + bool GCTensorHandle::is_subtensor() const { return false; -- cgit v1.2.1