Use of OpenACC over OpenCL?
Asked Answered
L

4

6

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).

Ligan answered 31/1, 2013 at 9:36 Comment(2)
There are 3 levels to consider: 1) OpenCL is low-level, write-it-yourself accelerator parallelism, 2) OpenCL libraries are easiter-to-use, based on OpenCL, hand-written to achieve accelerator parallelism, 3) OpenACC relies on compilers to somehow automatically find accelerator parallelism in your code. In practice, compilers are not up to the task of auto-finding parallelism for most problems. We wrote about this topic last year: blog.accelereyes.com/blog/2012/04/11/…Elna
If you haven't found it already, you might consider investigating the "Education" and sample code sections of OpenACCSelfinductance
O
8

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.

Owen answered 31/1, 2013 at 11:2 Comment(4)
Thank you so much for your answer.. My doubt is clarified.. i want to explore more on this OpenACC.. i studied some of the pdf's and docs about this.. I wanna study much more, can you provide me any source which is best to learn?Ligan
Unfortunately, there isn't much more information available besides what you can get from the official website. This may also be attributed to OpenACC's low adoption.Owen
GCC may gain progress in 4.9Cumming
Mentor Graphics are working on itWadi
H
3

Update (August 2020):

Hardy answered 9/8, 2020 at 3:46 Comment(0)
H
2

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

Huntley answered 11/1, 2017 at 15:58 Comment(0)
T
2

Update: GCC6 + 7 actively integrating OpenACC specs

See https://gcc.gnu.org/wiki/OpenACC

Tire answered 23/8, 2017 at 9:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.