title: OpenCL/CPU. Test whether the OpenCL framework is available
body: <p>I'm working on a hybrid OpenCL application that has to decide at run time whether to use or not to use the GPU implementation. </p>
  
  <p>Is there a cross platform (i.e. for intel, nvidia, and ati) way to dermine, whether the computer, where the application is running, has the opencl framework support, without crashing of the application? At the beginning I am only developing for the Windows platform.</p>
  
  <pre><code>#include &lt;CL/cl.h&gt;
  #include &lt;iostream&gt;
  
  int main() 
  {
      std::cout &lt;&lt; "Start cross paltform testing" &lt;&lt; std::endl;
      cl_platform_id platform[1];
      clGetPlatformIDs(1, platform, 0);
      std::cout &lt;&lt; "End cross paltform testing" &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p>At the moment I get the error: </p>
  
  <pre><code>The application was unable to start correctly (0xc000007b)...
  </code></pre>
  
  <p>if I try to start it in the situation that I described above.</p>
  
  <p>NB:
  Actually, at least for the nvidia it should be possible. I have tested oclDeviceQuery from the nvidia GPU SDK in this scenario and it works correctly. It is only necessary to copy the "opencl.dll" form Windows/System folder into the application folder. I have no idea why my app is crashing under the same circumstances.</p>
  
  <p>Thank you in advance.</p>