aboutsummaryrefslogtreecommitdiff
path: root/tests/framework
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2018-05-16 12:01:14 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:52:37 +0000
commitd30ed1149da417a5a0c76a48ca08c18a0006be52 (patch)
tree1142b3e05af4627d9b32d0b498843dd4fa3ec30b /tests/framework
parentc483521dd36134acd659341f7629e0c02b1f23d9 (diff)
downloadComputeLibrary-d30ed1149da417a5a0c76a48ca08c18a0006be52.tar.gz
COMPMID-1119 - Bugfix SIGKILL
The problem seems caused by the OpenCL driver that does not release the allocated memory. In order to solve this problem the OpenCL context is destroyed every 5000 tests to force the release of the memory Change-Id: I2135f49d7ff92c7761ec8dba6819db1590e19691 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/131459 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/framework')
-rw-r--r--tests/framework/Framework.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/framework/Framework.cpp b/tests/framework/Framework.cpp
index 81e16c8fb7..fd0afe9d7f 100644
--- a/tests/framework/Framework.cpp
+++ b/tests/framework/Framework.cpp
@@ -24,6 +24,9 @@
#include "Framework.h"
#include "support/ToolchainSupport.h"
+#ifdef ARM_COMPUTE_CL
+#include "arm_compute/runtime/CL/CLScheduler.h"
+#endif /* ARM_COMPUTE_CL */
#include <chrono>
#include <iostream>
@@ -517,7 +520,8 @@ bool Framework::run()
const std::chrono::time_point<std::chrono::high_resolution_clock> start = std::chrono::high_resolution_clock::now();
- int id = 0;
+ int id = 0;
+ int id_run_test = 0;
for(auto &test_factory : _test_factories)
{
@@ -526,7 +530,21 @@ bool Framework::run()
if(_test_filter.is_selected(test_info))
{
+#ifdef ARM_COMPUTE_CL
+ // Every 5000 tests, reset the OpenCL context to release the allocated memory
+ if((id_run_test % 5000) == 0)
+ {
+ cl::Context::setDefault(cl::Context());
+ CLScheduler::get().set_context(cl::Context());
+ CLKernelLibrary::get().clear_programs_cache();
+
+ cl::Context::setDefault(cl::Context(CL_DEVICE_TYPE_DEFAULT));
+ CLScheduler::get().set_context(cl::Context::getDefault());
+ }
+#endif // ARM_COMPUTE_CL
run_test(test_info, *test_factory);
+
+ ++id_run_test;
}
++id;