aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/CL/CLScheduler.h
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-01-05 10:59:12 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:42:33 +0000
commit6db0ff5b4bb49f834c7caa532a7feab228df10f9 (patch)
tree36c32ab3e94a86752d6b73c4a3503b191431d586 /arm_compute/runtime/CL/CLScheduler.h
parentfde97fb84943d0328c2c532d117e9b875149f27e (diff)
downloadComputeLibrary-6db0ff5b4bb49f834c7caa532a7feab228df10f9.tar.gz
COMPMID-771 Allow examples to be profiled
Change-Id: I180281e796e1670b9ad391d82d66ecde0119ef78 Note: this is for internal use only which is why I think the hackiness of RunExample.cpp is acceptable. Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/115154 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Pablo Tello <pablo.tello@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/runtime/CL/CLScheduler.h')
-rw-r--r--arm_compute/runtime/CL/CLScheduler.h35
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.
*