This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][CUDA] Add resource pool for CUevent
ClosedPublic

Authored by tianshilei1992 on Dec 27 2021, 9:31 AM.

Details

Summary

Following D111954, this patch adds the resource pool for CUevent.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Dec 27 2021, 9:31 AM
tianshilei1992 requested review of this revision.Dec 27 2021, 9:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 27 2021, 9:31 AM
ye-luo added inline comments.Dec 27 2021, 1:02 PM
openmp/libomptarget/plugins/cuda/src/rtl.cpp
335–336

This line probably can be removed.

339

Why this pool needs to be unique_ptr?

574

Probably ResourcePoolTy::clear() is a method worth being added.

tianshilei1992 marked an inline comment as done.Dec 27 2021, 8:34 PM
tianshilei1992 added inline comments.
openmp/libomptarget/plugins/cuda/src/rtl.cpp
335–336

Right. I'll remove it as well as other .reset() in another NFC patch.

tianshilei1992 marked an inline comment as done.

rebase and fix comments

tianshilei1992 marked 2 inline comments as done.Dec 27 2021, 8:55 PM
ye-luo added inline comments.Dec 27 2021, 10:32 PM
openmp/libomptarget/plugins/cuda/src/rtl.cpp
492

Need to be 0 instead of 8. Otherwise resize() happens before cuInit().

tianshilei1992 added inline comments.Dec 28 2021, 7:00 AM
openmp/libomptarget/plugins/cuda/src/rtl.cpp
492

Oh, that is the reason I used unique_ptr before.

rebase and fix comments

tianshilei1992 marked an inline comment as done.Dec 28 2021, 1:14 PM
ye-luo accepted this revision.Dec 28 2021, 2:26 PM

LGTM

This revision is now accepted and ready to land.Dec 28 2021, 2:26 PM
This revision was automatically updated to reflect the committed changes.