Unroll in OpenACC parallel regions

What are the currently-accepted directives for unrolling loops inside an OpenACC parallel regions?

In my case, I’d like to unroll a seq loop inside a “parallel do vector” loop.

Thanks in advance!

Hi Ron,

No sorry, OpenACC does not have a loop unrolling clause or directive.

You can try using the compiler unrolling optimization via the “-Munroll” flag. Please see “pgfortran -help -Munroll” for details on the sub-options.


Thanks, Mat. Would the PGI compiler’s unroll pragmas help in this case?

The “#pragma unroll = …” only works with host code, so wouldn’t be useful here.

Our old PGI Accelerator Model did have an “unroll” clause for loop directives, but this wasn’t carried forward with OpenACC. Feel free to send the OpenACC folks a note requesting this feature (feedback at openacc.org). They’ve just gotten OpenACC 2.6 out for public review so would welcome ideas for the next version of the standard.