This patch fixed the issue that target memory might be deallocated when
they're still being used or before they're used.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for fixing the bug. It should be good for the moment.
When I think about the existence of recursive mapper, we may still have more sync than needed. I think recursion the whole targetDataBegin/targetDataEnd is convenient but sub-optimal choice.
Recursion should only be done on the map/mapper analysis. Just leave my thoughts here. It needs a discussion beyond this patch.
openmp/libomptarget/src/omptarget.cpp | ||
---|---|---|
606 | If targetDataEnd is not called from target. At the end of target(), the synchronize needs to check AsyncInfo->Queue. |
openmp/libomptarget/src/omptarget.cpp | ||
---|---|---|
606 | There is no need to synchronize at the end of target. I forgot to remove it. |
Recursive mapper does introduce a lot of synchronization overhead as it passes nullptr to those functions, therefore in the plugin, it will first fetch a new stream, enqueue the operation, and synchronize. The whole mapper is using "synchronous" operations.
openmp/libomptarget/src/omptarget.cpp | ||
---|---|---|
606 | I added some check here. Nice catch. |
[Drive By]
openmp/libomptarget/src/omptarget.cpp | ||
---|---|---|
434 | Please use proper names even for argument. Also add doxygen comments to all members. |
Please use proper names even for argument. Also add doxygen comments to all members.