[libomptarget] Add support for target update non-contiguous
authorcchen <chichunchen844@gmail.com>
Thu, 19 Nov 2020 17:16:09 +0000 (11:16 -0600)
committercchen <chichunchen844@gmail.com>
Thu, 19 Nov 2020 17:33:27 +0000 (11:33 -0600)
commit7036fe8a0cffcefaa542f6dde756b7aa2f9c91b5
tree26c96ced6d97ab64e99579eaa21b2cda21ac7f86
parent8f778b283de5757fa8bf4da255a3a34b3a5cdbd3
[libomptarget] Add support for target update non-contiguous

This patch is the runtime support for https://reviews.llvm.org/D84192.

In order not to modify the tgt_target_data_update information but still be
able to pass the extra information for non-contiguous map item (offset,
count, and stride for each dimension), this patch overload arg when
the maptype is set as OMP_TGT_MAPTYPE_DESCRIPTOR. The origin arg is for
passing the pointer information, however, the overloaded arg is an
array of descriptor_dim:

```
struct descriptor_dim {
  int64_t offset;
  int64_t count;
  int64_t stride
};
```

and the array size is the dimension size. In addition, since we
have count and stride information in descriptor_dim, we can replace/overload the
arg_size parameter by using dimension size.

Reviewed By: grokos, tianshilei1992

Differential Revision: https://reviews.llvm.org/D82245
openmp/libomptarget/include/omptarget.h
openmp/libomptarget/src/device.cpp
openmp/libomptarget/src/interface.cpp
openmp/libomptarget/src/omptarget.cpp
openmp/libomptarget/src/private.h
openmp/libomptarget/test/offloading/non_contiguous_update.cpp [new file with mode: 0644]