[Openmp-commits] [PATCH] D77005: [OpenMP] Optimized stream selection by scheduling data mapping for the same target region into a same stream
Shilei Tian via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Sat Mar 28 19:20:50 PDT 2020
tianshilei1992 created this revision.
tianshilei1992 added reviewers: jdoerfert, ye-luo.
tianshilei1992 added a project: OpenMP.
Herald added subscribers: openmp-commits, guansong.
This patch introduces two things for offloading:
1. Asynchronous data transferring: those functions are suffix with `_async`. They have one more argument compared with their synchronous counterparts: `__tgt_async_info*`, which is a new struct that only has one field, `void *Identifier`. This struct is for information exchange between different asynchronous operations. It can be used for stream selection, like in this case, or operation synchronization, which is also used. We may expect more usages in the future.
2. Optimization of stream selection for data mapping. Previous implementation was using asynchronous device memory transfer but synchronizing after each memory transfer. Actually, if we say kernel A needs four memory copy to device and two memory copy back to host, then we can schedule these seven operations (four H2D, two D2H, and one kernel launch) into a same stream and just need synchronization after memory copy from device to host. In this way, we can save a huge overhead compared with synchronization after each operation.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D77005
Files:
openmp/libomptarget/include/omptarget.h
openmp/libomptarget/include/omptargetplugin.h
openmp/libomptarget/plugins/cuda/src/rtl.cpp
openmp/libomptarget/plugins/exports
openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp
openmp/libomptarget/src/device.cpp
openmp/libomptarget/src/device.h
openmp/libomptarget/src/omptarget.cpp
openmp/libomptarget/src/private.h
openmp/libomptarget/src/rtl.cpp
openmp/libomptarget/src/rtl.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77005.253393.patch
Type: text/x-patch
Size: 26893 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200329/08e1f1f0/attachment-0001.bin>
More information about the Openmp-commits
mailing list