PGI Accelerator Compilers

PGI 2010 includes the PGI Accelerator™ Fortran and C99 compilers supporting x64+NVIDIA systems running under Linux, Mac OS X and Windows; PGFORTRAN and PGCC accelerator compilers are supported on all Intel and AMD x64 processor-based systems with CUDA-enabled NVIDIA GPUs.

Overview

Using PGI Accelerator compilers, programmers can accelerate Linux, Mac OS X and Windows applications on x64+GPU platforms by adding OpenMP-like compiler directives to existing high-level standard-compliant Fortran and C programs and then recompiling with appropriate compiler options.

Sample Fortran matrix multiplication loop, tagged to be compiled for an accelerator.

!$acc region 
      do k = 1,n1
       do i = 1,n3
        c(i,k) = 0.0
        do j = 1,n2
         c(i,k) = c(i,k) + a(i,j) * b(j,k)
        enddo
       enddo
      enddo
!$acc end region

How It Works

Until now, C and C++ developers targeting GPU accelerators have had to rely on language extensions to their programs. Use of GPUs from Fortran applications has been extremely limited. x64+GPU programmers have been required to program at a detailed level including a need to understand and specify data usage information and manually construct sequences of calls to manage all movement of data between the x64 host and GPU.

The PGI Accelerator compilers automatically analyze whole program structure and data, split portions of the application between the x64 CPU and GPU as specified by user directives, and define and generate an optimized mapping of loops to automatically use the parallel cores, hardware threading capabilities and SIMD vector capabilities of modern GPUs. In addition to directives and pragmas that specify regions of code or functions to be accelerated, the PGI Accelerator compilers support user directives that give the programmer fine-grained control over the mapping of loops, allocation of memory, and optimization for the GPU memory hierarchy. The PGI Accelerator compilers generate unified x64+GPU object files and executables that manage all movement of data to and from the GPU device while leveraging all existing host-side utilities—linker, librarians, makefiles—and require no changes to the existing standard HPC Linux/x64 programming environment.

Additional Resources

FAQ

Please also see the PGI Accelerator Programming user forum for additional questions and answers.


Q Which programming languages do the PGI Accelerator compilers support?

A Currently, PGI has added support for GPU accelerators to the PGFORTRAN™ Fortran 95/03 and PGCC® ANSI C99 compilers. While adding support for C++ is technically feasible, we have no current timeline for the availability of this capability. We welcome your feedback.

Q On which operating systems do PGI Accelerator compilers run?

A PGI 2010 includes support for 64-bit and 32-bit Linux, 64-bit and 32-bit Windows and 32-bit Mac OS X. 64-bit Mac OS X support is awaiting release by NVIDIA of the 64-bit CUDA SDK for Mac OS X due sometime in early 2010. The prior release, PGI 9.0 included support for 64-bit Linux only.

Q Which accelerators can be targeted by PGI Accelerator compilers?

A PGI Accelerator compilers target all CUDA-enabled NVIDIA GPU accelerators with compute capability 1.0 or higher. PGI is studying the feasibility of supporting other accelerators.

A What are PGI's plans for supporting of the new Fermi accelerators coming soon from NVIDIA?

A PGI is continuing to work closely with NVIDIA to ensure that support for the new Fermi architecture based GPUs will be available concurrent with the hardware.

Q Do I need to install the CUDA software?

A The PGI Accelerator compilers rely on several conponents of the NVIDIA CUDA Software Development Kit (SDK). Beginning with the PGI 2010 release, all the necessary components of the NVIDIA CUDA SDK are included in the PGI installation package. Details are described in the PGI Server/PGI Workstation Installation Guide.

Q Does the compiler support IEEE standard-floating point arithmetic?

A The GPU accelerators available today support most of the IEEE floating-point standard. However, they do not support all the rounding modes, and some operations, notably square root, exponential, logarithm, and other transcendental functions, may not deliver full precision results. This is a hardware limitation that compilers cannot overcome.

Q Do PGI Accelerator compilers support double-precision?

A Yes, but please be aware that while today's latest GPU accelerators do have support for double-precision, performance can be quite low relative to single-precision.

Q Can I call a CUDA kernel function from my PGI-compiled code?

A PGI is working on the design of a feature to allow you to call kernel functions written in CUDA or PTX or other languages directly from your C or Fortran program. We will announce this feature when it is available.

Q Does the compiler support two or more GPUs in the same program?

A As with CUDA, you can use two or more GPUs by using multiple threads, where each thread attaches to a different GPU and runs its kernels on that GPU. The current release does not include support to automatically control two or more GPUs from the same accelerator region.

Q Is there an effort to open your directives to a standards committee, like OpenMP?

A As we gain experience with our directives and programming model, we will be open to exploring a standardization effort.

Q Can I run my program on a machine that doesn't have an accelerator on it?

A Yes. PGI Accelerator compilers can generate PGI Unified Binary™ technology executables that work in the presence or absence of an accelerator.

Q Do I have to rebuild my application for each different GPU model?

A The GPU code generated uses the same technology that is used for graphics applications and games; that is, the program uses a portable intermediate format which is then dynamically translated and re-optimized at run time by the drivers supplied by the vendor for the particular model of GPU in your machine. This preserves your investment by allowing your programs to continue to work even when you upgrade your GPU card, or use your program on a machine with a different model of GPU.

Q Can I use function or procedure calls in my GPU code?

A Current GPUs do not support function calls. The compiler will support function calls only if they can be inlined.

Q When will you support <my favorite feature> in your compiler?

A Some features cannot be supported due to limitations of the hardware. Other features are not being supported because they would not deliver satisfactory performance. Still other features are planned for future implementation. Your feedback can affect our priorities.

Q Are all the specified directives supported in the this release?

A Not all the directives in the PGI Fortran & C Accelerator Programming Model white paper are implemented with PGI 2010. The list of directives remaining to be implemented are:

  • Loop Scheduling directive clauses
    • unroll
    • cache
  • Runtime routines
    • acc_shutdown
    • acc_on_device

Q How much does it cost?

A License pricing for the PGI Accelerator compilers can be found in the pricing section.

If you are a current PGI licensees and you are interested in upgrading, learn more about the license upgrade program.

Q So how can I try it?

A To try out the PGI Accelerator compilers, follow these three steps:

  1. Download any of the available software packages for your operating system.
  2. Review the PGI Workstation/PGI Server Installation Guide or the PGI CDK Installation Guide and configure your environment.
  3. Obtain license keys. Available options include:
    1. You have a current PGI subscription—you will need to retrieve your 10.0 permanent license keys.
    2. Your PGI subscription has expired—you can either generate 15 day trial keys as outlined in option 3 below, or you can bring your subscription current and gain access to the accelerator feature through updated permanent license keys. By renewing your subscription, you will also qualify for any license upgrade incentives.
    3. You don't have a PGI license—you can generate 15 day trial license keys. The trial keys and all executable files compiled using them will cease operating at the end of the 15 day trial period.

Please contact PGI Sales for exchange, upgrade or subscription renewal information.

Click me