summaryrefslogtreecommitdiffstats
path: root/include/clang/Driver/Compilation.h
diff options
context:
space:
mode:
authorSamuel Antao <sfantao@us.ibm.com>2016-09-30 15:34:19 +0000
committerSamuel Antao <sfantao@us.ibm.com>2016-09-30 15:34:19 +0000
commit05f9770103d845179d781a9a40be6c0c7a0635f6 (patch)
tree703f6cb083e65b2fdee6026ee60307615a63c727 /include/clang/Driver/Compilation.h
parent3013cb7a5adbcb73b4b6a19c34c7368a28e99ad5 (diff)
[CUDA][OpenMP] Add a generic offload action builder
Summary: 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Driver/Compilation.h')
-rw-r--r--include/clang/Driver/Compilation.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Driver/Compilation.h b/include/clang/Driver/Compilation.h
index 8846b6f6b3..b87a121187 100644
--- a/include/clang/Driver/Compilation.h
+++ b/include/clang/Driver/Compilation.h
@@ -115,6 +115,12 @@ public:
return OrderedOffloadingToolchains.equal_range(Kind);
}
+ /// Return true if an offloading tool chain of a given kind exists.
+ template <Action::OffloadKind Kind> bool hasOffloadToolChain() const {
+ return OrderedOffloadingToolchains.find(Kind) !=
+ OrderedOffloadingToolchains.end();
+ }
+
/// Return an offload toolchain of the provided kind. Only one is expected to
/// exist.
template <Action::OffloadKind Kind>