This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget] [amdgpu] Added LDS usage to the kernel trace
ClosedPublic

Authored by dhruvachak on May 24 2021, 5:47 PM.

Diff Detail

Event Timeline

dhruvachak created this revision.May 24 2021, 5:47 PM
dhruvachak requested review of this revision.May 24 2021, 5:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2021, 5:47 PM
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
1791

would you mind drive-by fixing the declare - brace - mutate construct while you're in the area? I.e. replace the nested block with

const auto kernelInfo = KernelInfoTable[device_id][kernel_name];
const uint32_t group_segment_size = kernelInfo.group_segment_size;
const uint32_t sgpr_count = kernelInfo.sgpr_count;
...

or just use kernelInfo.group_segment_size etc directly, not sure the local name helps readability much

1862

this is a bit odd - have already done the lookup, and stored the fields in local variables, that could be written directly into the packet-> fields above

JonChesterfield accepted this revision.May 24 2021, 6:55 PM

no objection to the functional change, would be good to refactor the local weirdness in passing

This revision is now accepted and ready to land.May 24 2021, 6:55 PM
dhruvachak added inline comments.May 24 2021, 7:24 PM
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
1791

I agree that we can use some cleanup here. I intend to use some of these variables in computing the launch values. Let's revisit the cleanup after that change.

1862

Because the iterator is in a different scope, it is gone, so needs to do a lookup again. Let's do all these cleanups in a different commit.

This revision was landed with ongoing or failed builds.May 24 2021, 7:34 PM
This revision was automatically updated to reflect the committed changes.

Refactoring separately is good, but only works in practice if it's done first. Otherwise the refactor usually gets forgotten, or replaced with something higher priority, and that is the path to entropy.

E.g. D103037 had a suggestion for eliminating the class of typos it was fixing, but as it wasn't done first or simultaneously, there's a reasonable chance it's been forgotten in favour of this line of patches.

Please do the cleanups before landing the associated patch, or inline with it if they are small.

openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
1862

Yes, but the separate scope is just braces. I was suggesting removing the braces.

foad removed a subscriber: foad.May 25 2021, 5:19 AM