I am developing OpenCL code to run my application simultaneously on multiple platforms. For testing purpose I am using only one platform (AMD APP) with Cayman device (dual gpu card) and OpenCL 1.2 version.
While developing, I am getting segmentation fault in the following bold line:

Code :
maxSize = 3;
blockSize = 64;
for(icount = 0; icount < numDevices; icount++)
          //printf("Initializing Memory Buffer on device : %s\n", device_name[icount]);
          start_itr = (icount * maxSize);
          end_itr = start_itr + (maxSize -1);
      [b]clret = clEnqueueWriteBuffer(queue[icount], d_new_input_2d[icount], CL_TRUE, 0, maxSize * blockSize * sizeof(char), &hNewInputPerBlock[(start_itr * blockSize)], 0, NULL, NULL);[/b]

As I think, each OpenCL API's routines return error number if there is any mistake in its parameters. So what could be reason for segmentation fault in these routines ?

Thanks !