OpenMP-Examples/devices/sources/target_data.1.f90
2022-11-04 09:35:42 -07:00

20 lines
433 B
Fortran

! @@name: target_data.1
! @@type: F-free
! @@operation: compile
! @@expect: success
! @@version: omp_4.0
subroutine vec_mult(p, v1, v2, N)
real :: p(N), v1(N), v2(N)
integer :: i
call init(v1, v2, N)
!$omp target data map(to: v1, v2) map(from: p)
!$omp target
!$omp parallel do
do i=1,N
p(i) = v1(i) * v2(i)
end do
!$omp end target
!$omp end target data
call output(p, N)
end subroutine