You can change the global random number stream on the GPU and store
the old settings for the global stream. First, define the random number stream that you
want to set as the new global stream.
newStr =
Philox4x32_10 random stream on the GPU
Seed: 1
NormalTransform: Inversion
Next, set this new stream to be the global stream.
oldStr =
Threefry4x64_20 random stream on the GPU
Seed: 0
NormalTransform: BoxMuller
oldStr
holds the settings for the previous global random number
stream on the GPU. The new global stream is
newStr
.
newStr =
Philox4x32_10 random stream on the GPU (current global stream)
Seed: 1
NormalTransform: Inversion
On
a GPU, the functions
rand
,
randi
, and
randn
draw random numbers from the new
global stream using the
'Philox'
generator algorithm.