Bureaucrats, cc_docs_admin, cc_staff
2,879
edits
No edit summary |
No edit summary |
||
Line 170: | Line 170: | ||
<translate> | <translate> | ||
==== Building with OpenACC ==== <!--T: | ==== Building with OpenACC ==== | ||
For the purpose of this tutorial, we use version | |||
{{Callout | |||
|title=<!--T:22--> | |||
Which compiler ?</translate> | |||
|content= | |||
<translate> | |||
<!--T:23--> | |||
As of May 2021, compiler support for OpenACC is present in many compilers. Being pushed by [http://www.nvidia.com/content/global/global.php NVidia], as well as by [http://www.cray.com/ Cray], these two lines of compilers offer the most advanced OpenACC support. [https://gcc.gnu.org/wiki/OpenACC GNU Compiler] support for OpenACC exists with better support every version since version 5. | |||
<!--T:24--> | |||
For the purpose of this tutorial, we use version 20.7 of the NVidia HPC compilers. | |||
}} | |||
The NVidia compilers use the <tt>-ta</tt> (target accelerator) option to enable compilation for an accelerator. We use the sub-option <tt>tesla:managed</tt>, to tell the compiler that we want it compiled for Tesla GPUs, and we want to use managed memory. Managed memory simplifies the process of transferring data to and from the device. We will remove this option in a later example. We also use the option <tt>-fast</tt>, which is an optimization option. | |||
</translate> | </translate> | ||
Line 191: | Line 204: | ||
Generating implicit reduction(+:sum) | Generating implicit reduction(+:sum) | ||
34, Loop is parallelizable | 34, Loop is parallelizable | ||
}} | }} | ||
<translate> | <translate> | ||
As we can see in the compiler output, the compiler could not parallelize the two loops. We will see in the following sections how to deal with this. | |||
== Fixing false loop dependencies == <!--T:25--> | == Fixing false loop dependencies == <!--T:25--> |