program test
use omp_lib
implicit none
!integer:: host, default_device,x
!!omp_set_default_device(1)
!host = omp_get_initial_device()
!x = omp_get_num_devices()
!
!write(*,*) host
!write(*,*) default_device
!write(*,*) x
real(8) :: a(1024), b(1024), c(1024)
integer:: i
!$omp target device(0)
!$omp teams distribute parallel do simd
do i=1,1024
c(i)=c(i)+a(i)*b(i)
end do
!$omp end target
end program
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |