ALERT! Warning: your browser isn't supported. Please install a modern one, like Firefox, Opera, Safari, Chrome or the latest Internet Explorer. Thank you!
Startseite » ... » Zentrale Einrichtungen  » ZIH  » Wiki
phone prefix: +49 351 463.....

HPC Support

Operation Status

Ulf Markwardt: 33640
Claudia Schmidt: 39833

Login and project application

Phone: 40000
Fax: 42328

You are here: Compendium » GPUProgramming

GPU Programming

Directive Based GPU Programming

Directives are special compiler commands in your C/C++ or Fortran source code. The tell the compiler how to parallelize and offload work to a GPU. This section explains how to use this technique.


OpenACC ( link to the website) is a directive based GPU programming model. It currently only supports NVIDIA GPUs as a target.

Please use the following information as a start on OpenACC:

OpenACC can be used with the PGI and CAPS compilers. For PGI please be sure to load version 13.4 or newer for full support for the NVIDIA Tesla K20x GPUs at ZIH.

Using OpenACC with PGI compilers

  • For compilaton please add the compiler flag -acc, to enable OpenACC interpreting by the compiler.
  • -Minfo will tell you what the compiler is actually doing to your code
  • If you only want to use the created binary at ZIH resources, please also add -ta=nvidia:keple
  • OpenACC Turorial: intro1.pdf, intro2.pdf .


HMPP is available from the CAPS compilers.

Native GPU Programming


Native CUDA ( link to website) programs can sometimes offer a better performance. Please use the following slides as an introduction:

In order to compiler an application with CUDA use the nvcc compiler command