Compiler failed to translate accelerator region

I get this error when I try to compile my code:

PGF90-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Unexpected runtime function call (rhs.cuf: 1)

Everything was running fine until I made some changes (the BIN variable was change from a one dimensional array to a three dimensional array is the major change). I emailed the code to the support address.

Thanks for your help!

I found that the problem is caused by line 5 from the segment below.

do i=1,3
l_bound(i) = -1
u_bound(i) = 1
if (i_bin_index(i) == 1) l_bound(i) = 0
if (i_bin_index(i) == size(bin,i)) u_bound(i) = 0
end do

Why would that line throw an error?

Hi Matt,

Line 5 corresponds to the “size” intrinsic, but “size” should be fine to use within an OpenACC compute region. Hence, I’m not sure what the problem is here.

Can you please provide a reproducing example? If it’s too large to post, please send a note to PGI Customer Service ( and ask them to forward it to me.



This was Cuda fortran code not Openacc. I emailed all of the code to the support email address several days ago. I have gotten around the problem by pulling the if statements out of the loop and creating explicit statements for each i:

if (i_bin_index(1) == 1) l_bound(1) = 0
if (i_bin_index(1) == size(bin,1)) u_bound(1) = 0

if (i_bin_index(2) == 1) l_bound(2) = 0
if (i_bin_index(2) == size(bin,2)) u_bound(2) = 0

if (i_bin_index(3) == 1) l_bound(3) = 0
if (i_bin_index(3) == size(bin,3)) u_bound(3) = 0