OpenACC Tutorial - Adding directives: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 64: Line 64:


=== Loops vs Kernels === <!--T:8-->
=== Loops vs Kernels === <!--T:8-->
When the compiler reaches an OpenACC <tt>kernels</tt> directive, it will analyze the code in order to identify sections that can be parallelized. This often corresponds to the body of loops. When such a case is identified, the compiler will wrap the body of the code into a special function called a ''kernel''. This function makes it clear that each call to the function is independent from any other call. The function is then compiled to enable it to run on an accelerator. Since each call is independent, each one of the thousands cores of the accelerator can run the function for one specific index in parallel.
When the compiler reaches an OpenACC <tt>kernels</tt> directive, it will analyze the code in order to identify sections that can be parallelized. This often corresponds to the body of the loop. When such a case is identified, the compiler will wrap the body of the code into a special function called a ''kernel''. This function makes it clear that each call to the function is independent from any other call. The function is then compiled to enable it to run on an accelerator. Since each call is independent, each one of the thousands cores of the accelerator can run the function for one specific index in parallel.
</translate>
</translate>
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
|-
|-
! <translate><!--T:9-->
! <translate><!--T:9-->
Loop</translate> !! <translate><!--T:10-->
LOOP</translate> !! <translate><!--T:10-->
Kernels</translate>
KERNEL</translate>
|-
|-
| <syntaxhighlight lang="cpp" line>
| <syntaxhighlight lang="cpp" line>
rsnt_translations
56,430

edits