I am new to OpenACC which is a new programming standard for GPU Acceleration as well as CPU. As per my knowledge OpenACC is a language which is a compiler directive, directly we can accelerate the code where ever we want, without changing the whole code. This Programming standard will work for GPU also unlike OpenMP.
Now my doubt raises here..
we have OpenCL for acceleration, now OpenACC(which is very easy to use, just by giving compiler hints). For host program acceleration we can simply put compiler directives, then what about if we have a kernel? i.e. now i want to write my code for GPU(c-language), what i have to do? like OpenCL do i need to write example.c & example.cl?? then need to add OpenACC compiler directives? or else in which way? if it is so, then what is the use of OpenACC here, coz we are writing both *.c & *.cl files, (we need to check all the memory constraints and all for writing OpenCL, which is a tough work).
Actually, OpenACC is a lot like OpenMP but targeting acceleration devices such as GPUs. Instead of having an OpenMP #pragma parallel for
parallelizing a loop for a multi-threaded CPU, OpenACCs #pragma acc kernels
will turn the contained loops into kernel functions that are executed on the GPU. Much of what has to be done now manually (e.g. transferring the data from and to device) is hidden by the compiler. Thus, you don't have two separate compilation units.
Now here's the problem with OpenACC and my answer to why adoption right now, is very low: There is no support from GCC or Clang. Of course there are commercial solutions from PGI and CAPS but without these other compilers you will alienate many users.
Update: gcc6 now has parts of it working:
"GCC 6 release series includes a much improved implementation of the OpenACC 2.0a specification."
See https://gcc.gnu.org/wiki/OpenACC
Update (August 2020):
Update: GCC6 + 7 actively integrating OpenACC specs
See https://gcc.gnu.org/wiki/OpenACC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With