Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/openmp
diff options
context:
space:
mode:
authorShilei Tian <tianshilei1992@gmail.com>2020-06-17 21:29:09 +0300
committerShilei Tian <tianshilei1992@gmail.com>2020-06-17 21:29:09 +0300
commitee1bf45e1d42d7f386d8321c3a8799476344ad91 (patch)
treeb6ff32faeb00d4e8568a407ff929d79e3829042a /openmp
parentbbf89644b5897c7d9508975c289fd861f60e0835 (diff)
[OpenMP][NFC] Added DeviceID and Event pointer to __tgt_async_info
DeviceID is added for some cases that we only have the __tgt_async_info but do not know its corresponding device id. However, to communicate with target plugins, we need that information. Event is added for another way to synchronize.
Diffstat (limited to 'openmp')
-rw-r--r--openmp/libomptarget/include/omptarget.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/openmp/libomptarget/include/omptarget.h b/openmp/libomptarget/include/omptarget.h
index de3afc36c7f2..7ba088c1996b 100644
--- a/openmp/libomptarget/include/omptarget.h
+++ b/openmp/libomptarget/include/omptarget.h
@@ -114,10 +114,14 @@ struct __tgt_target_table {
/// This struct contains information exchanged between different asynchronous
/// operations for device-dependent optimization and potential synchronization
struct __tgt_async_info {
+ // Device ID. Note that it is NOT the RTLDeviceID. We don't need to store the
+ // RTLDeviceID explicitly as we can always get it via DeviceID.
+ int DeviceID = -1;
// A pointer to a queue-like structure where offloading operations are issued.
- // We assume to use this structure to do synchronization. In CUDA backend, it
- // is CUstream.
+ // We assume to use this structure to do synchronization.
void *Queue = nullptr;
+ // A pointer to a device-dependent event used for synchronization as well.
+ void *Event = nullptr;
};
#ifdef __cplusplus