this is my first time to use curand libs, I find that the help doc give an example for CURAND_RNG_PSEUDO_DEFAULT option.
but when I change it to CURAND_RNG_QUASI_SOBOL32, error appeared. below is my code:
error happened in calling “curandGenerate”, any suggestions?
size_t n = number;
size_t i;
curandGenerator_t gen;
uint *devData, *hostData;
/* Allocate n floats on host */
hostData = (uint *)calloc(n, sizeof(uint));
/* Allocate n floats on device */
CUDA_CALL(cudaMalloc((void **)&devData, n*sizeof(uint)));
/* Create pseudo-random number generator */
//CURAND_CALL(curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT));
CURAND_CALL(curandCreateGenerator(&gen, CURAND_RNG_QUASI_SOBOL32));
/* Set seed */
//CURAND_CALL(curandSetPseudoRandomGeneratorSeed(gen, 1234ULL));
CURAND_CALL(curandSetQuasiRandomGeneratorDimensions(gen, 10));
/* Generate n int on device */
CURAND_CALL(curandGenerate(gen, devData, n));
/* Copy device memory to host */
CUDA_CALL(cudaMemcpy(hostData, devData, n * sizeof(uint), cudaMemcpyDeviceToHost));
/* Show result */
for(i = 0; i < n; i++) {
printf("%u, ", (hostData[i]));
randArray.push_back(hostData[i]);
}
printf("\n");