Is dependence analysis mandatory for OpenACC compilers?

63 Views Asked by At

Many OpenACC tutorials assume that the compiler/accelerator will check for correctness, by automatically inspecting dependencies and ensuring that the loop is actually parallelizable. However, the OpenACC specification doesn't seem to mention anything about mandatory correctness analysis. Are OpenACC compilers OBLIGATED to check if loops are actually parallelizable and give up if they're not?

1

There are 1 best solutions below

1
Mat Colgrove On

The compiler is required to analyze loops to determine if they are data independent when the "loop" directive's "auto" clause is used. (See section 2.9.6 of the OpenACC standard).

For loops within a "kernels" construct, "auto" is enabled by default unless either the "independent" or "seq" clauses are used.

For "loop" directives within a "parallel" construct, "auto" is not enabled by default hence the decorated loops are presumed independent.