nice source of errors
For exampe if first call place contains all arguments but second one omitted last one (commented in example) no eror on kernel call generated, but kernel produces invalid results of course.
Is it intended no to check number of arguments and possibly reuse old ones ?
err = clSetKernelArg(GPU_compare_with_threshold_kernel_cl,0,sizeof(cl_uint),(void *)&max_per_int4); err |= clSetKernelArg(GPU_compare_with_threshold_kernel_cl,1,sizeof(cl_mem),(void *)&gpu_temp_coadd); err |= clSetKernelArg(GPU_compare_with_threshold_kernel_cl,2,sizeof(cl_mem),(void *)&gpu_thresh_tbl); err |= clSetKernelArg(GPU_compare_with_threshold_kernel_cl,3,sizeof(cl_int),(void *)&ttidx); err |= clSetKernelArg(GPU_compare_with_threshold_kernel_cl,4,sizeof(cl_mem),(void *)&gpu_need_CPU_compare_int); // err |= clSetKernelArg(GPU_compare_with_threshold_kernel_cl,5,sizeof(cl_uint),(void *)&stride); if(err != CL_SUCCESS)fprintf(stderr,"ERROR: Setting kernel argument: GPU_compare_with_threshold_kernel_cl: %d\n",err);