Hey,
I am stumbling across some weird SIGSEGV occuring within libcuda.so, when passing NULL memory buffers to a kernel. Here is the exemplary kernel:
__kernel void test(
__global unsigned int * data,
__global unsigned int * flag) {
int gid = get_global_id(0);
if (flag)
data[gid] = 4;
else
data[gid] = 2;
}
Now, if I run the following code:
// allocate buffer object
// allocate kernel object
clSetKernelArg(kernel, 0, sizeof(cl_mem), &buffer);
clSetKernelArg(kernel, 1, sizeof(cl_mem), &buffer);
// schedule kernel
// wait on queue
}
everything works fine. However, when I try to pass a NULL cl_mem object:
// allocate buffer object
// allocate kernel object
clSetKernelArg(kernel, 0, sizeof(cl_mem), &buffer);
cl_mem null_buffer = NULL;
clSetKernelArg(kernel, 1, sizeof(cl_mem), &null_buffer);
// schedule kernel
// wait on queue
}
I am getting a SIGSEGV from libcuda.so on the call to clFinish(…).
I am using the latest 280.13 driver on a 64bit Scientific Linux, running on a GTX 460. This example should run according to the OpenCL 1.1 Specification - and I have run it successfully on prior driver versions. Can someone reproduce this, or am I mising something here?
Thanks
Max