[Openmp-commits] [PATCH] D96438: [OpenMP] Move synchronization into	`__tgt_async_info`
    Shilei Tian via Phabricator via Openmp-commits 
    openmp-commits at lists.llvm.org
       
    Wed Feb 10 10:39:31 PST 2021
    
    
  
tianshilei1992 added inline comments.
================
Comment at: openmp/libomptarget/include/omptarget.h:128
 /// operations for device-dependent optimization and potential synchronization
 struct __tgt_async_info {
+  /// Synchronize the queue with \p Device, if necessary, and resets it to
----------------
I suggest we wrap this info into another class, and bind the device object such that we will make sure that the async info object will not be synced by a wrong device.
```
class AsyncInfo {
  __tgt_async_info TheInfo;
  DeviceTy &Device;
public:
  int synchronize();
};
```
Then `__tgt_async_info` is only used when we're communicating with plugin. `AsyncInfo` is used across the whole `libomptarget`.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96438/new/
https://reviews.llvm.org/D96438
    
    
More information about the Openmp-commits
mailing list