[Openmp-commits] [PATCH] D104559: [OpenMP] Improve ref count debug messages
Joel E. Denny via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jun 23 07:09:00 PDT 2021
jdenny added inline comments.
================
Comment at: openmp/libomptarget/src/device.cpp:266-275
+ HostDataToTargetTy newEntry((uintptr_t)HstPtrBase, (uintptr_t)HstPtrBegin,
+ (uintptr_t)HstPtrBegin + Size, tp, HstPtrName);
INFO(OMP_INFOTYPE_MAPPING_CHANGED, DeviceID,
"Creating new map entry with "
- "HstPtrBegin=" DPxMOD ", TgtPtrBegin=" DPxMOD ", Size=%ld, Name=%s\n",
+ "HstPtrBegin=" DPxMOD ", TgtPtrBegin=" DPxMOD ", Size=%ld, "
+ "RefCount=%s, Name=%s\n",
DPxPTR(HstPtrBegin), DPxPTR(tp), Size,
----------------
grokos wrote:
> grokos wrote:
> > Just to restore the faster `emplace` method, we can have something like this:
> > ```
> > auto newEntry = HostDataToTargetMap.emplace(HostDataToTargetTy(base, begin,...));
> > INFO(..., newEntry.refCountToStr().c_str(), ...);
> > ```
> >
> Actually, you don't even need to create a `HostDataToTargetTy` object inside `emplace`, just call the function with the arguments directly (like in D104580):
> ```
> auto newEntry = HostDataToTargetMap.emplace(base, begin,...);
> INFO(..., newEntry.refCountToStr().c_str(), ...);
> ```
>
When I rebased before pushing, there were conflicts with D104580, which makes similar adjustments here for `emplace`. I resolved to the version in this patch because it uses LLVM's typical function argument comment style. I'm happy to push another patch to make any desired adjustments.
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