Test case is pi.c. Build, first without OpenACC:
% ompcc -c pi.c -I/usr/include/R -fpic % R CMD SHLIB pi.o -L/usr/local/cuda/lib64 -lcudart
Run from within R, using dyn.load() and plain old .C(). Works fine.
Now rebuild with OpenACC:
% ompcc -c pi.c -I/usr/include/R -fpic -acc % R CMD SHLIB pi.o -L/usr/local/cuda/lib64 -lcudart -L/home/matloff/Pub/omni/lib -lacc -lacc_cuda % setenv LD_LIBRARY_PATH /home/matloff/Pub/omni/lib:/usr/local/cuda/lib64
But this time, when called from R, it hangs.
We also tried the commercial PGI compiler (trial version, now expired). In this case, the OpenACC-enabled code did run, but its time was 70X slower than the non-OpenACC version of the same code.