Fortran Coder

标题: CUDA11.2+PVF14.10环境下OpenAcc加速失败原因 [打印本页]

作者: xiaoshuaihao666    时间: 2023-5-20 16:06
标题: CUDA11.2+PVF14.10环境下OpenAcc加速失败原因
各位老师好,我在PGI Visual Fortran14.10环境下在language中打开了OpenAcc 指令,但是会出现这个错误是什么原因?希望能够得到老师的指导。错误指示为:Call to cuModuleLoadData returned error 209 :No binary for GPU

程序如下:
[Fortran] 纯文本查看 复制代码
program main
use openacc
implicit none
real,allocatable::v1(:)
integer length,idx
call acc_set_device_num(2,acc_device_nvidia)
length=102410241024
allocate(v1(length))
v1(1:length)=0.0
!$acc data copy(v1(1:length))
call add1(v1,length)
!$acc update host(v1(1:5))
print*,‘v1(1)=’,v1(1:5)
do idx=1,length
v1(idx)=v1(idx)+10
enddo
print*,‘v1(1)=’,v1(1:5)
!$acc update host(v1(1:5))
print*,‘v1(1)=’,v1(1:5)
!$acc end data
deallocate(v1)
end program
subroutine add1(vec,length)
use openacc
implicit none
integer,intent(in)::length
real,intent(inout)::vec(1:length)
integer idx
!$acc parallel loop present(vec(1:length))
do idx=1,length
vec(idx)=vec(idx)+idx
enddo
end subroutine







欢迎光临 Fortran Coder (http://bbs.fcode.cn/) Powered by Discuz! X3.2