summaryrefslogtreecommitdiffstats
path: root/openmp
diff options
context:
space:
mode:
authorJoachim Protze <protze@itc.rwth-aachen.de>2018-07-18 07:23:46 +0000
committerJoachim Protze <protze@itc.rwth-aachen.de>2018-07-18 07:23:46 +0000
commitbb869f42b7cd724e6ebb5185a7536c4cd9eb3f7d (patch)
tree3764ef43f4eaac2d703bf00b4147cd70a124342e /openmp
parenta9ec6a11d8a0eac10a6c8f74ce3012cb9d422b44 (diff)
downloadbcm5719-llvm-bb869f42b7cd724e6ebb5185a7536c4cd9eb3f7d.tar.gz
bcm5719-llvm-bb869f42b7cd724e6ebb5185a7536c4cd9eb3f7d.zip
[libomptarget] Also support several images for elf
In revision r336569 (D49036) libomptarget support for multiple nvidia images has been fixed in case a target region resides inside one or multiple libraries and in the compiled application. But the issues is still present for elf images. This fix will also support multiple images for elf. Patch by Jannis Klinkenberg Reviewers: protze.joachim, ABataev, grokos Reviewed By: protze.joachim, ABataev, grokos Subscribers: openmp-commits Differential Revision: https://reviews.llvm.org/D49418 llvm-svn: 337355
Diffstat (limited to 'openmp')
-rw-r--r--openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp b/openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp
index 558388dbce6..951710a6782 100644
--- a/openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp
+++ b/openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp
@@ -66,7 +66,7 @@ struct FuncOrGblEntryTy {
/// Class containing all the device information.
class RTLDeviceInfoTy {
- std::vector<FuncOrGblEntryTy> FuncGblEntries;
+ std::vector<std::list<FuncOrGblEntryTy>> FuncGblEntries;
public:
std::list<DynLibTy> DynLibs;
@@ -76,7 +76,8 @@ public:
__tgt_offload_entry *end) {
assert(device_id < (int32_t)FuncGblEntries.size() &&
"Unexpected device id!");
- FuncOrGblEntryTy &E = FuncGblEntries[device_id];
+ FuncGblEntries[device_id].emplace_back();
+ FuncOrGblEntryTy &E = FuncGblEntries[device_id].back();
E.Table.EntriesBegin = begin;
E.Table.EntriesEnd = end;
@@ -86,7 +87,7 @@ public:
bool findOffloadEntry(int32_t device_id, void *addr) {
assert(device_id < (int32_t)FuncGblEntries.size() &&
"Unexpected device id!");
- FuncOrGblEntryTy &E = FuncGblEntries[device_id];
+ FuncOrGblEntryTy &E = FuncGblEntries[device_id].back();
for (__tgt_offload_entry *i = E.Table.EntriesBegin, *e = E.Table.EntriesEnd;
i < e; ++i) {
@@ -101,7 +102,7 @@ public:
__tgt_target_table *getOffloadEntriesTable(int32_t device_id) {
assert(device_id < (int32_t)FuncGblEntries.size() &&
"Unexpected device id!");
- FuncOrGblEntryTy &E = FuncGblEntries[device_id];
+ FuncOrGblEntryTy &E = FuncGblEntries[device_id].back();
return &E.Table;
}
OpenPOWER on IntegriCloud