I’d like to use intrinsic bitwise functions like ieor , etc …
Fortran 2018 functions like POPPAR and POPCNT are supported (according to the manual reference) but still give me :
pgf90 -lcufft -Mcuda -O3 -Dpgi -r8 -Mpreprocess -ta=tesla:cuda10.1 -c cutools.f90
PGF90-F-0000-Internal compiler error. Unsupported IPOPPAR 4 (cutools.f90: 631)
PGF90/x86-64 Linux 19.9-0: compilation aborted
module cutools
! ...
contains
! ....
attributes(global) subroutine cuget_1bdensmat(dmat,CI,indexI,actdim)
implicit none
complex(8) :: dmat(:,:)
complex(8) :: CI(:)
integer :: indexI(:)
integer ,value :: actdim
complex(8) ,shared :: temp(blockDim%x*blockDim%y)
integer :: i,p,q,j, totslatt,slattoveralp,actP,actQ,inext
p = blockIdx%x
q = blockIdx%y
i = (threadIdx%y -1)*blockDim%x+threadIdx%x ! for the moment max nb of slater = 1024
temp(i) = cmplx(0.d0,0.d0)
temp(i) = cmplx(0.d0,0.d0)
if (i<= actdim) then
if (ABS(CI(i))>1.d-8) then
if (p==q) then
temp(i)=conjg(Ci(i))*CI(i)*btest(indexI(i),p-1)
else
j=1
do while (j <= actdim)
if (ABS(CI(j))>1.d-8) then
actP = ibclr(indexI(i), p-1)
actQ = ibclr(indexI(j), q-1)
if (actP==actQ .and. (actP/=indexI(i) .or. actQ/=indexI(j))) then
slattoveralp=(-2*POPPAR(ibits(indexI(i),0,p-1))+1)*(-2*POPPAR(ibits(indexI(j),0,q-1))+1)
temp(i)=slattoveralp*conjg(Ci(i))*CI(j)
end if
end if
j = j +1
end do
end if
end if
end if
!! reduction temp
!! dmat(p,q) = temp(1)
end subroutine cuget_1bdensmat
! ....
end module cutools
Thanks Jordan. I’ve filed TPR #27787 and sent it to engineering for further investigation. Unfortunately, it probably wont be fixed anytime soon so you’ll need to look into rewriting the code without POPPAR.