title: segmentation fault at clBuildProgram
body: <p>I'm facing the message of "Segmentation fault" at clBuildProgram when I run my opencl program. There is no error message during compilation this program, but can see the "segmentation fault" when I run it. I summarized Opencl APIs as following. Is there any mistake on my code?</p>
  
  <pre><code>clGetPlatformIDs(1, &amp;platform, &amp;num_platforms);
  status = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &amp;device, &amp;num_devices);
  cl_context context = clCreateContext(NULL, 1, &amp;device, NULL, NULL, NULL);
  queue = clCreateCommandQueue( context, device, 0, NULL);
  cl_program program = clCreateProgramWithSource( context,1,&amp;str,NULL, NULL);
  cl_int result = clBuildProgram(program, 1, &amp;device, NULL, NULL, NULL);
  </code></pre>
  
  <p>I also tried to run as following, but can see the same problem.</p>
  
  <pre><code>cl_int result = clBuildProgram(program, 0, NULL, NULL, NULL, NULL);
  </code></pre>
  
  <p>BTW, I'm using the environment of the Linux Ubuntu 10.04 64bit, and NVIDIA GeForce GT 330 for GPGPU.</p>
  
  <p>*EDIT for adding question : The definition of 3rd argument from clBuildProgram is "device list", so I think the "&amp;device" is right. Is it right? If I am wrong, what is the exact meaning of "device list"?</p>