Speed up random number generation in MATLAB

后端 未结 3 1866
离开以前
离开以前 2021-01-15 06:15

Is there any way to generate pseudo-random numbers to less precision and thus speed the process up?

Another thing is that I know it saves time if random numbers are

3条回答
  •  盖世英雄少女心
    2021-01-15 06:27

    If you have a CUDA-capable GPU, you can do random number generation on it, as it's supposed to be much faster... Specifically Philox4x32-10:

    parallel.gpu.rng(0, 'Philox4x32-10');
    R = gpuArray.rand(sZ,'single'); % run this for more info: doc('gpuArray/rand')
    

提交回复
热议问题