[OpenMP][libomptarget] Enable requires flags for target libraries.
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>
Tue, 21 May 2019 19:35:02 +0000 (19:35 +0000)
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>
Tue, 21 May 2019 19:35:02 +0000 (19:35 +0000)
commit9e9c918259f6bb2f958f7aca2a83ee3019dc9234
tree4b01c57474320c50ec8fdb5218f977cb7596b865
parent44d17ca02e0b112b4777ba6416b87793c045d8de
[OpenMP][libomptarget] Enable requires flags for target libraries.

Summary:
Target link variables are currently implemented by creating a copy of the variables on the device side and unified memory never gets exploited.

When the prgram uses the:

```
#pragma omp requires unified_shared_memory
```

directive in conjunction with a declare target link, the linked variable is no longer allocated on the device and the host version is used instead.

This behavior is overridden by performing an explicit mapping.

A Clang side patch is required.

Reviewers: ABataev, AlexEichenberger, grokos, Hahnfeld

Reviewed By: AlexEichenberger, grokos, Hahnfeld

Subscribers: Hahnfeld, jfb, guansong, jdoerfert, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D60223

llvm-svn: 361294
openmp/libomptarget/include/omptarget.h
openmp/libomptarget/src/device.cpp
openmp/libomptarget/src/device.h
openmp/libomptarget/src/exports
openmp/libomptarget/src/interface.cpp
openmp/libomptarget/src/rtl.cpp
openmp/libomptarget/src/rtl.h
openmp/libomptarget/test/offloading/requires.c [new file with mode: 0644]