3 ! Test tasks with detach clause on an offload device. Each device
4 ! thread spawns off a chain of tasks, that can then be executed by
5 ! any available thread. Each thread uses taskwait to wait for the
6 ! child tasks to complete.
11 integer (kind
=omp_event_handle_kind
) :: detach_event1
, detach_event2
12 integer :: x
= 0, y
= 0, z
= 0
13 integer :: thread_count
15 !$omp target map (tofrom: x, y, z) map (from: thread_count)
16 !$omp parallel private (detach_event1, detach_event2)
18 thread_count
= omp_get_num_threads ()
21 !$omp task detach (detach_event1) untied
26 !$omp task detach (detach_event2) untied
29 call omp_fulfill_event (detach_event1
)
35 call omp_fulfill_event (detach_event2
)
42 if (x
/= thread_count
) stop 1
43 if (y
/= thread_count
) stop 2
44 if (z
/= thread_count
) stop 3