Abstract
We present a library of 22 pseudo-random number generators on the GPU. The library is implemented in OpenCL and all generators are tested using the TestU01 and PractRand libraries. We evaluated the efficiency of all generators on five different computing devices. Among the generators that pass all tests, Tyche-i was the fastest on most devices and on average. Tyche-i and several other generators from our library can be used to generate random numbers several times faster than generators from existing libraries.
Similar content being viewed by others
References
Brent RP (2004) Note on Marsaglia’s xorshift random number generators. J Stat Softw 11(5):1–4
Demchik V (2014) Pseudorandom numbers generation for Monte Carlo simulations on GPUs: OpenCL approach. In: Numerical computations with GPUs, Springer, pp 245–271
Doty-Humphrey C (2018) PractRand: C++ library of pseudo-random number generators and statistical tests for RNGs. http://pracrand.sourceforge.net/PractRand.txt. Accessed 20 Dec 2018
Goresky M, Klapper A (2003) Efficient multiply-with-carry random number generators with maximal period. ACM Trans Model Comput Simul 13(4):310–321
Jenkins RJ (1996) ISAAC. In: Gollmann D (ed) International workshop on fast software encryption. Springer, Berlin, pp 41–49
L’Ecuyer P (1999) Good parameters and implementations for combined multiple recursive random number generators. Oper Res 47(1):159–164
L’Ecuyer P (1999) Tables of linear congruential generators of different sizes and good lattice structure. Math Comput Am Math Soc 68(225):249–260
L’Ecuyer P, Simard R (2007) TestU01: A C library for empirical testing of random number generators. ACM Trans Math Softw 33(4):22
L’Ecuyer P, Touzin R (2000) Fast combined multiple recursive generators with multipliers of the form a=\(\pm \)2 q\(\pm \)2 r. In: Joines JA, Barton RR, Kang K, Fishwick PA (eds) Proceedings of the 32nd Conference on Winter Simulation, Society for Computer Simulation International, pp 683–689
L’Ecuyer P, Munger D, Kemerchou N (2015) clRNG: A random number API with multiple streams for OpenCL. Report. http://www.iro.umontreal.ca/~lecuyer/myftp/papers/clrng-api.pdf. Accessed 20 Sept 2018
L’Ecuyer P, Munger D, Oreshkin B, Simard R (2017) Random numbers for parallel computers: requirements and methods, with emphasis on GPUs. Math Comput Simul 135:3–17
Manssen M, Weigel M, Hartmann AK (2012) Random number generators for massively parallel simulations on GPU. Eur Phys J Spec Top 210(1):53–71
Marsaglia G (1999) Random numbers for C: End, at last?. http://www.cse.yorku.ca/~oz/marsaglia-rng.html. Accessed 20 Sept 2018
Marsaglia G (2003) Xorshift RNGs. J Stat Softw 8(14):1–6
Marsaglia G (2009) 64-bit KISS RNGs. https://www.thecodingforums.com/threads/64-bit-kiss-rngs.673657. Accessed 20 Sept 2018
Marsaglia G, Tsay LH (1985) Matrices and the structure of random number sequences. Linear Algebra Appl 67:147–156
Matsumoto M, Nishimura T (1998) Mersenne Twister: a 623-dimensionally equidistributed uniform pseudo-random number generator. ACM Trans Model Comput Simul 8(1):3–30
Matsumoto M, Nishimura T (2011) Tiny Mersenne twister. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/TINYMT/index.html. Accessed 20 Sept 2018
Neves S, Araujo F (2011) Fast and small nonlinear pseudorandom number generators for computer simulation. In: Wyrzykowski R, Dongarra J, Karczewski K, Waśniewski J (eds) International Conference on Parallel Processing and Applied Mathematics, Springer, pp 92–101
Nikolaisen IU (2011) Bose-einstein condensation in trapped bosons: a quantum monte carlo analysis using OpenCL and GPU programming. Master’s thesis
O’Neill ME (2014) PCG: a family of simple fast space-efficient statistically good algorithms for random number generation. ACM Transactions on Mathematical Software
Panneton F, L’ecuyer P, Matsumoto M (2006) Improved long-period generators based on linear recurrences modulo 2. ACM Trans Math Softw 32(1):1–16
Press WH, Teukolsky SA, Vetterling WT, Flannery BP (1992) Numerical recipes in C: Plee art of scientific computing. Cambridge
Salmon JK, Moraes MA, Dror RO, Shaw DE (2011) Parallel random numbers: as easy as 1, 2, 3. In: Lathrop S, Costa J, Kramer W (eds) 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC), IEEE, pp 1–12
Scarpino M (2011) OpenCL in action. Manning Publications, Westampton
Stone JE, Gohara D, Shi G (2010) OpenCL: a parallel programming standard for heterogeneous computing systems. Comput Sci Eng 12(3):66–73
Thomas DB (2014) The mwc64x random number generator. http://cas.ee.ic.ac.uk/people/dt10/research/rngs-gpu-mwc64x.html. Accessed 23 Dec 2018
Vigna S (2016) An experimental exploration of Marsaglia’s xorshift generators, scrambled. ACM Trans Math Softw 42(4):30
Widynski B (2017) Middle square Weyl sequence RNG. arXiv preprint arXiv:170400358
Acknowledgements
Our research was partially supported by the Slovenian Research Agency (ARRS project grant L1-7542 and research core funding P5-0410).
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Ciglarič, T., Češnovar, R. & Štrumbelj, E. An OpenCL library for parallel random number generators. J Supercomput 75, 3866–3881 (2019). https://doi.org/10.1007/s11227-019-02756-2
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11227-019-02756-2