This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP][NVPTX]Fixed initialization of the data-sharing interface.
ClosedPublic

Authored by ABataev on Dec 27 2018, 6:54 AM.

Details

Summary

Avoid using of the atomic loop to wait for the completion of the
data-sharing interface initialization, use __shfl_sync instead for the
communication within the warp to signal other threads in the warp about
completion of the initialization.

Event Timeline

ABataev created this revision.Dec 27 2018, 6:54 AM
grokos added inline comments.Dec 27 2018, 8:11 AM
libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
449

Isn't FrameP always 8-bytes long?

ABataev marked an inline comment as done.Dec 27 2018, 8:12 AM
ABataev added inline comments.
libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
449

What if the architecture is 32 bits?

grokos accepted this revision.Dec 27 2018, 4:19 PM
grokos added inline comments.
libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
449

That would be true if we compiled the RTL on a 32-bit host system, but - at least at the moment - only 64-bit hosts are supported by libomptarget (x86_64, ppc64, aarch64). So the 32-bit case is unreachable, although admittedly it doesn't hurt to have this discrimination here as a safeguard for the future. On the other hand, how probable is it that we will ever support 32-bit systems? Anyway, the patch looks good, I'm leaving it up to you to decide whether the 32-bit scenario should be considered here.

This revision is now accepted and ready to land.Dec 27 2018, 4:19 PM
This revision was automatically updated to reflect the committed changes.