PGI Compiler Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
® PGI Compiler Reference Manual Parallel Fortran, C and C++ for Scientists and Engineers Release 2013 The Portland Group PGI® Compiler Reference Manual Copyright © 2013 NVIDIA Corporation All rights reserved. Printed in the United States of America First printing: Release 2011, 11.0, December, 2010 Second Printing: Release 2011, 11.1, January 2011 Third Printing: Release 2011, 11.3, March 2011 Fourth Printing: Release 2011, 11.4, April 2011 Fifth Printing: Release 2011, 11.5, May 2011 Sixth Printing: Release 2012, 12.1, January 2012 Seventh Printing: Release 2012, 12.6, June 2012 Eighth Printing: Release 2012, 12.9, September 2012 Ninth Printing: Release 2013, 13.1, January 2013 Tenth Printing: Release 2013, 13.2, February 2013 Eleventh Printing: Release 2013, 13.3, March 2013 Twelfth Printing: Release 2013, 13.8, August 2013 Technical support: [email protected] Sales: [email protected] Web: www.pgroup.com ID: 132831549 Contents Preface .................................................................................................................................... xiii Audience Description ............................................................................................................ xiii Compatibility and Conformance to Standards ............................................................................ xiii Organization ......................................................................................................................... xiv Hardware and Software Constraints .......................................................................................... xv Conventions .......................................................................................................................... xv Related Publications ............................................................................................................. xvii 1. Fortran, C, and C++ Data Types .................................................................................... 1 Fortran Data Types .................................................................................................................. 1 Fortran Scalars ............................................................................................................... 1 FORTRAN 77 Aggregate Data Type Extensions ...................................................................... 3 Fortran 90 Aggregate Data Types (Derived Types) ................................................................ 4 C and C++ Data Types ........................................................................................................... 4 C and C++ Scalars ......................................................................................................... 4 C and C++ Aggregate Data Types ...................................................................................... 6 Class and Object Data Layout ............................................................................................ 6 Aggregate Alignment ........................................................................................................ 7 Bit-field Alignment .......................................................................................................... 8 Other Type Keywords in C and C++ .................................................................................. 8 2. Command-Line Options Reference ................................................................................. 9 PGI Compiler Option Summary ................................................................................................. 9 Build-Related PGI Options ................................................................................................ 9 PGI Debug-Related Compiler Options ............................................................................... 12 PGI Optimization-Related Compiler Options ...................................................................... 13 PGI Linking and Runtime-Related Compiler Options ........................................................... 13 C and C++ Compiler Options ................................................................................................. 14 Generic PGI Compiler Options ................................................................................................ 17 C and C++ -specific Compiler Options ..................................................................................... 58 –M Options by Category ......................................................................................................... 69 Code Generation Controls ............................................................................................... 70 C/C++ Language Controls .............................................................................................. 74 iii Environment Controls .................................................................................................... 76 Fortran Language Controls ............................................................................................. 77 Inlining Controls ........................................................................................................... 81 Optimization Controls .................................................................................................... 83 Miscellaneous Controls .................................................................................................. 93 3. C++ Name Mangling ...................................................................................................... 101 4. Directives and Pragmas Reference ............................................................................. 103 PGI Proprietary Fortran Directive and C/C++ Pragma Summary ................................................. 103 altcode (noaltcode) .................................................................................................... 104 assoc (noassoc) .......................................................................................................... 105 bounds (nobounds) ................................................................................................... 105 cncall (nocncall) ........................................................................................................ 105 concur (noconcur) .................................................................................................... 105 depchk (nodepchk) .................................................................................................... 105 eqvchk (noeqvchk) .................................................................................................... 105 fcon (nofcon) ............................................................................................................. 106 invarif (noinvarif) ....................................................................................................... 106 ivdep ......................................................................................................................... 106 lstval (nolstval) ........................................................................................................... 106 prefetch ..................................................................................................................... 106 opt ............................................................................................................................ 106 safe (nosafe) .............................................................................................................. 107 safe_lastval ................................................................................................................. 107 safeptr (nosafeptr) ...................................................................................................... 108 single (nosingle) ......................................................................................................... 109 tp .............................................................................................................................. 109 unroll (nounroll) ........................................................................................................ 109 vector (novector) ........................................................................................................ 110 vintr (novintr) ............................................................................................................ 110 Prefetch Directives and Pragmas ........................................................................................... 110 C$PRAGMA C ...................................................................................................................... 110 IGNORE_TKR Directive ......................................................................................................... 111 !DEC$ Directives ................................................................................................................. 112 ALIAS Directive ........................................................................................................... 112 ATTRIBUTES Directive .................................................................................................. 112 DECORATE Directive .................................................................................................... 113 DISTRIBUTE Directive .................................................................................................. 114 5. Run-time Environment .................................................................................................