3.9.4. Implementation¶
The simplest implementation alternative is to have a dispatcher with
a central !$omp target
section, corresponding to the !$omp parallel
section in CPU dispatchers:
...
!$omp target
!$omp teams num_teams(80) thread_limit(64)
!$omp parallel
do while (.not.done)
call task_list%update
end do
!$omp end parallel
!$omp end target
Inside the solvers only a few extra OpneMP directives are needed, with
the main one being that declarations of arrays need to be complemented
by !$omp declare target
directives, specifying where arrays belong,
and that transfer to and from the GPU at the start and end of the task
update need to be specified by !$omp task update
directives.