title: clCreateContext takes a lot of time in OpenCL
body: <p>I am working on an openCL program, and everything is working good, but the problem is that clCreateContext function call takes most of the program execution time (the program runs in about 400 ms where 380 ms just for creating context).</p>
  
  <p>The kernel is compiled online after creating context and command queue. And my system contains just one OpenCL device (Nvidia Pascal).</p>
  
  <p>I tried the same program on Nvidia GeForce GT 640, and it takes less time for creating context (about 100 ms), but still too large comparing to the execution time (I printed the device names and they are all good).</p>
  
  <pre><code>vector&lt;cl_platform_id&gt; platforms;
  cl_device_id device_id;
  clGetPlatformIDs(0, NULL, &amp;ret_num_platforms);
  ret = clGetPlatformIDs(ret_num_platforms, &amp;platforms[0], NULL);
  ret = clGetDeviceIDs(platforms[0], deviceType, 1, &amp;device_id, &amp;ret_num_devices);
  timeStamps[0] = get_timestamp();
  context = clCreateContext(NULL, 1, &amp;device_id, NULL, NULL, &amp;ret);
  timeStamps[1] = get_timestamp();
  contextTime=(timeStamps[1]-timeStamps[0]) / 1000.0L;
  cout &lt;&lt; "   Context Time: " &lt;&lt; contextTime &lt;&lt; " ms\n";
  command_queue = clCreateCommandQueue(context, device_id, CL_QUEUE_PROFILING_ENABLE, &amp;ret);
  </code></pre>