aboutsummaryrefslogtreecommitdiff
path: root/offload/plugins-nextgen/common/include/PluginInterface.h
diff options
context:
space:
mode:
Diffstat (limited to 'offload/plugins-nextgen/common/include/PluginInterface.h')
-rw-r--r--offload/plugins-nextgen/common/include/PluginInterface.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/offload/plugins-nextgen/common/include/PluginInterface.h b/offload/plugins-nextgen/common/include/PluginInterface.h
index 8c530bb..f9bff9a 100644
--- a/offload/plugins-nextgen/common/include/PluginInterface.h
+++ b/offload/plugins-nextgen/common/include/PluginInterface.h
@@ -1066,6 +1066,10 @@ struct GenericDeviceTy : public DeviceAllocatorTy {
bool useAutoZeroCopy();
virtual bool useAutoZeroCopyImpl() { return false; }
+ /// Returns true if the plugin can guarantee that the associated
+ /// storage is accessible
+ Expected<bool> isAccessiblePtr(const void *Ptr, size_t Size);
+
virtual Expected<omp_interop_val_t *>
createInterop(int32_t InteropType, interop_spec_t &InteropSpec) {
return nullptr;
@@ -1166,6 +1170,10 @@ private:
/// Per device setting of MemoryManager's Threshold
virtual size_t getMemoryManagerSizeThreshold() { return 0; }
+ virtual Expected<bool> isAccessiblePtrImpl(const void *Ptr, size_t Size) {
+ return false;
+ }
+
/// Environment variables defined by the OpenMP standard.
Int32Envar OMP_TeamLimit;
Int32Envar OMP_NumTeams;
@@ -1492,6 +1500,9 @@ public:
/// Returns if the plugin can support automatic copy.
int32_t use_auto_zero_copy(int32_t DeviceId);
+ /// Returns if the associated storage is accessible for a given device.
+ int32_t is_accessible_ptr(int32_t DeviceId, const void *Ptr, size_t Size);
+
/// Look up a global symbol in the given binary.
int32_t get_global(__tgt_device_binary Binary, uint64_t Size,
const char *Name, void **DevicePtr);