aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-01-08 15:55:21 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:42:33 +0000
commitfd14f9e5ff091f6ddcbf332709ba408527294508 (patch)
treecedbe46434b4327c6ed46491d225936fd0a24f4e
parentabd03cfc7ba96462bc5a1ca6f4faa9ca22792158 (diff)
downloadComputeLibrary-fd14f9e5ff091f6ddcbf332709ba408527294508.tar.gz
COMPMID-783: Segfault in OCLGrind
Enforce clFinish to be called on destruction of the CLScheduler to ensure that no leftovers are in the queue which might lead to the retain of the queue and its deferred destruction. Change-Id: Ic71933f65cdccd74f4f01a6e2ec1a049995f5b50 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/115389 Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
-rw-r--r--arm_compute/runtime/CL/CLScheduler.h4
-rw-r--r--src/runtime/CL/CLScheduler.cpp7
2 files changed, 9 insertions, 2 deletions
diff --git a/arm_compute/runtime/CL/CLScheduler.h b/arm_compute/runtime/CL/CLScheduler.h
index 91bfe5b213..3985829a49 100644
--- a/arm_compute/runtime/CL/CLScheduler.h
+++ b/arm_compute/runtime/CL/CLScheduler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016, 2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -52,6 +52,8 @@ class CLScheduler
private:
/** Constructor */
CLScheduler();
+ /** Destructor */
+ ~CLScheduler();
/** Prevent instances of this class from being copied (As this class contains pointers) */
CLScheduler(const CLScheduler &) = delete;
/** Prevent instances of this class from being copied (As this class contains pointers) */
diff --git a/src/runtime/CL/CLScheduler.cpp b/src/runtime/CL/CLScheduler.cpp
index bf13a25693..c947b7acc4 100644
--- a/src/runtime/CL/CLScheduler.cpp
+++ b/src/runtime/CL/CLScheduler.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017 ARM Limited.
+ * Copyright (c) 2016, 2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -35,6 +35,11 @@ CLScheduler::CLScheduler()
{
}
+CLScheduler::~CLScheduler()
+{
+ _queue.finish();
+}
+
CLScheduler &CLScheduler::get()
{
std::call_once(_initialize_symbols, opencl_is_available);