ドキュメンテーションサポート
GPU のグローバル乱数ストリームを設定
prevStream = parallel.gpu.RandStream.setGlobalStream(stream)
例
prevStream = parallel.gpu.RandStream.setGlobalStream(stream) は、グローバル乱数ストリームを stream で指定されたストリームに置き換えます。
prevStream
stream
すべて折りたたむ
GPU のグローバル乱数ストリームを変更し、グローバル ストリームの変更前の設定を保存できます。まず、新しいグローバル ストリームとして設定する乱数ストリームを定義します。
newStr = parallel.gpu.RandStream('Philox','Seed',1,'NormalTransform','Inversion')
newStr = Philox4x32_10 random stream on the GPU Seed: 1 NormalTransform: Inversion
次に、この新しいストリームをグローバル ストリームとして設定します。
oldStr = parallel.gpu.RandStream.setGlobalStream(newStr)
oldStr = Threefry4x64_20 random stream on the GPU Seed: 0 NormalTransform: BoxMuller
oldStr は、GPU のグローバル乱数ストリームの直前の設定を保持します。新しいグローバル ストリームは newStr です。
oldStr
newStr
newStr = Philox4x32_10 random stream on the GPU (current global stream) Seed: 1 NormalTransform: Inversion
rand
randi
randn
'Philox'
parallel.gpu.RandStream
GPU の新しいグローバル乱数ストリーム。parallel.gpu.RandStream オブジェクトとして指定します。stream によって直前のグローバル ストリームが置き換えられます。
GPU の直前のグローバル乱数ストリーム。parallel.gpu.RandStream として指定します。
gpurng | parallel.gpu.RandStream | parallel.gpu.RandStream.create | parallel.gpu.RandStream.getGlobalStream
gpurng
parallel.gpu.RandStream.create
parallel.gpu.RandStream.getGlobalStream
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office
無料評価版のダウンロード