CUDALink is properly installed and up to date, all built-in functions work fine, and all little functions I did worked fine... Until I tried using shared memory. The only example I found on the help doesn't work for more than one reason. It declares the memory without a type and my compiler complains. So that's a bad start. Anyway, I'm trying the most basic function I can, and I can't make it work.
I would appreciate if anyone could tell me what's wrong, or if it works (or doesn't) for you, or give me an example that does work... Sample code I'm trying
testf = CUDAFunctionLoad["__global__ void test(int* out)
{
extern __shared__ int smem[];
if(threadIdx.x==0)
{
smem[threadIdx.x]=7;
out[threadIdx.x]=3;
}else
out[threadIdx.x]=33;
}", "test", {{_Integer, "Output"}}, 16];
When I run it I get a CUDAFunction::internal: CUDALink
experienced an internal error. >> and then I need to restart the kernel to make CUDALink
work again
testf[Range[16], 16]
Just commenting out the line with the smem[threadIdx.x]=7
assignment makes it work. The compiler issues no warnings