YOUR AD GOES HERE

GpuScript Rand Tutorial 09 Init on Gpu

Published 20, Dec 2024

GpuScript


Description:
Initialize the random numbers on the GPU

Initializing random numbers on the GPU can be tricky, to make sure the random numbers are uncorrelated, as stated here:

https://developer.nvidia.com/gpugems/gpugems3/part-vi-gpu-computing/chapter-37-efficient-random-number-generation-and-application
"Each thread should receive a different set of four state values, which should be uncorrelated and for convenience can be supplied using a CPU-side random number generator."

"Uncorrelated" means that the current random number at randomNumbers[i] should not be the same as the previous random number at randomNumbers[i-1].

However, what good is a GPU random number generator if we have to wait for the CPU to generate 120 million random numbers before we can use it?

This tutorial goes beyond the NVidia Gpu Gems paper and shows how to initialize the random number generator on the GPU using only 4 random numbers generated on the CPU.

Releted More Videos

You May Also Like

YOUR AD GOES HERE

YOUR AD GOES HERE