I used Mathematica/wolfram 12.1 IDE and installed CUDA toolkit 10.2. All installed correct. I try to use library CURAND with #include with random integer generator on CUDA, but get a error:
Message[CUDAFunctionLoad::cmperr, "PATH_CUDA_TOOLKIT/.../include\\curand_kernel.h: \ error: this declaration may not have extern \"C\" linkage"]
What is wrong, with my code?
secondKernelCode = "
#include<curand_kernel.h> // problem here !!!
// my kernel
__device__ float f(float x) {
return tanf(x);
}
__global__ void secondKernel(float * a, float * b, float * c, float* d, mint nIterations) {
int index = threadIdx.x + blockIdx.x * blockDim.x;
//....
}";
secondKernel = CUDAFunctionLoad[secondKernelCode, "secondKernel", {{"Float"}, {"Float"}, {"Float"}, {"Float"}, _Integer}, 16]