Roadmap: OpenMP Offload to GPUs
Besides offering thread parallelism on the CPU, OpenMP added support for offloading to GPU devices in version 4.0. With the target directive, you can make use of powerful constructs to parallelize C/C++/Fortran code for GPUs while maintaining portability. In this topic, we will cover various data mapping and parallelization directives on the device, as well as asynchronous data transfers.
Objectives
After you complete this roadmap, you should be able to:
- Offload computation to GPUs with the
targetdirective - Control data transfer between host and device with the
mapclause - Parallelize work on the device with
teams,distribute, andloop - Manage data persistence across regions with
target data - Compile functions for the device with
declare target - Initiate asynchronous offloading and data transfer with the
nowaitclause
Prerequisites
- A working knowledge of general programming concepts
- A working knowledge of Linux; otherwise, try working through the Linux topic first
- Ability to program in a high-level language such as Fortran or C
- A basic familiarity with parallel programming concepts and OpenMP
Requirements
There are no requirements for this roadmap.