This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Lower gpu.memcpy to GPU runtime calls.
ClosedPublic

Authored by csigg on Dec 14 2020, 4:12 AM.

Diff Detail

Event Timeline

csigg created this revision.Dec 14 2020, 4:12 AM
csigg requested review of this revision.Dec 14 2020, 4:12 AM
herhut added inline comments.Dec 21 2020, 6:57 AM
mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
684

This would only support vectors? Maybe use getMemrefDescriptorSizes from the LLVM lowering to compute the actual size?

csigg added inline comments.Dec 21 2020, 11:11 PM
mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
684

For identity layout (verified on line 672), stride[0]*size[0] gives the correct number of elements (stride[0] is 'product(size[1..n-1])').

getMemrefDescriptorSizes is not the right API here, you would first need to extract the dynamic sizes from the struct.

herhut accepted this revision.Dec 22 2020, 2:16 AM
herhut added inline comments.
mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
684

Ah, this is subtle. Can you leave a comment so I understand this next time round, as well? Especially as the meaning of isSupportedMemRefType is not obvious here.

This revision is now accepted and ready to land.Dec 22 2020, 2:16 AM
csigg updated this revision to Diff 313358.Dec 22 2020, 8:43 AM

Add comment.

csigg added inline comments.Dec 22 2020, 8:44 AM
mlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
684

Added comment. I've been wanting to rename isSupportedMemRefType. Will do in a separate revision.

This revision was automatically updated to reflect the committed changes.