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
0
votes
0 answers

openacc struct in loop and if-statement

I have the following code: #pragma acc data present(listOfPolygons1, listOfPolygons2, polygon1, polygon2) copy(listOfBoolean[0:numOfPolygonsPair]) #pragma acc parallel loop // do point-in-polygon in this nested loop for (i=0;…
dondonhk
  • 631
  • 3
  • 6
  • 19
0
votes
1 answer

openacc - alias for an array results in "Cannot determine bounds for array" error

I have an array of size N on my host. I will transfer it to my device and then I try to assign an alias to it and use that. But, I get a "Cannot determine bounds for array" compilation error. Example: #include #include…
mgNobody
  • 738
  • 7
  • 23
0
votes
1 answer

nvprof with MPICH

I am trying to profile an MPI/OpenACC Fortran code. I found a site that details how to run nvprof with MPI here. The examples given are for OpenMPI. However, I am limited to MPICH and I can't figure out the equivalent. Anyone know what it would…
bob.sacamento
  • 6,283
  • 10
  • 56
  • 115
0
votes
1 answer

OpenACC data movement

I am very new to OpenACC and I don't quite understand about the data movement and the "#pragma acc data" clause. I have a program written in C. An extract from the code is like that: #pragma acc data…
dondonhk
  • 631
  • 3
  • 6
  • 19
0
votes
1 answer

How to run NVPROF that contains no CUDA code?

Want to baseline a standard fortran code that does not contain cuda code before I upgrade it. Can I do that and if so, how?
DeepPowder
  • 3
  • 1
  • 2
0
votes
1 answer

OpenAcc if-condition not working?

I have the following code: #pragma acc kernels for (i = 0; i
dondonhk
  • 631
  • 3
  • 6
  • 19
0
votes
1 answer

What's creating NaNs in OpenACC code?

I need to instrument a Fortran code with OpenACC. Here are the relevant portions: program myprogram real :: x(160,100,100,8) !$acc declare create(x(:,:,:,:)) integer, parameter :: ns1=1 integer, parameter :: ns2=8 integer, parameter ::…
bob.sacamento
  • 6,283
  • 10
  • 56
  • 115
0
votes
1 answer

How to make a subroutine work in an OpenACC data region

I am in the middle of instrumenting a fairly large-sized code with OpenACC. Right now, I am delaing with a routine foo that calls a few other routines bar, far, and boo, like so: subroutine foo real x(100,25),y(100,25),z(100,25) real barout(25),…
bob.sacamento
  • 6,283
  • 10
  • 56
  • 115
0
votes
0 answers

Compiling openACC code getting strange error

I'm getting a very strange error message whenever I try to compile the following code using the accull compiler (for compiling openACC). The basic out of the box code that came with the installation compiled and ran just fine, however whenever I try…
Zypps987
  • 404
  • 6
  • 21
0
votes
0 answers

Using OpenACC in a fortran77 project ,but has no effect and not output kernel information

I have a fortran77 reservoir simulation project ,and want to use openacc directive to accelerate implementation,the compiler is PGI visual fortran ,a subroutine as follow: SUBROUTINE jbild(a, b, impl, [ ia, ja, neqa, kvst, ka,…
WeiH-CUG
  • 1
  • 1
0
votes
1 answer

Using cuBLAS in OpenAcc

I want to replace the call to "cblas_dgemm()" with cublasDgemm(). Here is the original wrapper from Shark machine learning library: inline void gemm( CBLAS_ORDER const Order, CBLAS_TRANSPOSE TransA, CBLAS_TRANSPOSE TransB, int M, int N,…
Ali Jooya
  • 75
  • 7
0
votes
0 answers

Invalid accelerator data region: branching into or out of region is not allowed?

pgcc is showing "Invalid accelerator data region: branching into or out of region is not allowed" for the lines that I put my acc pragmas, but I don't understand why. I'm using copy, copyin, and create for all arrays that the loops would…
PuffySparrow
  • 897
  • 3
  • 10
  • 23
0
votes
1 answer

Reduction in OpenACC

Here is a Fortran subroutine for matrix-vector multiply. It is probably old-fashioned and inefficient in a number of ways, but right now I am just trying to get it to work with OpenACC directives, and I'm trying to figure out how reduction…
bob.sacamento
  • 6,283
  • 10
  • 56
  • 115
0
votes
2 answers

linking pgi compiled library with gcc linker

I would like to know how to link a pgc++ compiled code (blabla.a) with a main code compiled with c++ or g++ GNU compiler. For the moment linking with default gnu c++ linker gives errors like: undefined reference to `__pgio_initu'
Med Aissa
  • 3
  • 2
0
votes
1 answer

Controlling the threads that go into CUDA function from OpenACC compute region

Im calling a cuda function from OpenACC compute region, and I want to specify the number of threads that should go into the cuda function, but it seems that I couldn't figure how to control that. %main.cpp .. #pragma acc routine vector extern "C"…