Needs["CUDALink`"]
gausvSource = "
#include <curand_kernel.h>
__global__ void gausv( float *out )
{
curandState_t curand_state;
curand_init ( 0, 0, 0, &curand_state );
*out = curand_normal( &curand_state );
}";
CUDAFunctionLoad[gausvSource, "gausv", {{"Float", _, "Output"}}, 256]
yields a series of errors like:
curand_kernel.h(558): error: this declaration may not have extern "C" linkage
Wrapping the include, the function, or the whole thing in extern "C" { }
changes the message to:
CUDALink encountered an invalid program.
So, how does one correctly use library code with CUDALink
?