Questions tagged [curand]

13 questions
2
votes
2 answers

CUDA's Mersenne Twister for an arbitrary number of threads

CUDA's implementation of the Mersenne Twister (MT) random number generator is limited to a maximal number of threads/blocks of 256 and 200 blocks/grid, i.e. the maximal number of threads is 51200. Therefore, it is not possible to launch the kernel…
PhillipD
  • 1,797
  • 1
  • 13
  • 23
1
vote
1 answer

Giving back the shared memory curand state to global causes weird random numbers

I'm trying to code in CUDA C++ with cuRAND. I almost got what I want, except that I get weird outputs when I update the global cuRAND state from the shared memory one. If I remove that update, everything is working as expected (e.g. I get numbers…
JanS
  • 13
  • 4
1
vote
1 answer

PyCUDA illegal memory access of curandState*

I'm studying the spread of an invasive species and am trying to generate random numbers within a PyCUDA kernel using the XORWOW random number generator. The matrices I need to be able to use as input in the study are quite large (up to 8,000 x…
Tyler Buresh
  • 11
  • 2
  • 4
1
vote
1 answer

The type of random number generator in cuRAND kernels

A typical example of random number generation in CUDA or pyCUDA is reported in the question How to generate random number inside pyCUDA kernel?, namely #include const int nstates = %(NGENERATORS)s; __device__ curandState_t*…
Vitality
  • 20,705
  • 4
  • 108
  • 146
0
votes
1 answer

Managing multiple cuRAND sequences between threads and blocks

I'm trying to generate 32 64x64 bitmaps with a single CUDA kernel call. When rendering these images, I want to randomize the parameters of image generation both per-image and per-pixel. That is, some randomized decisions happen once and apply…
0
votes
1 answer

generate independent arrays of random numbers with cuda

I need to generate many random numbers. I have found a lot of documentation on how to generate one array of random numbers. But, I need to generate 4 independent arrays of random numbers. For example, generate independently the components of a…
Lily
  • 3
  • 3
0
votes
1 answer

Is it possible to generate uint64_t random numbers on GPU?

I am trying to port finite field CPU code over GPU and in the process, I would like to generate random vectors to test the speed of my functions. I need two random vectors of uint64_t (and the corresponding two vectors of double, with float…
Dimitri Lesnoff
  • 317
  • 1
  • 14
0
votes
0 answers

Why does my code fail when calling curand too many times?

The Monte-Carlo code below fails ("process exited with code -2147483645", the output of the price function does not get printed) when I increase numPaths to 1000000, unless I decrease numSteps at the same time. If I remove all references to curand…
Frimousse
  • 31
  • 4
0
votes
1 answer

terminate called after throwing an instance of 'thrust::system::system_error' what(): parallel_for failed: cudaErrorInvalidValue: invalid argument

I am trying to count the number of times curand_uniform() returns 1.0. However i cant seem to get the following code to work for me: #include #include #include #include #include…
Achnos
  • 83
  • 8
0
votes
1 answer

Does order of memory allocation matter in PyCUDA's curandom?

I use PyCUDA's interface [1] over CUDA Unified Memory [2]. At some point I added random number generators [3] and stared to see dead kernels in Jupyter Notebook: I narrowed the problem down to the creation of random number generator. Or, to be…
alex
  • 10,900
  • 15
  • 70
  • 100
0
votes
1 answer

cuRAND performs much worse than thrust when generating random numbers inside CUDA kernels

I am trying to generate "random" numbers from a uniform distribution inside a CUDA __global__ kernel using two different approaches. The first is using the cuRAND device API, and the second is using thrust. For each approach I have created a…
AstrOne
  • 3,569
  • 7
  • 32
  • 54
0
votes
1 answer

How to initialize and run Mersenne Twister Random Generator inside kernels in PyCuda

I wanted to use Mersenne Twister random generator inside pyCuda kernels for numerical experiment. Via Internet I found no simple examples of how to do it, so, I tried to construct something from Cuda documentation and pyCuda examples (pyCuda code…
0
votes
0 answers

ManagedCuda kernel cannot find curand.h

I'm trying to use ManagedCuda to compile a kernel that uses the currand library. However, I cannot find a way to tell the CudaRuntimeCompiler how to find curand.h. If I remove the '#include ' line, everything works. However with it I…
BJury
  • 2,526
  • 3
  • 16
  • 27