COMPMID-2905: Fixed benchmark graph segfault.

Reworked the graph api opencl backend to use the legacy api in
initialize_backend().

Change-Id: Ie27a3484a3851e742fce9bf5bfef7b6ef928d0a0
Signed-off-by: Pablo Tello <pablo.tello@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2276
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
diff --git a/arm_compute/graph/backends/CL/CLDeviceBackend.h b/arm_compute/graph/backends/CL/CLDeviceBackend.h
index 1239d5d..8e5fe8c 100644
--- a/arm_compute/graph/backends/CL/CLDeviceBackend.h
+++ b/arm_compute/graph/backends/CL/CLDeviceBackend.h
@@ -31,7 +31,6 @@
 
 namespace arm_compute
 {
-class CLCoreRuntimeContext;
 namespace graph
 {
 namespace backends
@@ -75,7 +74,6 @@
     CLTuner                               _tuner;         /**< CL kernel tuner */
     std::unique_ptr<CLBufferAllocator>    _allocator;     /**< CL buffer affinity allocator */
     std::string                           _tuner_file;    /**< Filename to load/store the tuner's values from */
-    std::unique_ptr<CLCoreRuntimeContext> _legacy_ctx;
 };
 } // namespace backends
 } // namespace graph
diff --git a/src/graph/backends/CL/CLDeviceBackend.cpp b/src/graph/backends/CL/CLDeviceBackend.cpp
index 58c666c..de31847 100644
--- a/src/graph/backends/CL/CLDeviceBackend.cpp
+++ b/src/graph/backends/CL/CLDeviceBackend.cpp
@@ -65,7 +65,7 @@
 static detail::BackendRegistrar<CLDeviceBackend> CLDeviceBackend_registrar(Target::CL);
 
 CLDeviceBackend::CLDeviceBackend()
-    : _context_count(0), _tuner(), _allocator(nullptr), _tuner_file(), _legacy_ctx()
+    : _context_count(0), _tuner(), _allocator(nullptr), _tuner_file()
 {
 }
 
@@ -92,9 +92,8 @@
 {
     // Setup Scheduler
     CLScheduler::get().default_init(&_tuner);
-    _legacy_ctx = support::cpp14::make_unique<CLCoreRuntimeContext>(nullptr, CLScheduler::get().context(), CLScheduler::get().queue());
     // Create allocator with new context
-    _allocator = support::cpp14::make_unique<CLBufferAllocator>(_legacy_ctx.get());
+    _allocator = support::cpp14::make_unique<CLBufferAllocator>(nullptr /* legacy path for CLCoreRuntimeContext */);
 }
 
 void CLDeviceBackend::release_backend_context(GraphContext &ctx)