Skip to content

OpenACC Behaviour

This site explores OpenACC pragmas in combination with valid but seldomly used Fortran statements and different compilers. The aim of this site is to document this behaviour for various use cases and compilers, thus providing a knowledge database for those who need it. This site should allow Programmers to save time debugging OpenACC. It can also serve as a basis for compiler providers to "fix" or implement other behaviour for certain cases, such that the same OpenACC pragmas execute more similarily for the different compilers.

Layout

Every chapter describes a problem and how each compiler handles it.

Results overview

Case Cray Fortran 19.0.0 nvfortran 25.3-0 Expected according to spec
Pointers in structs — declare create ❌ Crash ❌ Crash ❌ Crash
Pointers in structs — enter data, local variable ❌ Crash ✅ OK ❌ Crash
Pointers in structs — enter data, module variable ❌ Crash 🟡 Wrong result ❌ Crash
Pointers in structs — enter data for member ✅ OK ✅ OK ✅ OK
Pointers in structs — no data/declare ❌ Crash ✅ OK ❌ Crash
Characters in host routines ❌ Compile error ✅ OK —
Module variable aliasing 🟡 Wrong result ✅ OK —
GPU-aware MPI — without slicing ✅ OK ✅ OK —
GPU-aware MPI — with slicing ✅ OK 🟡 Wrong result —
acc_is_present on a scalar ✅ OK ❌ Compile error ✅ OK
exit data delete — never present ❌ Crash ❌ Crash ✅ OK
exit data delete — twice ❌ Crash ✅ OK ✅ OK
Pointer re-attach after host reassociation 🟡 Wrong result ✅ OK ✅ OK
detach of never-attached pointer, then attach ✅ OK ✅ OK ✅ OK
Reduction on a composite member ❌ Compile error ❌ Compile error ❌ Compile error
Reduction on a whole composite variable ❌ Compile error ❌ Compile error ✅ OK
Reduction on an array element ❌ Compile error ✅ OK ✅ OK