使用带有GPU的随机数 [英] Using random numbers with GPUs

查看:153
本文介绍了使用带有GPU的随机数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用蒙特卡罗模拟的NVIDIA GPU调查。不过,我想用GSL随机数生成器,也是一个并行随机数发生器,如SPRNG。有谁知道这是否可能?

I'm investigating using nvidia GPUs for Monte-Carlo simulations. However, I would like to use the gsl random number generators and also a parallel random number generator such as SPRNG. Does anyone know if this is possible?

更新

我打得关于使用GPU的RNG。在present还没有一个很好的解决方案。该SDK附带的梅森倍捻机是不是真的适合(我的)蒙特卡罗模拟,因为它需要一个非常长的时间来产生种子。

I've played about with RNG using GPUs. At present there isn't a nice solution. The Mersenne Twister that comes with the SDK isn't really suitable for (my) Monte-Carlo simulations since it takes an incredibly long time to generate seeds.

NAG算法库是更有前途。您可以生成或者分批或单个线程注册护士。但是,只有少数分布,目前支持 - 一致,指数和正常

The NAG libraries are more promising. You can generate RNs either in batches or in individual threads. However, only a few distributions are currently supported - Uniform, exponential and Normal.

推荐答案

在GSL手册的建议梅森倍捻机

梅森倍捻机作者有一个的版本的NVIDIA GPU 。我看着这个移植到R包 gputools 却发现我需要过大的数量平(百万,我认为)的组合前'的GPU产生并提供给R'比(仅使用CPU)中的R只是画得更快。

The Mersenne Twister authors have a version for Nvidia GPUs. I looked into porting this to the R package gputools but found that I needed excessively large number of draws (millions, I think) before the combination of 'generate of GPU and make available to R' was faster than just drawing in R (using only the CPU).

这真的是一个计算/通信权衡。

It really is a computation / communication tradeoff.

这篇关于使用带有GPU的随机数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆