[OpenMP] Unify omptarget API and usage wrt. `__tgt_async_info`
authorJohannes Doerfert <johannes@jdoerfert.de>
Wed, 10 Feb 2021 17:06:00 +0000 (11:06 -0600)
committerJohannes Doerfert <johannes@jdoerfert.de>
Tue, 16 Feb 2021 21:38:06 +0000 (15:38 -0600)
commit758b8499310a5d44a41de67d656bd32dc3fd1023
tree46dc046ef3905810254569eafb67ca1d5c6c4aaa
parenta2fc0d34db72315f05b96681013e1e16d4df41c7
[OpenMP] Unify omptarget API and usage wrt. `__tgt_async_info`

This patch unifies our libomptarget API in two ways:
  - always pass a `__tgt_async_info` object, the Queue member decides if
    it is in use or not.
  - (almost) always synchronize in the interface layer and not in the
    omptarget layer.

A side effect is that we now put all constructor and static initializer
kernels in a stream too, if the device utilizes `__tgt_async_info`.

The patch contains a TODO which can be addressed as we add support for
asynchronous malloc and free in the plugin API. This is the only
`synchronizeAsyncInfo` left in the omptarget layer.

Site note: On a V100 system the GridMini performance for small sizes
more than doubled.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D96379
openmp/libomptarget/src/api.cpp
openmp/libomptarget/src/device.cpp
openmp/libomptarget/src/device.h
openmp/libomptarget/src/interface.cpp
openmp/libomptarget/src/omptarget.cpp
openmp/libomptarget/src/private.h
openmp/libomptarget/src/rtl.cpp