mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-10 16:32:11 +01:00
22 lines
409 B
Fortran
22 lines
409 B
Fortran
! @@name: declare_target.1
|
|
! @@type: F-free
|
|
! @@operation: compile
|
|
! @@expect: success
|
|
! @@version: omp_4.0
|
|
module module_fib
|
|
integer :: THRESHOLD=1000000
|
|
contains
|
|
subroutine fib(N)
|
|
integer :: N
|
|
!$omp declare target
|
|
!...
|
|
end subroutine
|
|
end module
|
|
subroutine my_fib(N)
|
|
use module_fib
|
|
integer :: N
|
|
!$omp target if( N > THRESHOLD )
|
|
call fib(N)
|
|
!$omp end target
|
|
end subroutine
|