Generating random numbers: CPU vs GPU, which currently wins?

半腔热情 提交于 2019-12-01 04:28:54

Some comparisons can be found here: https://developer.nvidia.com/cuRAND

If you have a new enough Intel CPU (IvyBridge or newer), you can use the RDRAND instruction.

This can be used via the _rdrand16_step(), _rdrand32_step() and _rdrand64_step() intrinsic functions.

Available via VS2012/13, Intel compiler and gcc.

The generated random number is originally seeded on a real random number. Designed for NIST SP 800-90A compliance, its randomness is very high.

Some numbers for reference:

On an IvyBridge dual core laptop with HT (2.3GHz), 2^32 (4 Gigs) random 32bit numbers took 5.7 seconds for single thread and 1.7 seconds with OpenMP.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!