Questions tagged [openacc]

The OpenACC Application Program Interface describes a collection of compiler directives to specify loops and regions of code in standard C, C++ and Fortran to be offloaded from a host CPU to an attached accelerator, providing portability across operating systems, host CPUs and accelerators.

The OpenACC Application Program Interface describes a collection of compiler directives to specify loops and regions of code in standard C, C++ and Fortran to be offloaded from a host CPU to an attached accelerator, providing portability across operating systems, host CPUs and accelerators.

Useful Links

The OpenACC directives and programming model allow programmers to create high-level host+accelerator programs without the need to explicitly initialize the accelerator, manage data or program transfers between the host and accelerator, or initiate accelerator startup and shutdown.

All of these details are implicit in the programming model and are managed by the OpenACC API-enabled compilers and runtimes. The programming model allows the programmer to augment information available to the compilers, including specification of data local to an accelerator, guidance on mapping of loops onto an accelerator, and similar performance-related details.

How to get Useful Answers to your OpenACC Questions on StackOverflow

Here are a number of suggestions to users new to OpenACC and/or StackOverflow. Follow these suggestions before asking your question and you are much more likely to get a satisfactory answer!

  • Search StackOverflow (and the web!) for similar questions before asking yours
  • Include an as-simple-as-possible code example in your question and you are much more likely to get a useful answer. If the code is short and self-contained (so users can test it themselves), that is even better.
403 questions
33
votes
4 answers

Can OpenMP be used for GPUs?

I've been searching the web but I'm still very confused about this topic. Can anyone explain this more clearly? I come from an Aerospace Engineering background (not from a Computer Science one), so when I read online about OpenMP/CUDA/etc. and…
André Almeida
  • 379
  • 1
  • 4
  • 11
27
votes
4 answers

openacc vs openmp & mpi differences ?

I was wondering what are the major differences between openacc and openmp. What about MPI, cuda and opencl ? I understand the differences between openmp and mpi, especially the part about shared and distributed memory Do any of them allow for a…
Sid5427
  • 721
  • 3
  • 11
  • 19
15
votes
3 answers

Difference between kernels construct and parallel construct

I study a lot of articles and the manual of OpenACC but still i don't understand the main difference of these two constructs.
pg1927
  • 153
  • 1
  • 6
9
votes
2 answers

CUDA loop on matlab

I have been playing around with parallelization both using ACC and OpenMP in Fortran. I am now trying to do the same in matlab. I find it very interesting that it seems to be very hard to paralelize a loop using GPUs in matlab. Apparently the only…
phdstudent
  • 1,060
  • 20
  • 41
8
votes
1 answer

OpenMP offloading to Nvidia wrong reduction

I am interested in offloading work to the GPU with OpenMP. The code below gives the correct value of sum on the CPU //g++ -O3 -Wall foo.cpp -fopenmp #pragma omp parallel for reduction(+:sum) …
Z boson
  • 32,619
  • 11
  • 123
  • 226
7
votes
2 answers

NVCC 5.0 and OpenACC

According to NVIDIA website: "The CUDA Toolkit complements and fully supports programming with OpenACC directives." Does this mean OpenACC programs (pargma and API) can be compiled with nvcc compiler? Or it means only runtime routine calls are…
lashgar
  • 5,184
  • 3
  • 37
  • 45
6
votes
2 answers

Are derived types containing allocatable arrays supported in any existing OpenACC compilers?

Are there any OpenAcc compilers that support the copying of derived types containing allocatable arrays to/from the GPU and their use in accelerated code? The OpenACC spec (v2.0) states this is possible, but I'm unable to find it implemented in a…
mjm26
  • 307
  • 1
  • 2
  • 12
6
votes
4 answers

Use of OpenACC over OpenCL?

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…
Fakruddeen
  • 175
  • 1
  • 3
  • 11
6
votes
1 answer

how to optimize matrix multiplication using OpenACC?

I am learning OpenACC (with PGI's compiler) and trying to optimize matrix multiplication example. The fastest implementation I came up so far is the following: void matrix_mul(float *restrict r, float *a, float *b, int N, int accelerate){ #pragma…
user1545642
5
votes
2 answers

OpenACC red-black Gauss-Seidel slower than CPU

I added OpenACC directives to my red-black Gauss-Seidel solver for the Laplace equation (a simple heated plate problem), but the GPU-accelerated code is no faster than the CPU, even for large problems. I also wrote a CUDA version, and that is much…
Kyle Niemeyer
  • 301
  • 2
  • 12
4
votes
0 answers

Gcc offload compilation options

I'm trying to build the simplest OpenMP or OpenACC C++ program with GPU offload using gcc-10, CUDA 11 on Ubuntu 18.04 and this CMakeLists.txt file (or OpenMP version): cmake_minimum_required(VERSION 3.18) project(hello VERSION…
Paul Jurczak
  • 7,008
  • 3
  • 47
  • 72
4
votes
0 answers

OpenAcc + Cython not working

I have some C++ code that I'd like to accelerate using OpenACC. I call the C++ from python using cython, but when I add OpenACC pragmas it doesn't seem to work. I tried a simple program: #include #define N 2000000000 #define vl 1024 int…
somebody
  • 49
  • 1
  • 3
4
votes
1 answer

Can I use printf(or something) in OpenACC with PGI compiler?

I have some trouble to OpenACC code debugging which compiled PGI compiler. (pgcc 15.7) I want to show or dump variables and array values which are in OpenACC region. (the variable and array is on GPU's memory space) But I can't use printf in OpenACC…
soongk
  • 259
  • 3
  • 17
4
votes
1 answer

can java code be parallelized on GPU using open ACC

is it possible to run "for loops" of java code on GPU using OpenACC?? my data mining algorithm coded in java and i want to parallelism my sequential code on GPU. how can i parallelize my java code on GPU?
4
votes
2 answers

OpenACC in Visual C++

I want to parallelize my codes with OpenACC directives. It's said that it is a crossplatform API. The developer firms are giving no information about OpenACC in VisualStudio. Is there a way to do that?
antonio
  • 722
  • 11
  • 22
1
2 3
26 27