From b6eb35371d222c6b7f61210d97ebd7dd9e197458 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Wed, 8 Aug 2018 13:20:04 +0100 Subject: COMPMID-1478: Stop relying on static default OpenCL objects in cl2.hpp This causes problems when ACL is used as a shared library on Android. Fixes some problems related to creation / destruction order between the Graph's CL backend and core / runtime Change-Id: I716d63fd42f4586df1ffbb6fa97e4db06d3a781b Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/143228 Tested-by: Jenkins Reviewed-by: Michele DiGiorgio Reviewed-by: Gian Marco Iodice --- src/graph/GraphContext.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/graph/GraphContext.cpp') diff --git a/src/graph/GraphContext.cpp b/src/graph/GraphContext.cpp index 3f311145bc..5f33ed3537 100644 --- a/src/graph/GraphContext.cpp +++ b/src/graph/GraphContext.cpp @@ -22,7 +22,9 @@ * SOFTWARE. */ #include "arm_compute/graph/GraphContext.h" -#include + +#include "arm_compute/graph.h" +#include "arm_compute/graph/Utils.h" namespace arm_compute { @@ -33,6 +35,12 @@ GraphContext::GraphContext() { } +GraphContext::~GraphContext() +{ + _memory_managers.clear(); + release_default_graph_context(*this); +} + const GraphConfig &GraphContext::config() const { return _config; @@ -82,4 +90,4 @@ void GraphContext::finalize() } } } // namespace graph -} // namespace arm_compute \ No newline at end of file +} // namespace arm_compute -- cgit v1.2.1