Find in Library
Search millions of books, articles, and more
Indexed Open Access Databases
Influence of data amount, data type and implementation packages in GPU coding
oleh: Peng Xu, Ming-Yan Sun, Yin-Jun Gao, Tai-Jiao Du, Jin-Ming Hu, Jun-Jie Zhang
Format: | Article |
---|---|
Diterbitkan: | Elsevier 2022-12-01 |
Deskripsi
Graphic Processing Units (GPUs) are becoming popular in computational physics. Seeing the increasing trend of using GPUs in the physics community, we provide a comparison of the two major packages Numba and CuPy for GPU coding in Python language. We have discussed the influence of the data amount and data type on the performance of the GPU code. The data transferring time from GPU to CPU and its influence on the total execution time has also been analyzed. We find that when the grid numbers reaches 107, Numba will be faster than CuPy. Meanwhile, there is no noticeable difference in the data transmission speed between Numba and CuPy. Setting the data types as single-precision in Numba programs can improve the computation time by at least 20%.