aboutsummaryrefslogtreecommitdiff
path: root/src/graph2/backends/GLES/GCTensorHandle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/graph2/backends/GLES/GCTensorHandle.cpp')
-rw-r--r--src/graph2/backends/GLES/GCTensorHandle.cpp9
1 files changed, 9 insertions, 0 deletions
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;