diff options
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/core/CL/OpenCL.h | 3 | ||||
-rw-r--r-- | arm_compute/runtime/CL/CLScheduler.h | 23 |
2 files changed, 14 insertions, 12 deletions
diff --git a/arm_compute/core/CL/OpenCL.h b/arm_compute/core/CL/OpenCL.h index 8a2d30bb83..e389b867a9 100644 --- a/arm_compute/core/CL/OpenCL.h +++ b/arm_compute/core/CL/OpenCL.h @@ -57,6 +57,9 @@ public: #define DECLARE_FUNCTION_PTR(func_name) \ std::function<decltype(func_name)> func_name##_ptr = nullptr + DECLARE_FUNCTION_PTR(clCreateContextFromType); + DECLARE_FUNCTION_PTR(clCreateCommandQueue); + DECLARE_FUNCTION_PTR(clGetContextInfo); DECLARE_FUNCTION_PTR(clBuildProgram); DECLARE_FUNCTION_PTR(clEnqueueNDRangeKernel); DECLARE_FUNCTION_PTR(clSetKernelArg); 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<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 -}; } #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<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) |