From a9e153398e4a998ee01623eb78c4604bbd8d34e7 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Fri, 22 Dec 2017 16:37:30 +0000 Subject: COMPMID-766 Allow graph examples to run without OpenCL being present on the platform Change-Id: I4142e0720ecb58549a08d4e86ad21abb882f5f37 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114552 Reviewed-by: Anthony Barbier Tested-by: Anthony Barbier --- arm_compute/runtime/CL/CLScheduler.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'arm_compute/runtime') diff --git a/arm_compute/runtime/CL/CLScheduler.h b/arm_compute/runtime/CL/CLScheduler.h index f700bbb679..91bfe5b213 100644 --- a/arm_compute/runtime/CL/CLScheduler.h +++ b/arm_compute/runtime/CL/CLScheduler.h @@ -39,18 +39,6 @@ void printf_callback(const char *buffer, unsigned int len, size_t complete, void { printf("%.*s", len, buffer); } - -// 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(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(0x100000), - CL_CONTEXT_PLATFORM, reinterpret_cast(cl::Platform::get()()), - 0 -}; } #endif /* defined(ARM_COMPUTE_DEBUG_ENABLED) */ @@ -83,6 +71,17 @@ 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[] = + { + // Enable a printf callback function for this context. + CL_PRINTF_CALLBACK_ARM, reinterpret_cast(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(0x100000), + CL_CONTEXT_PLATFORM, reinterpret_cast(cl::Platform::get()()), + 0 + }; cl::Context::setDefault(cl::Context(CL_DEVICE_TYPE_DEFAULT, properties)); #endif // defined(ARM_COMPUTE_DEBUG_ENABLED) -- cgit v1.2.1