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中的随机数生成器也能保证并行样本的独立性。该包具有可移植性和灵活性,开发者可将其随机数生成内核用于其他多种目的和应用。