OpenACC: Difference between revisions

Jump to navigation Jump to search
Forgot to change the section title
(Removed incomplete but still duplicated information)
(Forgot to change the section title)
Line 3: Line 3:
OpenACC makes it relatively easy to offload vectorized code to accelerators such as GPUs, for example. Unlike [[CUDA]] and OpenCL where kernels need to be coded explicitly, OpenACC minimizes the amount of modifications to do on a serial or [[OpenMP]] code. The compiler converts the OpenACC code into a binary executable that can make use of accelerators. The performance of OpenACC codes can be similar to the one of a [[CUDA]] code, except that OpenACC requires less code development.
OpenACC makes it relatively easy to offload vectorized code to accelerators such as GPUs, for example. Unlike [[CUDA]] and OpenCL where kernels need to be coded explicitly, OpenACC minimizes the amount of modifications to do on a serial or [[OpenMP]] code. The compiler converts the OpenACC code into a binary executable that can make use of accelerators. The performance of OpenACC codes can be similar to the one of a [[CUDA]] code, except that OpenACC requires less code development.


= OpenACC compiler instructions =
= OpenACC directives =
Similar to [[OpenMP]], OpenACC can convert a for-loop into parallel code that would run on an accelerator. This can be achieved with compiler instructions <code>#pragma acc ...</code> before a for-loop. All <code>pragma</code> directives are described in the [https://www.openacc.org/specification OpenACC specification].
Similar to [[OpenMP]], OpenACC can convert a for-loop into parallel code that would run on an accelerator. This can be achieved with compiler instructions <code>#pragma acc ...</code> before a structured block of code like a for-loop. All <code>pragma</code> directives are described in the [https://www.openacc.org/specification OpenACC specification].


= Code examples =
= Code examples =
cc_staff
782

edits

Navigation menu