Random123

Random123 is a library of "counter-based" random number generators (CBRNGs), in which the Nth random number can be obtained by applying a stateless mixing function to N instead of the conventional approach of using N iterations of a stateful transformation. CBRNGs were originally developed for use in MD applications on Anton, but they are ideal for a wide range of applications on modern multi-core CPUs, GPUs, clusters, and special-purpose hardware. Three families of non-cryptographic CBRNGs are described in our paper, Parallel Random Numbers: As Easy as 1, 2, 3 which was awarded the Best Paper at the SC11 conference: ARS (based on the Advanced Encryption System (AES)), Threefry (based on the Threefish encryption function), and Philox (based on integer multiplication). They all satisfy rigorous statistical testing (passing BigCrush in TestU01), vectorize and parallelize well (each generator can produce at least 264 independent streams), have long periods (the period of each stream is at least 2128), require little or no memory or state, and have excellent performance (a few clock cycles per byte of random output). The Random123 library can be used with CPU (C and C++) and GPU (CUDA and OpenCL) applications.

The link above is to an archival copy of the paper at the ACM Digital Library. It should not require a subscription or payment. If that link doesn't work for you, then use this link instead.

Random123 is available without cost for both non-commercial and commercial use subject to the license.

Download the latest source code.

Browse the documentation.

Older releases are here.