Efficient 3D stencil computations using CUDA

被引:26
作者
Krotkiewski, Marcin [1 ]
Dabrowski, Marcin [1 ]
机构
[1] Univ Oslo, N-0316 Oslo, Norway
关键词
Stencil computation; 3D convolution; Memory bandwidth optimization; Multigrid; CUDA; LINEAR ALGEBRA;
D O I
10.1016/j.parco.2013.08.002
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
We present an efficient implementation of 7-point and 27-point stencils on high-end Nvidia GPUs. A new method of reading the data from the global memory to the shared memory of thread blocks is developed. The method avoids conditional statements and requires only two coalesced instructions to load the tile data with the halo (ghost zone). Additional optimizations include storing only one XY tile of data at a time in the shared memory to lower shared memory requirements, common subexpression elimination to reduce the number of instructions, and software prefetching to overlap arithmetic and memory instructions, and enhance latency hiding. The efficiency of our implementation is analyzed using a simple stencil memory footprint model that takes into account the actual halo overhead due to the minimum memory transaction size on the GPUs. Through experiments we demonstrate that in our implementation the memory overhead due to the halos is largely eliminated by good reuse of the halo data in the memory caches, and that our method of reading the data is close to optimal in terms of memory bandwidth usage. Detailed performance analysis for single precision stencil computations, and performance results for single and double precision arithmetic on two Testa cards are presented. Our stencil implementations are more efficient than any other implementation described in the literature to date. On Tesla C2050 with single and double precision arithmetic our 7-point stencil achieves an average throughput of 12.3 and 6.5 Gpts/s, respectively (98 GFLOP/s and 52 GFLOP/s, respectively). The symmetric 27-point stencil sustains a throughput of 10.9 and 5.8 Gpts/s, respectively. (C) 2013 Elsevier B.V. All rights reserved.
引用
收藏
页码:533 / 548
页数:16
相关论文
共 25 条
[1]  
[Anonymous], 2012, P 26 ACM INT C SUPER, DOI [DOI 10.1145/2304576.2304619, 10.1145/2304576.2304619]
[2]  
[Anonymous], 2009, P 2 WORKSHOP GEN PUR
[3]  
Bell N, 2009, STUDENTS GUIDE TO THE MA TESOL, P1
[4]  
Bergman K., 2008, COMPUTING STUDY TECH
[5]  
Christen M., 2011, Proceedings of the 25th IEEE International Parallel & Distributed Processing Symposium (IPDPS 2011), P676, DOI 10.1109/IPDPS.2011.70
[6]  
Cohen J.M., 21 INT C PAR COMP FL
[7]  
CUFFT CUDA CUFF Library, 2010, TECHNICAL REPORT
[8]  
Datta K., P IWAPT2009 4 INT WO
[9]  
Datta K., 2008, P 2008 ACM IEEE C SU, P4
[10]  
Howes L., 2010, GPU GEMS, V3