Skip to content

Commit 53bcadb

Browse files
author
fel-cab
committed
Adding kernel function name to the slice name
1 parent 3561461 commit 53bcadb

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

openmp/libomptarget/src/interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ targetData(ident_t *Loc, int64_t DeviceId, int32_t ArgNum, void **ArgsBase,
7979
static_assert(std::is_convertible_v<TargetAsyncInfoTy, AsyncInfoTy>,
8080
"TargetAsyncInfoTy must be convertible to AsyncInfoTy.");
8181

82-
TIMESCOPE_WITH_DETAILS_AND_IDENT("Runtime: Data Copy",
82+
TIMESCOPE_WITH_DETAILS_AND_IDENT("Runtime Data Copy:",
8383
"NumArgs=" + std::to_string(ArgNum), Loc);
8484

8585
DP("Entering data %s region for device %" PRId64 " with %d mappings\n",
@@ -274,7 +274,7 @@ static inline int targetKernel(ident_t *Loc, int64_t DeviceId, int32_t NumTeams,
274274
!KernelArgs->ThreadLimit[1] && !KernelArgs->ThreadLimit[2] &&
275275
"OpenMP interface should not use multiple dimensions");
276276
TIMESCOPE_WITH_DETAILS_AND_IDENT(
277-
"Runtime target exe",
277+
"Runtime target exe:",
278278
"NumTeams=" + std::to_string(NumTeams) +
279279
";NumArgs=" + std::to_string(KernelArgs->NumArgs),
280280
Loc);

openmp/libomptarget/src/omptarget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ int targetDataBegin(ident_t *Loc, DeviceTy &Device, int32_t ArgNum,
575575
(ArgTypes[I] & OMP_TGT_MAPTYPE_PRIVATE))
576576
continue;
577577
TIMESCOPE_WITH_DETAILS_AND_IDENT(
578-
"HostToDev", "Size=" + std::to_string(ArgSizes[I]) + "B", Loc);
578+
"HostToDev:", "Size=" + std::to_string(ArgSizes[I]) + "B", Loc);
579579
if (ArgMappers && ArgMappers[I]) {
580580
// Instead of executing the regular path of targetDataBegin, call the
581581
// targetDataMapper variant which will call targetDataBegin again
@@ -951,7 +951,7 @@ int targetDataEnd(ident_t *Loc, DeviceTy &Device, int32_t ArgNum,
951951
DP("Moving %" PRId64 " bytes (tgt:" DPxMOD ") -> (hst:" DPxMOD ")\n",
952952
DataSize, DPxPTR(TgtPtrBegin), DPxPTR(HstPtrBegin));
953953
TIMESCOPE_WITH_DETAILS_AND_IDENT(
954-
"DevToHost", "Size=" + std::to_string(DataSize) + "B", Loc);
954+
"DevToHost:", "Size=" + std::to_string(DataSize) + "B", Loc);
955955
// Wait for any previous transfer if an event is present.
956956
if (void *Event = TPR.getEntry()->getEvent()) {
957957
if (Device.waitEvent(Event, AsyncInfo) != OFFLOAD_SUCCESS) {
@@ -1667,7 +1667,7 @@ int target(ident_t *Loc, DeviceTy &Device, void *HostPtr,
16671667
{
16681668
assert(KernelArgs.NumArgs == TgtArgs.size() && "Argument count mismatch!");
16691669
TIMESCOPE_WITH_DETAILS_AND_IDENT(
1670-
"Kernel Target",
1670+
"Kernel Target:",
16711671
"NumArguments=" + std::to_string(KernelArgs.NumArgs) +
16721672
";NumTeams=" + std::to_string(KernelArgs.NumTeams[0]) +
16731673
";TripCount=" + std::to_string(KernelArgs.Tripcount),

openmp/libomptarget/src/private.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,9 @@ class ExponentialBackoff {
449449
#define TIMESCOPE_WITH_DETAILS_AND_IDENT(RegionTypeMsg, Details, IDENT) \
450450
SourceInfo SI(IDENT); \
451451
std::string ProfileLocation = SI.getProfileLocation(); \
452-
llvm::TimeTraceScope TimeScope(RegionTypeMsg, ProfileLocation + Details)
452+
std::string kernelName = SI.getName(); \
453+
llvm::TimeTraceScope TimeScope(RegionTypeMsg+kernelName, \
454+
ProfileLocation + Details)
453455
#define TIMESCOPE_WITH_DETAILS(Details) \
454456
llvm::TimeTraceScope TimeScope(__FUNCTION__, Details)
455457
#else

0 commit comments

Comments
 (0)