Hi,
I’m trying to use the accelerator directives on a simple loop, but the compilet gives this error:
call to cuMemcpyDtoH returned error 700: Launch failed
The code that I’m using with the !$acc directive is
!$acc region copyin(r_c(1:resids,1:3,1:2),r_cb(1:resids,1:3,1:2)),&
!$acc copyin(epsij(1:20),dat1(1:resids,1)),&
!$acc copyout(Ener)
do j=1,resids
Vbb=0.0D0
Vhp=0.0D0
mol1=dat1(i,1)
mol2=dat1(j,1)
if (mol1.ne.10) then
dx=(r_cb(i,1,1)-r_c(j,1,2))
dy=(r_cb(i,2,1)-r_c(j,2,2))
dz=(r_cb(i,3,1)-r_c(j,3,2))
r=(dx2+dy2+dz**2)0.50D0
sigma=(s_c+s_cb)/2.0D0
rc=sigma*2.0D0(1.0D0/6.0D0)
if (r.le.rc) then
rr=(sigma/r)6
Vbb=4.0D0epsbb&
(rr2-rr+0.250D0)
end if
end if
if ((mol1.ne.10).and.(mol2.ne.10)) then
dx=r_cb(i,1,1)-r_cb(j,1,2)
dy=r_cb(i,2,1)-r_cb(j,2,2)
dz=r_cb(i,3,1)-r_cb(j,3,2)
r=(dx2+dy2+dz**2)**0.5000
rr=(s_cb/r)6
rc=s_cb*2.0(1.0/6.0)
eij=(epsij(mol1)*epsij(mol2))**0.50D0
if (r.le.rc) then
Vhp=4.0D0epshp(rr2-rr)+&
epshp*(1.0D0-eij)
else
Vhp=4.0D0epshpeij*(rr2-rr)
end if
end if
Ener(j)=Vhp+Vbb
end do
!$acc end region
I don’t understand why it gives me that error, since the arrays are small (the variable resids is not bigger than 10), and my GPU has 1.5GB of memory. Could you help me with this problem?
Thanks,
Marco