PGI 2010 and later releases include 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.
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 Until now, developers targeting GPU accelerators have had to rely on language extensions to their programs. 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.
Accelerate your application fast with PGI Accelerator directives. In cooperation with NVIDIA, PGI is offering a 30 day risk free trial of PGI Accelerator compilers. If after 4 weeks you haven't achieved at least a 2x speedup in your code, NVIDIA and PGI will provide you with up to 4 hours of free consulting*. Participants can also qualify for free PGI Accelerator compilers and free NVIDIA GPUs. Program details are available on the NVIDIA 2x in 4 Weeks web page.
* Certain conditions apply. See program FAQ for details.
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 2003 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 2011 and later releases include support for 64-bit and 32-bit Linux, Windows and Mac OS X.
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.
Q Do I need to install the CUDA software?
A The PGI Accelerator compilers rely on several components of the NVIDIA CUDA Software Development Kit (SDK). All the necessary components of the NVIDIA CUDA SDK are included in the PGI installation package. Details are described in the PGI Installation Guide for your product.
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.
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 What efforts are underway to standardize the PGI Accelerator model or high level accelerator programming in general?
A The OpenMP ARB has a subcommittee working on extending the OpenMP API to support accelerators, and PGI is actively involved with this subcommittee. In addition, PGI, along with Cray, NVIDIA and CAPS, have announced they are working together to define the OpenACC API specification, which is based on the PGI Accelerator model.
Q Why is there an OpenACC standard?
A High level programming is the key to productive programming. CUDA and OpenCL are a great leap forward in programming GPUs compared to the state of the art in 2005, but they are still low-level, close-to-the-metal programming environments. This allows the programmer a great deal of control, but with that comes the full responsibility for getting performance from the device. For the best performance, you will have to tune each of your algorithms to the specific device. Even the smallest, most mundane loop requires a complete rewrite when using CUDA or OpenCL. High level programming can shift most of this responsibility from the programmer to the compiler and runtime.
Since 1997, the OpenMP standard has since supported a high level programming model for shared-memory multiprocessor and multicore systems. It hasn't completely replaced lower level models, like programming in POSIX threads, but by far, most application programmers prefer the higher level approach. A standard allows programmers and independent software vendors (ISVs) to develop portable parallel programs.
For GPU programming in particular, and accelerator programming in general, the community needs a high-level, portable mechanism that manages and optimizes the data traffic to and from the GPU or accelerator, and optimizes the code for the specific GPU or device. OpenACC serves that role.
Q Why does PGI support OpenACC instead of focusing solely on the PGI Accelerator model?
A The PGI Accelerator model has been successfully used by many customers to use NVIDIA GPUs. We explicitly and carefully designed our model to be portable across device types, and specifically did not put the "PGI" name in the directives. From the very first, we were thinking and planning on moving this model towards standardization.
Several system suppliers now produce products using GPUs as accelerators. More scientists and ISVs will be willing to adopt a model standardized across compiler vendors than one only supported by a single vendor, regardless of how well designed and supported. OpenACC is that model. More users will drive competition across compiler vendors, which will benefit all users.
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 All the directives in the PGI Fortran & C Accelerator Programming Model white paper v.1.2 are implemented in PGI 2011.
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 licensee, you may upgrade your license in accordance with PGI's standard product upgrade policy.
Q How can I try it?
A To try out the PGI Accelerator compilers, follow these three steps:
Please contact PGI Sales for exchange, upgrade or subscription renewal information.