Chapter 10: Finite difference method

Abstract

This case study discusses how a finite-difference code using a large one-dimensional stencil is optimized on a three-dimensional mesh. Achieving good performance requires maximizing data reuse through use of shared memory. Attention is paid to coalescing global memory accesses for derivatives in all directions and using constant memory effectively.

Keywords

Coalescing; Nonuniform mesh; 1D stencil; Instruction-level parallelism

In many fields of science and engineering, the governing system of equations takes the form of either ordinary or partial differential equations. One method of solving these equations is using finite differences, where the continuous analytical derivatives are approximated at each ...

Get CUDA Fortran for Scientists and Engineers, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.