[CUDA][OpenMP] Add a generic offload action builder

Authored by sfantao on Sep 30 2016, 8:34 AM.


[CUDA][OpenMP] Add a generic offload action builder

This patch proposes a new class to generate and record action dependences related with offloading. The builder provides three main functionalities:

  • Add device dependences to host actions.
  • Add host dependence to device actions.
  • Register device top-level actions.

The constructor of the builder detect the programming models that should be supported, and generates a specialized builder for each. If a new programming model is to be added in the future, only a new specialized builder has to be implemented.

When the specialized builder is generated, it produces programming-model-specific diagnostics.

A CUDA specialized builder is proposed in the patch that mostly consists of the partition of the current buildCudaAction by the three different functionalities.

Reviewers: tra, echristo, ABataev, jlebar, hfinkel

Subscribers: Hahnfeld, whchung, guansong, jlebar, mehdi_amini, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 282865