diff options
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/runtime/CL/CLScheduler.h | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/arm_compute/runtime/CL/CLScheduler.h b/arm_compute/runtime/CL/CLScheduler.h index 3985829a49..c76ee3f273 100644 --- a/arm_compute/runtime/CL/CLScheduler.h +++ b/arm_compute/runtime/CL/CLScheduler.h @@ -72,23 +72,30 @@ public: */ void default_init(ICLTuner *cl_tuner = nullptr) { -#if defined(ARM_COMPUTE_DEBUG_ENABLED) - // Create a cl_context with a printf_callback and user specified buffer size. - cl_context_properties properties[] = + if(!_is_initialised) { - // Enable a printf callback function for this context. - CL_PRINTF_CALLBACK_ARM, reinterpret_cast<cl_context_properties>(printf_callback), - // Request a minimum printf buffer size of 4MB for devices in the - // context that support this extension. - CL_PRINTF_BUFFERSIZE_ARM, static_cast<cl_context_properties>(0x100000), - CL_CONTEXT_PLATFORM, reinterpret_cast<cl_context_properties>(cl::Platform::get()()), - 0 - }; - cl::Context::setDefault(cl::Context(CL_DEVICE_TYPE_DEFAULT, properties)); +#if defined(ARM_COMPUTE_DEBUG_ENABLED) + // Create a cl_context with a printf_callback and user specified buffer size. + cl_context_properties properties[] = + { + // Enable a printf callback function for this context. + CL_PRINTF_CALLBACK_ARM, reinterpret_cast<cl_context_properties>(printf_callback), + // Request a minimum printf buffer size of 4MB for devices in the + // context that support this extension. + CL_PRINTF_BUFFERSIZE_ARM, static_cast<cl_context_properties>(0x100000), + CL_CONTEXT_PLATFORM, reinterpret_cast<cl_context_properties>(cl::Platform::get()()), + 0 + }; + cl::Context::setDefault(cl::Context(CL_DEVICE_TYPE_DEFAULT, properties)); #endif // defined(ARM_COMPUTE_DEBUG_ENABLED) - CLKernelLibrary::get().init("./cl_kernels/", cl::Context::getDefault(), cl::Device::getDefault()); - init(cl::Context::getDefault(), cl::CommandQueue::getDefault(), cl::Device::getDefault(), cl_tuner); + CLKernelLibrary::get().init("./cl_kernels/", cl::Context::getDefault(), cl::Device::getDefault()); + init(cl::Context::getDefault(), cl::CommandQueue::getDefault(), cl::Device::getDefault(), cl_tuner); + } + else + { + _cl_tuner = cl_tuner; + } } /** Schedule the execution of the passed kernel if possible. * |