[Openmp-commits] [openmp] [OpenMP][libomptarget] Enable automatic unified shared memory executi… (PR #75999)

via Openmp-commits openmp-commits at lists.llvm.org
Wed Dec 20 07:38:35 PST 2023

@@ -208,6 +213,13 @@ struct PluginManager {
   /// Devices associated with plugins, accesses to the container are exclusive.
   ProtectedObj<DeviceContainerTy> Devices;
+  /// Whe running on an APU, the GPU plugin may decide to
+  /// run in zero-copy even though the user did not program
+  /// their application with unified_shared_memory requirement.
+  /// This execution modality is called auto zero-copy and it is
+  /// cached information from the Plugin.
+  bool UseAutoZeroCopy = false;
carlobertolli wrote:

Fair enough: I do not have such a card to test against, but it is conceivable that someone will eventually have it. What I am thinking is a check on every device in the system to see if they are all an APU and would turn auto zero-copy on, then we turn it on in libomptarget. If one or more of the devices is not an APU, then it will return false to the query and we will not do auto zero-copy.
I think this should cover any future arch and we can think about mixing and matching based on the device num that is passed to getTargetPointer and getTgtPtr in a later patch.


More information about the Openmp-commits mailing list