aboutsummaryrefslogtreecommitdiff
path: root/openmp/libomptarget/include/device.h
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/libomptarget/include/device.h')
-rw-r--r--openmp/libomptarget/include/device.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/openmp/libomptarget/include/device.h b/openmp/libomptarget/include/device.h
index 6602ee0..05ed654 100644
--- a/openmp/libomptarget/include/device.h
+++ b/openmp/libomptarget/include/device.h
@@ -19,15 +19,20 @@
#include <cstring>
#include <list>
#include <map>
+#include <memory>
#include <mutex>
#include <set>
#include "ExclusiveAccess.h"
+#include "OffloadEntry.h"
#include "omptarget.h"
#include "rtl.h"
#include "OpenMP/Mapping.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallVector.h"
+
// Forward declarations.
struct PluginAdaptorTy;
struct __tgt_bin_desc;
@@ -48,7 +53,7 @@ struct DeviceTy {
bool IsInit;
std::once_flag InitFlag;
- bool HasPendingGlobals;
+ bool HasMappedGlobalData = false;
/// Host data to device map type with a wrapper key indirection that allows
/// concurrent modification of the entries without invalidating the underlying
@@ -223,12 +228,21 @@ struct DeviceTy {
int32_t destroyEvent(void *Event);
/// }
+ /// Register \p Entry as an offload entry that is avalable on this device.
+ void addOffloadEntry(OffloadEntryTy &Entry);
+
+ /// Print all offload entries to stderr.
+ void dumpOffloadEntries();
+
private:
// Call to RTL
void init(); // To be called only via DeviceTy::initOnce()
/// Deinitialize the device (and plugin).
void deinit();
+
+ /// All offload entries available on this device.
+ llvm::DenseMap<llvm::StringRef, OffloadEntryTy *> DeviceOffloadEntries;
};
extern bool deviceIsReady(int DeviceNum);