aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/framework/Framework.cpp13
-rw-r--r--tests/validation/CL/FixedPoint/FixedPointTarget.h4
2 files changed, 10 insertions, 7 deletions
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<CL_CONTEXT_PROPERTIES>(nullptr);
+ auto queue_properties = CLScheduler::get().queue().getInfo<CL_QUEUE_PROPERTIES>(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);
diff --git a/tests/validation/CL/FixedPoint/FixedPointTarget.h b/tests/validation/CL/FixedPoint/FixedPointTarget.h
index 38473545d9..920bd374d3 100644
--- a/tests/validation/CL/FixedPoint/FixedPointTarget.h
+++ b/tests/validation/CL/FixedPoint/FixedPointTarget.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -110,7 +110,7 @@ void compute_target_impl(const TensorShape &shape, DataType dt, FixedPointOp op,
sources.push_back(fixed_point_operation_kernel);
// Create program
- ::cl::Program program(sources);
+ ::cl::Program program(CLScheduler::get().context(), sources);
// Build program
program.build(build_opts.c_str());