I wrote a Fortran code as:
program picalc
implicit none
integer, parameter :: n=10
integer :: i
real(kind=8) :: a(n),b(n),c(n)
!acc data copy(a,b,c)
!$acc parallel
do i=1, n
a(i) = i
b(i) = 1
c(i) = a(i) + b(i)
end do
!$acc end parallel
!acc end data
write(*,*) c(2)
end program picalc
The compiler information as below:
Compute capability mismatch
file: F:\PVFProject1\PVFProject1\ConsoleApp.f90
routine: picalc
line: 15
device: 0 compute capability 1.2
driver: 4020
Available compute capability: 1.3(elf) 2.0(elf) 2.0(ptx)
I had thought this code need compute capablity with 1.3+
But after I modified the code as below:
program picalc
implicit none
integer, parameter :: n=10
integer :: i
real(kind=8) :: a(n),b(n),c(n)
!acc data copy(a,b,c)
!$acc do
do i=1, n
a(i) = i
b(i) = 1
c(i) = a(i) + b(i)
end do
!acc end data
write(*,*) c(2)
end program picalc
This time,the code was compiled succesully. I got some confuseed ,Why?
I’m looking forward your reply.
Merry Christmas