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.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
37 views

C/Macros/OpenACC&OpenMP target device

I'm currently encountering a problem with C macros. I'm trying to create a macro for OpenACC and OpenMP directives specifically for GPUs. I'm able to compile the code for both OpenACC and OpenMP ...
Nitin Shukla's user avatar
-1 votes
0 answers
32 views

OpenACC C++ gcc/g++ complete example

I am struggling with OpenACC implementation. I have found examples and tutorials that are eg obsolete, incomplete, or just for the PGI compiler. In short, I could not run any of it :( Since it is ...
user7667996's user avatar
0 votes
1 answer
40 views

Attempt to parallelize despite the data dependencies

I am trying to parallelize matrix multiplication. I came across a Fox algorithm which can break the whole thing into 3 step. You can look up the algorithm. I have attached an image.enter image ...
pranavs1997's user avatar
0 votes
0 answers
56 views

Undefined references to GOACC_ symbols when linking CFD solver using OpenACC

I am trying to speed up an in house Computational Fluid Dynamics solver called FEST-3D by using OPENACC. I am working on a Ubuntu 22.04 Virtual Machine(on VirtualBox) with windows as host. FEST-3D has ...
Flerovium 114's user avatar
2 votes
2 answers
46 views

OpenAcc program built with C++ compiler is way slower than C built version

The code I'm working on is in C++ and is slightly complicated but the the example below shows the problem. It comes from a book by Chandrasekaran and Juckeland. If it is compiled with nvc -acc (or ...
paww's user avatar
  • 23
0 votes
1 answer
63 views

"undefined reference to `GOACC_parallel_keyed' " and related errors coming up while running make command

I am working on a project where I have to optimise the performance of a Computational Fluid Dynamic solver. We aim to use OpenACC to do so. The solver was written using fortran90 and run via terminal ...
Flerovium 114's user avatar
0 votes
1 answer
47 views

Erroneous result using OpenACC "collapse" when too many levels are collapsed

I ran into a strange bit of “magic” with OpenACC while I was working on a much larger analysis (using MPI, too, hence the “mpi…” calls below) that appears to arise from the use of “collapse” in a #...
Mark Bower's user avatar
1 vote
0 answers
45 views

libquadmath.o.dylib found by gcc, but not mpicc

I want to compile some igraph code within a file that uses MPI and OpenACC. Using an igraph example (“sparsemat2.c”), it compiles with “gcc”, but not “mpicc”. $ gcc sparsemat2.c -I/usr/local/include/...
Mark Bower's user avatar
-1 votes
3 answers
82 views

Why does "#pragma omp loop for" produce a compile error?

Why doesn't this compile? The following MRE is built from a number of examples trying to get OpenMP and OpenACC to work together. The compile command produces the following error: $ mpic++ -mcmodel=...
Mark Bower's user avatar
1 vote
0 answers
47 views

Issue with Writing Array Elements to File in OpenACC

Hello OpenACC experts, I'm facing a problem with writing array elements to a file using OpenACC. Here's the relevant code snippet: #include <iostream> #include <fstream> using namespace ...
yourmaster12321-at-hyphens's user avatar
1 vote
1 answer
392 views

Unable to access CUDA device with OpenACC on WSL2 Ubuntu: Error code=34

I am new to using OpenACC on WSL2 with Ubuntu and have encountered an issue. I successfully installed the HPC SDK as instructed on the website, without installing CUDA separately, as the latest CUDA ...
Aronld Manki's user avatar
0 votes
0 answers
166 views

Problem with !$acc declare create directive

Declaring allocatable arrays and transferring them to GPU global memory using !$acc declare create and !$acc update device fails with Cray Fortran. It runs OK with PGI and NV Fortran. The following is ...
Ilkhom Abdurakhmanov's user avatar
0 votes
0 answers
44 views

Random numbers inside OpenACC loop (nvfortran compiler)

Is there a straightforward way to generate random numbers inside an OpenACC parallel loop? I want the seed within each loop/thread to be different. The reference code that demonstrates the required ...
Dumbledore Albus's user avatar
0 votes
0 answers
78 views

Understanding how to work with derived c++ classes in Openacc?

I'm trying to implement some plasma physics codes on GPUs. However, I have a problem of the following type: I have two classes: base and derived. The derived class contains an additional pointer that ...
FeyPhys's user avatar
  • 25
0 votes
1 answer
66 views

Long cuMemToHostAlloc call after exiting a kernel with copyout

I am accelerating a Fortran code with OpenACC. When I profile the program with NVIDIA Nsight, I noticed the first call of a kernel with a copyout clause exhibited a long call to cuMemToHostAlloc. Here ...
Paul Zehner's user avatar
0 votes
1 answer
58 views

How to `std::shuffle` CSR arrays in OpenACC

To set up the context, I have a running C++ code (of a graph algorithm) which I am trying to accelerate using OpenACC / nvc++ both on GPU and multicore. I've used vector of vector to store the ...
mrprajesh's user avatar
1 vote
0 answers
150 views

Use std::vector with OpenACC

I’m trying to compute on GPU, using OpenACC, the sum between two vectors of std::vector. As compiler I’m using GCC+NVPTX with OpenACC support but when I compile the code with these flags: g++ -...
carbonaraHPC's user avatar
0 votes
2 answers
169 views

How to fix openacc warning/error about unknown driver

I try to compile a C++ OpenACC code (unchanged) that was working before my distribution update (from Ubuntu 20 to 22). And as you could guess, this compilation is not working anymore. Therefore, I ...
R. N's user avatar
  • 717
0 votes
0 answers
74 views

Is my OpenACC code compiled with GCC running on GPU?

I'm trying to write a very simple example with OpenACC using GCC as compiler, but I'm not sure if the program runs on the GPU. First of all, I have a Lenovo W540 running Debian Sid with an integrated ...
jgpallero's user avatar
  • 183
0 votes
1 answer
39 views

OpenACC parallelize loops with multiple classes access in C++

I’m trying to learn OpenACC but all the example I’ve studied are quite basics, like move a vector to the GPU, compute some sums or multiplication and bring the results back. What happens if in the ...
sadsquirrel88's user avatar
0 votes
0 answers
32 views

objects as value of parameters which are used in other functions,can not found in device by using OpenACC

I use OpenACC to improve the performance of c++ code running. In the code files I create Array2D class for data updating. When I compiled the code file,there are some warning information from some ...
Lance's user avatar
  • 39
0 votes
1 answer
86 views

Error shows preventing parallelization when I compiled the C++ code with openacc

When I compiled the code with openacc ,I got the warning information: $ pgc++ -o buffer1.out -acc -gpu=managed -Minfo=accel buffer.cpp main: 137, Generating enter data copyin(mat1) ...
Lance's user avatar
  • 39
0 votes
1 answer
139 views

OpenACC code runs 17036.0939901 times faster on Nvidia V100 GPU than on AMD MI250 GPU

I am trying to understand why my OpenACC code runs 17036.0939901 times faster on Nvidia V100 GPU than on AMD Mi-250 GPU. It is a simple matrix-matrix multiplication code. Here is output which I ...
Ilkhom Abdurakhmanov's user avatar
1 vote
1 answer
101 views

OpenACC: Why updating an array depends on the location of the update directive

I'm new to openacc. I'm trying to use it to accelerate a particle code. However, I don't understand why when updating an array (eta in the program below) on the host, it gives different results ...
FeyPhys's user avatar
  • 25
0 votes
1 answer
95 views

A problem in calling several gpu subroutines sequentially: OpenACC - Fortran

I have the following problem. I have a main subroutine, let us call it main_function (for 3D BSplines). It takes as input several tensors. This function contains only IF-conditions. If a condition is ...
FeyPhys's user avatar
  • 25
0 votes
1 answer
18 views

Global Variables in OpenACC

I'm trying to handle a global variable declared in this way in head.h: extern int NX1_TOT; #pragma acc declare create(NX1_TOT) While in globals.h: int NX1_TOT; in main.c: #include "head.h" ...
Steve's user avatar
  • 89
3 votes
0 answers
120 views

Accelerate the use of MPI types

I have a Fortran program that uses MPI types to describe subarrays for data transfers, which prevents me to create send/receive buffers manually. This works nice, but when accelerating the program ...
Paul Zehner's user avatar
0 votes
1 answer
237 views

How to measure precisely the memory usage of the GPU (OpenACC+Managed Memory)

Which is the most precise method to measure the memory usage of the GPU of an application that is using OpenACC with Managed Memory? I used two method to do so: one is nvidia-smi +---------------------...
Steve's user avatar
  • 89
0 votes
1 answer
43 views

With OpenACC OpenCV ,pgc++ compiling error duplicate lives at 0x7ffff78db5c0 size 96 partially present

I used opencv to implement data transfer with openacc,but I got error when I compiled the code file.Please take a look at the information below: #include<queue> #include <vector> #include&...
Lance's user avatar
  • 39
0 votes
1 answer
64 views

OpenACC ,no updated values in shared variable

I got one question about the shared variable in loop. I want to get the value of i and j after calculation in loop. Here is the code below: #include<iostream> #include<openacc.h> #define N ...
Lance's user avatar
  • 39
0 votes
1 answer
116 views

In Openacc, warning: Accelerator restriction: induction variable live-out from loop: i

May I know how to use the variable i in the first loop as the addend in the second loop? And moreover, I want to ask if I should use update and whether I should use present($var) to tell compiler the ...
Lance's user avatar
  • 39
0 votes
1 answer
94 views

using OpenACC ,error information displays :[if not already present]

When I compiled the code with OpenACC,I got the error information:[if not already present] #include<iostream> #include<openacc.h> using namespace std; int main(){ int i,j,sum=0; #pragma ...
Lance's user avatar
  • 39
0 votes
0 answers
221 views

use nvc++ to run C++ program with OpenACC ,error shows :libgomp: TODO

I used nvc++ to run the C++ program with openacc and the error displayed 'libgomp: TODO'. Here is the test code: #include <opencv2/imgcodecs.hpp> #include <opencv2/highgui.hpp> #include&...
Lance's user avatar
  • 39
0 votes
1 answer
295 views

How to handle a device variable using OpenACC

I'm trying to optimize my code which I accelerated using basically OpenACC only. Is it a good approach to insert CUDA such as in the example that follows? In this case, u_device and v_device are used ...
Steve's user avatar
  • 89
0 votes
1 answer
124 views

How to use acc_set_cuda_stream(streamId, stream)?

I created a CUDA stream in this way: integer(kind=cuda_stream_kind) :: stream1 istat = cudaStreamCreate(stream1) to use it for the plan of a cufft: err_dir = err_dir + cufftPlan2D(plan_dir1,NY,NY,...
Steve's user avatar
  • 89
0 votes
1 answer
47 views

-ta=tesla:deepcopy flag and #pragma acc shape

I just found out about the deepcopy flag. Until this moment I've always used -ta=tesla:managed to handle deep copy and I would like to explore the alternative. I read this article: https://www.pgroup....
Steve's user avatar
  • 89
0 votes
1 answer
222 views

external variables used in acc routine need to be in #pragma acc create()

NVC++-W-1056-External variables used in acc routine need to be in #pragma acc create() - i (sim_xy1.c: 1012) NVC++-W-1056-External variables used in acc routine need to be in #pragma acc create() - i (...
Guilherme Emmerick's user avatar
0 votes
1 answer
89 views

Procedures called in a compute region must have acc routine information - exit

I have this function that is called in various parts of the code when I have an error and I need to stop the program from running. However, I get this error when compiling only on nvidia video card (-...
Guilherme Emmerick's user avatar
0 votes
1 answer
84 views

External variables used in acc routine need to be in #pragma acc create(

I'm trying to compile a program in OpenACC and I'm having the following errors NVC++-W-1056-External variables used in acc routine need to be in #pragma acc create() - i (sim_xy1.c: 1011) NVC++-W-1056-...
Guilherme Emmerick's user avatar
0 votes
2 answers
60 views

How to have the same routine executed sometimes by the CPU and sometimes by the GPU with OpenACC?

I'm dealing with a routine which I want the first time to be executed by the CPU and every other time by the GPU. This routine contains the loop: for (k = kb; k <= ke; k++){ for (j = jb; j <= je;...
Steve's user avatar
  • 89
0 votes
1 answer
59 views

Compiling with PGI PGCC with LAPACK and LBLAS libraries?

I'm trying to compile my OpenACC parallel C++ program that makes use of dgemm (BLAS) and dgesvd (LAPACK) functions. I'm trying to compile the program with PGI PGCC compiler, linking it with the ...
gamersensual's user avatar
0 votes
1 answer
95 views

Nested Loops in OpenACC

I'm trying to parallelize a nested for loop with OpenACC. I don't understand why my code isn't working correctly, The following is the relevant part of my code: int edgedetect_laplace(int height, ...
Ralph Bear's user avatar
1 vote
1 answer
39 views

How to apply cuda-memcheck to an app with piped inputs from standard I/O

I want to use cuda-memcheck for an app with standard I/O. The app, dut, reads standard Input and writes standard Output. cat input.txt | cuda-memcheck ./dut -dutoptions > output.txt In this case, ...
hakunom's user avatar
  • 13
0 votes
1 answer
206 views

Reference Argument Passing with Nested OpenACC Routines

I'm attempting to parallelize some Fortran 90 code using OpenACC, where a parallelized loop calls a sequential routine. When I attempt to run the code using the PGI Fortran compiler (2020.4), I obtain ...
M-Merkle's user avatar
0 votes
2 answers
262 views

How do I include cufft.h file in a fortran code?

I have a Fortran code which has been made to work on CPUs, but I need to accelerate it using GPUs and I chose to do that with OpenACC. This code uses FFTW libraries when compiled with gfortran. ...
riky_cv's user avatar
  • 11
0 votes
1 answer
267 views

OpenACC: reduction operation on arrays

Is it possible to use the reduction operation "or" on the static array flag[nx3_tot][nx2_tot][nx1_tot] ? here FLAG_HLL=4 and FLAG_MINMOD=1. Without the reduction the results of this function ...
Steve's user avatar
  • 89
1 vote
1 answer
51 views

How do I translate this simple OpenACC code to SYCL?

I have this code: #pragma acc kernels #pragma acc loop seq for(i=0; i<bands; i++) { mean=0; #pragma acc loop seq for(j=0; j<N; j++) mean+=(image[(i*N)+j]); mean/=N; ...
gamersensual's user avatar
0 votes
1 answer
138 views

Multi-Threaded Multi-GPU Code on HPC cluster

I'm trying to run a code on multi-gpu using OpenMP+OpenACC , so a single thread is attached to a given single gpu to run it on multi-gpu, So what resources should I avail on HPC cluster to get max-...
Harshad bhusare's user avatar
0 votes
1 answer
72 views

When declaring a static array as "private" before a parallel loop is perfectly equivalent to declaring the array inside the loop?

I've encountered a situation where the code generates different results in the case of having arrays defined inside the loop on index i (case #1) and in the case of declaring them outside the loop on ...
Steve's user avatar
  • 89
1 vote
1 answer
184 views

Running pgc++ programs on Cluster

I tried to run the below OPenACC program on cluster: #include <stdio.h> #include <iostream> using namespace std; int main() { #pragma acc parallel loop for (int i=0;...
Krishna M.V.'s user avatar

1
2 3 4 5
9