
USER'S GUIDE FOR X86-64 CPUS Version 2020 TABLE OF CONTENTS Preface............................................................................................................. xi Audience Description.......................................................................................... xi Compatibility and Conformance to Standards............................................................ xi Organization....................................................................................................xii Hardware and Software Constraints...................................................................... xiii Conventions....................................................................................................xiii Terms............................................................................................................xiv Related Publications..........................................................................................xvi Chapter 1. Getting Started.....................................................................................1 1.1. Overview................................................................................................... 1 1.2. Creating an Example..................................................................................... 2 1.3. Invoking the Command-level PGI Compilers......................................................... 2 1.3.1. Command-line Syntax...............................................................................2 1.3.2. Command-line Options............................................................................. 3 1.3.3. Fortran Directives and C/C++ Pragmas.......................................................... 3 1.4. Filename Conventions....................................................................................4 1.4.1. Input Files............................................................................................ 4 1.4.2. Output Files.......................................................................................... 6 1.5. Fortran, C, and C++ Data Types........................................................................7 1.6. Parallel Programming Using the PGI Compilers...................................................... 7 1.6.1. Run SMP Parallel Programs.........................................................................8 1.7. Platform-specific considerations....................................................................... 8 1.7.1. Using the PGI Compilers on Linux................................................................ 8 1.7.2. Using the PGI Compilers on Windows............................................................ 9 1.7.3. PGI on the Windows Desktop.................................................................... 10 1.8. Site-Specific Customization of the Compilers...................................................... 11 1.8.1. Use siterc Files..................................................................................... 11 1.8.2. Using User rc Files.................................................................................12 1.9. Common Development Tasks.......................................................................... 13 Chapter 2. Use Command-line Options.................................................................... 15 2.1. Command-line Option Overview...................................................................... 15 2.1.1. Command-line Options Syntax................................................................... 15 2.1.2. Command-line Suboptions........................................................................ 16 2.1.3. Command-line Conflicting Options.............................................................. 16 2.2. Help with Command-line Options.................................................................... 16 2.3. Getting Started with Performance................................................................... 17 2.3.1. Using -fast...........................................................................................17 2.3.2. Other Performance-Related Options............................................................ 18 2.4. Targeting Multiple Systems—Using the -tp Option................................................. 19 2.5. Frequently-used Options............................................................................... 19 User's Guide for x86-64 CPUs Version 2020 | ii Chapter 3. Optimizing and Parallelizing................................................................... 22 3.1. Overview of Optimization..............................................................................23 3.1.1. Local Optimization.................................................................................23 3.1.2. Global Optimization............................................................................... 23 3.1.3. Loop Optimization: Unrolling, Vectorization and Parallelization........................... 23 3.1.4. Interprocedural Analysis (IPA) and Optimization..............................................24 3.1.5. Function Inlining................................................................................... 24 3.1.6. Profile-Feedback Optimization (PFO)........................................................... 24 3.2. Getting Started with Optimization................................................................... 24 3.2.1. -help..................................................................................................26 3.2.2. -Minfo................................................................................................ 26 3.2.3. -Mneginfo............................................................................................ 26 3.2.4. -dryrun............................................................................................... 27 3.2.5. -v......................................................................................................27 3.2.6. PGI Profiler..........................................................................................27 3.3. Common Compiler Feedback Format (CCFF)....................................................... 27 3.4. Local and Global Optimization........................................................................27 3.4.1. -Msafeptr............................................................................................ 28 3.4.2. -O..................................................................................................... 28 3.5. Loop Unrolling using -Munroll......................................................................... 30 3.6. Vectorization using -Mvect.............................................................................31 3.6.1. Vectorization Sub-options.........................................................................32 3.6.2. Vectorization Example Using SIMD Instructions............................................... 34 3.7. Auto-Parallelization using -Mconcur..................................................................36 3.7.1. Auto-Parallelization Sub-options.................................................................36 3.7.2. Loops That Fail to Parallelize................................................................... 38 3.8. Processor-Specific Optimization and the Unified Binary.......................................... 42 3.9. Interprocedural Analysis and Optimization using -Mipa........................................... 42 3.9.1. Building a Program Without IPA – Single Step................................................. 43 3.9.2. Building a Program Without IPA – Several Steps.............................................. 43 3.9.3. Building a Program Without IPA Using Make................................................... 44 3.9.4. Building a Program with IPA......................................................................44 3.9.5. Building a Program with IPA – Single Step..................................................... 45 3.9.6. Building a Program with IPA – Several Steps.................................................. 45 3.9.7. Building a Program with IPA Using Make....................................................... 46 3.9.8. Questions about IPA............................................................................... 46 3.10. Profile-Feedback Optimization using -Mpfi/-Mpfo................................................ 47 3.11. Default Optimization Levels......................................................................... 48 3.12. Local Optimization Using Directives and Pragmas................................................48 3.13. Execution Timing and Instruction Counting........................................................49 3.14. Portability of Multi-Threaded Programs on Linux.................................................50 3.14.1. libnuma.............................................................................................50 Chapter 4. Using Function Inlining..........................................................................51 User's Guide for x86-64 CPUs Version 2020 | iii 4.1. Automatic function inlining in C/C++................................................................51 4.2. Invoking Function Inlining..............................................................................52 4.3. Using an Inline Library................................................................................. 53 4.4. Creating an Inline Library............................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages212 Page
-
File Size-