Molecular dynamics simulations are one of the methods in scientific computing that benefit from GPU acceleration. For those devices, SYCL is a promising API for writing portable codes. In this paper, we present the case study of "HAL's MD package" that has been successfully migrated from CUDA to SYCL. We describe the different strategies that we followed in the process of porting the code. Following these strategies, we achieved code portability across major GPU vendors. Depending on the actual kernels, both significant performance improvements and regressions are observed. As a side effect of the migration process, we obtained impressing speedups also for execution on CPUs.
翻译:分子动力学模拟是科学计算中能够受益于GPU加速的方法之一。对于这些设备而言,SYCL是一种用于编写可移植代码的前沿API。本文通过"HAL分子动力学软件包"的案例研究,展示了从CUDA成功迁移至SYCL的过程。我们详细阐述了在代码移植过程中采用的不同策略。通过这些策略,我们实现了在主流GPU厂商间的代码可移植性。根据实际计算内核的不同,我们既观察到显著的性能提升,也注意到部分性能回退现象。作为迁移过程的附加成果,我们在CPU执行方面也获得了令人瞩目的加速效果。