Linear-time algorithms that are traditionally used to shuffle data on CPUs, such as the method of Fisher-Yates, are not well suited to implementation on GPUs due to inherent sequential dependencies. Moreover, existing parallel shuffling algorithms show unsatisfactory performance on GPU architectures because they incur a large number of read/write operations to high latency global memory. To address this, we provide a method of generating pseudo-random permutations in parallel by fusing suitable pseudo-random bijective functions with stream compaction operations. Our algorithm, termed `bijective shuffle' trades increased per-thread arithmetic operations for reduced global memory transactions. It is work-efficient, deterministic, and only requires a single global memory read and write per shuffle input, thus maximising use of global memory bandwidth. To empirically demonstrate the correctness of the algorithm, we develop a consistent, linear time, statistical test for the quality of pseudo-random permutations based on kernel space embeddings. Empirical results show that the bijective shuffle algorithm outperforms competing algorithms on multicore CPUs and GPUs, showing improvements of between one and two orders of magnitude and approaching peak device bandwidth.
翻译:传统上用于打乱CPU数据的线性算法,例如Fisher-Yates方法,由于固有的相继依附性,并不适合在GPU上实施。此外,现有的平行打乱算法在GPU结构中表现不尽人意,因为GPU结构中产生了大量的读/写操作,可以达到高延缓度全球记忆。为了解决这个问题,我们提供了一种方法,通过在流压操作中使用适当的假随机双向函数来生成假随机变异。我们的算法,称为“弹性打乱”交易,增加了用于减少全球内存交易的单读计算操作。它具有工作效率,具有确定性,只需要单项全球内存读写一次,从而最大限度地使用全球内存带宽度。为了以实验方式证明算法的正确性,我们开发了一个一致的线性时间,用于根据内嵌空间嵌成的假随机调整质量的统计测试。 Enprialalalal 结果表明, 双导式平流平流平级平级和两等级级级级级级之间, 的双级平级平级平级平级平级平级平级平级的平级的平级平级平等。