diff options
author | Shilei Tian <tianshilei1992@gmail.com> | 2020-04-11 07:08:56 -0400 |
---|---|---|
committer | Shilei Tian <tianshilei1992@gmail.com> | 2020-04-11 07:08:56 -0400 |
commit | feed674deca13fc66ee19fce9d555d1cd91535ca (patch) | |
tree | 31a7d35df3195e49651f8cf1476479f71de06285 /llvm/lib/Support/FormatVariadic.cpp | |
parent | 6aa85d5214ef4f85bc46a74c2feef204da81760e (diff) | |
download | llvm-feed674deca13fc66ee19fce9d555d1cd91535ca.zip llvm-feed674deca13fc66ee19fce9d555d1cd91535ca.tar.gz llvm-feed674deca13fc66ee19fce9d555d1cd91535ca.tar.bz2 |
[OpenMP] Introduce stream pool to make sure the correctness of device synchr...
...onization
Summary: In previous patch, in order to optimize performance, we only synchronize once
for each target region. The syncrhonization is via stream synchronization.
However, in the extreme situation, the performce might be bad. Consider the
following case: There is a task that requires transferring huge amount of data
(call many times of data transferring function). It is scheduled to the first
stream. And then we have 255 very light tasks scheduled to the remaining 255
streams (by default we have 256 streams). They can be finished before we do
synchronization at the end of the first task. Next, we get another very huge
task. It will be scheduled again to the first stream. Now the first task
finishes its kernel launch and call stream synchronization. Right now, the
stream already contains two kernels, and the synchronization will wait until the
two kernels finish instead of just the first one for the first task.
In this patch, we introduce stream pool. After each synchronization, the stream
will be returned back to the pool to make sure that for each synchronization,
only expected operations are waited.
Reviewers: jdoerfert
Reviewed By: jdoerfert
Subscribers: gregrodgers, yaxunl, lildmh, guansong, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D77412
Diffstat (limited to 'llvm/lib/Support/FormatVariadic.cpp')
0 files changed, 0 insertions, 0 deletions