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

36 lines
591 B
Fortran

! @@name: task_detach.1
! @@type: F-free
! @@operation: compile
! @@expect: success
! @@version: omp_5.0
program main
use omp_lib
implicit none
external :: async_work, work
logical :: async=.true.
integer(omp_event_handle_kind) :: event
!$omp parallel
!$omp masked
!$omp task detach(event)
if(async) then
call async_work(omp_fulfill_event, event)
else
call work()
call omp_fulfill_event(event)
endif
!$omp end task
!! Other work
!$omp taskwait
!$omp end masked
!$omp end parallel
end program