This is an archive of the discontinued LLVM Phabricator instance.

[NVPTX] Add NVPTX intrinsics for CUDA PTX 6.5 ldmatrix instructions
ClosedPublic

Authored by steffenlarsen on Jul 29 2021, 1:45 AM.

Details

Summary

Adds NVPTX intrinsics for the CUDA PTX ldmatrix.sync.aligned instructions added in PTX 6.5.

PTX ISA description of ldmatrix.sync.aligned: https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#warp-level-matrix-instructions-ldmatrix

Authored-by: Steffen Larsen <steffen.larsen@codeplay.com>

Diff Detail

Event Timeline

steffenlarsen created this revision.Jul 29 2021, 1:45 AM
steffenlarsen requested review of this revision.Jul 29 2021, 1:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 29 2021, 1:45 AM
tra accepted this revision.Jul 29 2021, 1:47 PM

Nice!

BTW, I think it may be a good time for you to ask for LLVM commit access. llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access

llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
7919

Nit: | is redundant here, IMO.
I think [something] already reads as something is optional.

7954–7955

Nit: something is off with the indentation here.

llvm/test/CodeGen/NVPTX/wmma.py
636

x -> frag ?

This revision is now accepted and ready to land.Jul 29 2021, 1:47 PM

Adjusted for feedback.

steffenlarsen marked 2 inline comments as done and an inline comment as not done.Jul 30 2021, 1:37 AM
steffenlarsen added inline comments.
llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
7919

A similar syntax is used for wmma.load which is specified as

//
// wmma.load.[a|b|c].sync.[row|col].m16n16k16[|.global|.shared].[f16|f32]
//

a bit further up.

For this case there wouldn't be any ambiguities, but I think it's better to keep it consistent.

7954–7955

Good eye. I've fixed it.

llvm/test/CodeGen/NVPTX/wmma.py
636

Yeah, frag might make the mental mapping a bit simpler. 😄

steffenlarsen marked 2 inline comments as done.Jul 30 2021, 1:42 AM

BTW, I think it may be a good time for you to ask for LLVM commit access. llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access

I take that as an endorsement! I might need to make a new account in a couple of weeks so if you don't mind I think it would be better to wait a bit. Thank you! 😄