O'Reilly logo

CUDA Fortran for Scientists and Engineers by Massimiliano Fatica, Gregory Ruetsch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6

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

Constant memory; 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 to use finite differences, where the continuous analytical derivatives are approximated ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required