NVIDIA's NVPTX Support For GCC Is Close To Being Merged
Written by Michael Larabel in NVIDIA on 20 October 2014 at 11:50 AM EDT. 8 Comments
The NVPTX back-end code for GCC that's going to allow OpenACC 2.0 offloading support for NVIDIA GPUs with GCC is close to materializing within the mainline code-base.

For the past year Mentor Graphics / Code Sourcery has been working on OpenACC 2.0 with GPU offloading as a big addition to the GNU Compiler Collection through their work with NVIDIA Corp. The offloading infrastructure has been worked on for a while and the code that soon looks like it will land is the NVPTX support.

NVPTX is for NVIDIA's Parallel Thread Execution as an Assembly-like language used by NVIDIA's CUDA for compute support. NVPTX code is then taken by NVIDIA's closed-source compiler and turned into actual GPU instructions to be executed. The use of this intermediate representation is what caused some to be against this offloading support since even with this open-source NVPTX GCC support there is a dependence on using NVIDIA's proprietary graphics driver to make this NVPTX output usable.

Bernd Schmidt of Code Sourcery has sought approval this morning for adding the NVPTX port to GCC. "It contains preliminary patches to add needed functionality, the target files, and one somewhat optional patch with additional target tools. There'll be more patch series, one for the testsuite, and one to make the offload functionality work with this port. Also required are the previous four rtl patches, two of which weren't entirely approved yet."

Bernd went on to explain the limitations, "Ptx really isn't a usual target - it is a virtual target which is then translated by another compiler (ptxas) to the final code that runs on the GPU. There are many restrictions, some imposed by the GPU hardware, and some by the fact that not everything you'd want can be represented in ptx.
All in all, this is not intended to be used as a C (or any other source language) compiler. I've gone through a lot of effort to make it work reasonably well, but only in order to get sufficient test coverage from the testsuites. The intended use for this is only to build it as an offload compiler, and use it through OpenACC by way of lto1."

The patches are currently on the mailing list. It looks like that this OpenACC 2.0 support with GPU offloading will materialize in time for next year's release of GCC 5.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week