Merge pull request #1882 from philippefoubert:branch_ocl_instrumentation
authorRoman Donchenko <roman.donchenko@itseez.com>
Mon, 2 Dec 2013 14:55:47 +0000 (18:55 +0400)
committerOpenCV Buildbot <buildbot@opencv.org>
Mon, 2 Dec 2013 14:55:47 +0000 (18:55 +0400)
1  2 
modules/ocl/src/cl_context.cpp

@@@ -46,8 -46,6 +46,8 @@@
  //M*/
  
  #include "precomp.hpp"
 +#include <stdlib.h>
 +#include <ctype.h>
  #include <iomanip>
  #include <fstream>
  #include "cl_programcache.hpp"
@@@ -658,8 -656,11 +658,11 @@@ void ContextImpl::setContext(const Devi
      cl_context_properties cps[3] = { CL_CONTEXT_PLATFORM, (cl_context_properties)(infoImpl.platform_id), 0 };
      cl_context clContext = clCreateContext(cps, 1, &infoImpl.device_id, NULL, NULL, &status);
      openCLVerifyCall(status);
-     // TODO add CL_QUEUE_PROFILING_ENABLE
+ #ifdef PRINT_KERNEL_RUN_TIME
+     cl_command_queue clCmdQueue = clCreateCommandQueue(clContext, infoImpl.device_id, CL_QUEUE_PROFILING_ENABLE, &status);
+ #else /*PRINT_KERNEL_RUN_TIME*/
      cl_command_queue clCmdQueue = clCreateCommandQueue(clContext, infoImpl.device_id, 0, &status);
+ #endif /*PRINT_KERNEL_RUN_TIME*/
      openCLVerifyCall(status);
  
      ContextImpl* ctx = new ContextImpl(infoImpl.info, infoImpl.device_id);