OpenACC Tutorial - Adding directives/fr: Difference between revisions

Updating to match new version of source page
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 54: Line 54:


=== Loops vs Kernels ===
=== Loops vs Kernels ===
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.
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
|-
|-
! Loop !! Kernels
! LOOP !! KERNEL
|-
|-
| <syntaxhighlight lang="cpp" line>
| <syntaxhighlight lang="cpp" line>
Line 93: Line 93:
</syntaxhighlight>  
</syntaxhighlight>  


This example is very simple. However, code is often not that simple, and we then need to reply on compiler feedback in order to identify regions it failed to parallelize.  
This example is very simple. However, code is often not that simple, and we then need to rely on compiler feedback in order to identify regions it failed to parallelize.  
{{Callout
{{Callout
|title=Descriptive vs prescriptive
|title=Descriptive vs prescriptive
38,760

edits