This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget] Implement wavefront functions for amdgcn
ClosedPublic

Authored by JonChesterfield on Jan 20 2020, 6:12 PM.

Details

Summary

[libomptarget] Implement wavefront functions for amdgcn

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2020, 6:12 PM

Fills in some of the unresolved symbols for amdgcn target_impl with intrinsic calls. A bit architecture specific, but that seems OK in the context.

jdoerfert added a subscriber: arsenm.

The intrinsics and the computation looks a bit like black magic to me.

@arsenm Could you comment on this?

openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.hip
54

Is the argument unused on purpose? Why do we have it?

arsenm added inline comments.Jan 21 2020, 2:57 PM
openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.hip
21–22

What about wave32?

34

Wave32? WAVESIZE - 1?

JonChesterfield marked 2 inline comments as done.Jan 21 2020, 3:33 PM
JonChesterfield added inline comments.
openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.hip
21–22

Hi Matt. I didn't think we had any 32 bit warp / wavefront hardware support in tree. If we do there's some changes needed elsewhere in this library as well

54

It's used to pick out lanes to synchronise on nvptx (if I understand their documentation correctly). The lanes move in lockstep on amdgcn so I don't think there's any corresponding synchronisation to do here

JonChesterfield marked an inline comment as done.Jan 27 2020, 5:01 AM
JonChesterfield added inline comments.
openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.hip
21–22

Ah. gfx1010 has some code in clang, e.g. https://reviews.llvm.org/D63209

I'd still like to land this patch as it progresses support for most amdgcn.

I'll also start the task of supporting wave32. The complicated part is probably detecting what a given arch uses early enough to pick out the right typedef for lanemask_t.

arsenm added inline comments.Jan 27 2020, 7:31 AM
openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.hip
21–22

Putting off wave32 is fine, but might as well fix the hardcoded 63 here anyway

  • 63 => warpsize-1
JonChesterfield marked an inline comment as done.Jan 27 2020, 8:29 AM
arsenm accepted this revision.Feb 4 2020, 9:22 AM
arsenm added inline comments.
openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.hip
21

Capitalize comment

30

Capitalize comment

This revision is now accepted and ready to land.Feb 4 2020, 9:22 AM
  • initialise comments
JonChesterfield marked 3 inline comments as done.Feb 4 2020, 1:54 PM
This revision was automatically updated to reflect the committed changes.