[Openmp-commits] [PATCH] D104559: [OpenMP] Improve ref count debug messages
Joseph Huber via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri Jun 18 11:31:29 PDT 2021
jhuber6 added a comment.
Thanks for addressing this. Please update the documentation as well `./openmp/docs/design/Runtimes.rst`.
================
Comment at: openmp/libomptarget/src/device.cpp:229
(IsImplicit ? " (implicit)" : ""), DPxPTR(HstPtrBegin), DPxPTR(tp),
- Size, (UpdateRefCount ? " updated" : ""),
- HT.isRefCountInf() ? "INF" : std::to_string(HT.getRefCount()).c_str(),
+ Size, HT.refCountToStr().c_str(), RefCountAction,
(HstPtrName) ? getNameFromMapping(HstPtrName).c_str() : "unknown");
----------------
================
Comment at: openmp/libomptarget/src/device.cpp:322
+ DPxPTR(HstPtrBegin), DPxPTR(tp), Size, HT.refCountToStr().c_str(),
+ RefCountAction);
rc = (void *)tp;
----------------
Could probably do the same here, having nested ternary might look a little silly however.
================
Comment at: openmp/libomptarget/src/device.h:92
+
+ std::string refCountToStr() const {
+ return isRefCountInf() ? "INF" : std::to_string(getRefCount());
----------------
We'll also want to do this for dumping the device table, since anything with an infinite ref count will be printed at the end of the program.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104559/new/
https://reviews.llvm.org/D104559
More information about the Openmp-commits
mailing list