We introduce the R package clrng which leverages the gpuR package and is able to generate random numbers in parallel on a Graphics Processing Unit (GPU) with the clRNG (OpenCL) library. Parallel processing with GPU's can speed up computationally intensive tasks, which when combined with R, it can largely improve R's downsides in terms of slow speed, memory usage and computation mode. clrng enables reproducible research by setting random initial seeds for streams on GPU and CPU, and can thus accelerate several types of statistical simulation and modelling. The random number generator in clrng guarantees independent parallel samples even when R is used interactively in an ad-hoc manner, with sessions being interrupted and restored. This package is portable and flexible, developers can use its random number generation kernel for various other purposes and applications.
翻译:我们介绍了R包clrng,该包基于gpuR包,能够通过clRNG(OpenCL)库在图形处理器(GPU)上并行生成随机数。利用GPU进行并行处理可以加速计算密集型任务,与R结合使用时,可显著改善R在运算速度慢、内存占用大和计算模式单一方面的不足。clrng通过为GPU和CPU上的数据流设置随机初始种子,确保了研究的可重复性,从而可加速多种统计模拟和建模过程。即使在R以临时交互方式使用且会话被中断和恢复的情况下,clrng中的随机数生成器也能保证独立并行的样本输出。该包具有可移植性和灵活性,开发者可将其随机数生成内核用于其他多种目的和应用。