Hello everyone,

I am a newbie and have some question. I’m looking forward to your help.

I am confused about OpenACC. Is it just some set of rules? They say, OpenACC is open standard and it’s free, but it is implemented only in PGI compiler which is costly. I would like to know if there is any other FREE way to write program by OpenACC directives.

Also, I would like to know if they are going to make new compilers which include OpenACC. Is nvidia going to make it? They say OpenACC is compatible with CUDA, so maybe we can see these directives implemented in CUDA 5?

Thanks in advance.

GPU directives are fools gold. Libraries are the right way to go because they too represent minimal code disturbance, while still delivering the benefit of hand-optimized GPU kernels. Compilers simply cannot compete with libraries in terms of GPU performance today.

Disclaimer: I work on ArrayFire which is a library (free for 1 GPU, not free for multi-GPU).

I have not programmed with OpenACC myself, but flipping through the documentation, it looks very similar in style to OpenMP. If you want to get an idea of what this style of programming is like (without paying PGI), you can take a look at the OpenMP tutorial here:

OpenMP is designed to automatically generate threaded CPU code, which is very different than the parallelism model for OpenACC. Nevertheless, I think spending a little time playing with OpenMP will give you a good feel for things.

I doubt that NVIDIA will implement OpenACC in their free compiler because it requires significant support in the CPU part of the compiler. nvcc is implemented with a preprocessor that separates CPU and GPU code, and then uses the unmodified, native host compiler on the CPU part and NVIDIA’s compiler for the GPU part. To implement OpenACC inside nvcc, NVIDIA would need to modify a host compiler, which is a lot more work.

Now, if OpenACC becomes popular (this will take a while), it is possible you will see compilers like gcc start to implement it, just as they have done with OpenMP. However, I expect that if OpenACC support were to appear in gcc, it would probably compile to OpenCL code instead of CUDA. By that point, we will have seen several newer GPU architectures from all the vendors, and maybe they will have converged to the point that OpenCL really offers portable performance across different hardware

AFAIK, OpenACC standard-compliant versions of compilers should be soon released by the compiler vendors in the OpenACC consortium (ie PGI, CAPS and Cray). The 3 of them are proposing commercial products so to get it, you’ll need to by a compiler licence.
Now, since the OpenACC standard itself is free, whoever willing to implement it can do so. And therefore maybe one day GCC might support it (but not in a foreseeable future I would say).