As a preparation patch this one cleans up the API for getTargetPointer
and getTgtPtrBegin. It also encapsulates TargetPointerResultTy properly.
The latter will become more important as we lock the entries
consistently. The former helps us to avoid inconsistencies, e.g., we
returned IsHostPointer in the Flags of the TargetPointerResultTy but
also via the boolean reference. This patch eliminates both reference
arguments.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
openmp/libomptarget/src/device.cpp | ||
---|---|---|
219 | But then I need to do manual locking again and I would like us to avoid that. |
openmp/libomptarget/src/device.cpp | ||
---|---|---|
219 | Do you have a patch with locking added? Try to understand better your intention. |
openmp/libomptarget/src/device.cpp | ||
---|---|---|
219 | I do not. Every setEntry will lock the entry and unlock the lat entry, if any. Every time TPR goes out of scope, e.g., when we give up and return an dummy object, you unlock the entry. If you do manual locking the caller needs to also unlock when TPR is destroyed, various places all across the code base. |
openmp/libomptarget/src/device.cpp | ||
---|---|---|
219 | Assuming the lock is in the entry, it makes sense. |
openmp/libomptarget/src/device.cpp | ||
---|---|---|
219 | Yes. Entry is the one with the lock. TPR is bacically a exclusive accessor with some extra information. @tianshilei1992 asked for more documentation, I will add that before I merge. |
openmp/libomptarget/src/device.cpp | ||
---|---|---|
365 | This belongs into the next patch of this series. |
three 0?