NAG Numerical Routines for GPUs

NAG has been at the forefront of numerical algorithm provision for nearly four decades and during that time has delivered algorithms in many different guises addressing numerous application areas. One area where NAG is currently collaborating with Oxford University Professor Mike Giles, is the provision of routines optimized for Graphics Processing Units (GPUs).

GPUs have traditionally been used to accelerate 3D computer games, but as these games have become more and more demanding, GPUs have evolved into powerful accelerators capable of general purpose scientific computations. This type of computing has been termed ‘personal supercomputing’ (PSC).

The collaborative research undertaken by Professor Giles and NAG experts has resulted in a suite of GPU routines targeted at financial applications.  The suite contains high performance, parallelized GPU kernels which give significant performance gains compared to traditional CPU systems.  It also contains "inline" GPU device function random number generators.

Numerical Routines for GPUs Overview

The suite contains the following components:

  • The MRG32k3a pseudorandom number generator (L'Ecuyer) with streams and substreams
  • The MT19937 pseudorandom number generator (Matsumoto, Nishimura) with streams and substreams
  • A Sobol generator in up to 50,000 dimensions with digital scrambling (Hickernell)
  • Uniform, Exponential, Normal and Gamma distributions in single and double precision
  • GPU device function MRG and Sobol generators which can be embedded in users' GPU kernels
  • A Brownian bridge constructor for up to 8 dimensional Brownian motions
  • A high-performance Brownian bridge constructor for up to 4 dimensional Brownian motions
  • Cholesky factorization and LU decomposition for double precision matrices resident on the GPU
  • User-configurable performance tuning and full error handling

How can I gain access to NAG Numerical Routines for GPUs?

To obtain a copy of the software please complete the online registration of interest form here or contact us directly for more information. Software is available for evaluation under a collaborative licence for proof of concept usage and is delivered for production usage via our consulting services licence.


NAG is engaged with commercial clients for feedback about these routines and further development of numerical routines for GPUs. The routines are also available to academics subject to a collaborative agreement.

Ongoing work

NAG is continuing to develop further routines for GPUs. Future content includes linear algebra (LAPACK), PDE solvers, fat-tailed distributions, univariate and multi-variate distributions, and copulas amongst others.

A joint article describing aspects of the GPU implementations is also available (published in NVIDIA's GPU Computing Gems).


We would like to thank the Technology Strategy Board (TSB) and the Smith Institute for their support in sponsoring this project and EPSRC for supporting Professor Giles’ academic research