Download PGI Compiler User`s Guide

Transcript
Distributing Files - Deployment
12.3.1. Generating Generic x86 Code
To generate generic x86 code, use one of the following forms of the–tp option on your
command line:
–tp px ! generate code for any x86 cpu type
–tp p6 ! generate code for Pentium 2 or greater
While both of these examples are good choices for portable execution, most users have Pentium 2
or greater CPUs.
12.3.2. Generating Code for a Specific Processor
You can use the -tp option to request that the compiler generate code optimized for a specific
processor. The PGI Release Notes contains a list of supported processors or you can look at the –
tp entry in the compiler output generated by using the –help option, described in ‘–help’ in the
PGI Compiler Reference Manual.
12.4. Generating One Executable for Multiple Types of
Processors
PGI unified binaries provide a low-overhead method for a single program to run well on a
number of hardware platforms.
All 64-bit PGI compilers can produce PGI Unified Binary programs that contain code streams
fully optimized and supported for both AMD64 and Intel 64 processors using the -tp target
option.
The compilers generate and combine multiple binary code streams into one executable, where
each stream is optimized for a specific platform. At runtime, this one executable senses the
environment and dynamically selects the appropriate code stream.
Executable size is automatically controlled via unified binary culling. Only those functions and
subroutines where the target affects the generated code have unique binary images, resulting in a
code-size savings of 10-90% compared to generating full copies of code for each target.
Programs can use PGI Unified Binary technology even if all of the object files and libraries are
not compiled as unified binaries. Like any other object file, you can use PGI Unified Binary
object files to create programs or libraries. No special start up code is needed; support is linked in
from the PGI libraries.
The -Mpfi option disables generation of PGI Unified Binary object files. Instead, the default
target auto-detect rules for the host are used to select the target processor.
12.4.1. PGI Unified Binary Command-line Switches
The PGI Unified Binary command-line switch is an extension of the target processor switch, tp, which may be applied to individual files during compilation.
PGI Compiler User's Guide
151