This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP][AMDGCN] Improvements to print_kernel_trace (bit mask)
ClosedPublic

Authored by ronlieb on Feb 18 2021, 2:28 PM.

Details

Summary
allow bit masking to select various trace features.
  bit 0 => Launch tracing           (stderr)
  bit 1 => timing of runtime        (stdout)
  bit 2 => detailed launch tracing  (stderr)
  bit 3 => timing goes to stdout instead of stderr

  example: LIBOMPTARGET_KERNEL_TRACE=7     does it all
           LIBOMPTARGET_KERNEL_TRACE=5     Launch + details
           LIBOMPTARGET_KERNEL_TRACE=2     timings + launch to stderr
           LIBOMPTARGET_KERNEL_TRACE=10    timings + launch to stdout

Diff Detail

Event Timeline

ronlieb created this revision.Feb 18 2021, 2:28 PM
ronlieb requested review of this revision.Feb 18 2021, 2:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2021, 2:28 PM
JonChesterfield accepted this revision.Feb 18 2021, 2:40 PM

Enums are a good idea here, thanks.

This revision is now accepted and ready to land.Feb 18 2021, 2:40 PM
jdoerfert added inline comments.Feb 18 2021, 2:46 PM
openmp/libomptarget/plugins/amdgpu/src/print_tracing.h
2

license missing

14

This doesn't seem clang formated.

ronlieb updated this revision to Diff 324791.Feb 18 2021, 3:24 PM

added license, and clang-format-ed new file

pdhaliwal accepted this revision.Feb 18 2021, 5:38 PM

Looks good to me. Thanks!

ronlieb marked 2 inline comments as done.Feb 19 2021, 2:59 AM

@jdoerfert acceptable?

Not Johannes, but probably yes. Wonder if we're missing the license header on other files in this plugin.

The int print_kernel_trace is a wide contract - it suggests it might be toggled from anywhere. Which it isn't. We should change to something more like the other debug/env wrapper and use a function call to access. Independent of this review - just reminded of it by seeing the raw int declaration.