From df473eab0ab8a52e6b58e0f6442b39ba4c1d68ea Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 31 May 2018 18:53:52 +0100 Subject: COMPMID-1182: printf doesn't work Change-Id: I013d57f6e2becbd6d2d7700ce5fbbeca670443c4 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/133735 Tested-by: Jenkins Reviewed-by: Pablo Tello --- tests/framework/Framework.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tests/framework') diff --git a/tests/framework/Framework.cpp b/tests/framework/Framework.cpp index fd0afe9d7f..7e1f2934ff 100644 --- a/tests/framework/Framework.cpp +++ b/tests/framework/Framework.cpp @@ -534,12 +534,15 @@ bool Framework::run() // 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(); + auto ctx_properties = CLScheduler::get().context().getInfo(nullptr); + auto queue_properties = CLScheduler::get().queue().getInfo(nullptr); + + cl::Context new_ctx = cl::Context(CL_DEVICE_TYPE_DEFAULT, ctx_properties.data()); + cl::CommandQueue new_queue = cl::CommandQueue(new_ctx, cl::Device::getDefault(), queue_properties); - cl::Context::setDefault(cl::Context(CL_DEVICE_TYPE_DEFAULT)); - CLScheduler::get().set_context(cl::Context::getDefault()); + CLKernelLibrary::get().clear_programs_cache(); + CLScheduler::get().set_context(new_ctx); + CLScheduler::get().set_queue(new_queue); } #endif // ARM_COMPUTE_CL run_test(test_info, *test_factory); -- cgit v1.2.1