This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP, NVPTX] Fixes for NVPTX RTL
ClosedPublic

Authored by ABataev on Jun 22 2018, 6:31 AM.

Details

Summary

Patch fixes several problems in the implementation of NVPTX RTL.

  1. Detection of the last iteration for loops with static scheduling, no chunks.
  2. Fixes reductions for the serialized parallel constructs.
  3. Fixes handling of the barriers.

Diff Detail

Repository
rL LLVM

Event Timeline

ABataev created this revision.Jun 22 2018, 6:31 AM
Hahnfeld added inline comments.
libomptarget/deviceRTLs/nvptx/src/sync.cu
36–38 ↗(On Diff #152462)

Are you moving these functions for a reason? I think they are defined as extern, so there's no need to have them before calling them.

(Moving code makes reading patches very difficult, I think the only change in this file is in __kmpc_barrier, right?)

ABataev added inline comments.Jun 22 2018, 9:21 AM
libomptarget/deviceRTLs/nvptx/src/sync.cu
36–38 ↗(On Diff #152462)

Right, only __kmpc_[cancel_]barrier has changed. But it uses these generic|spmd versions and the compiler cannot see them because they are defined/declared later.

Hahnfeld added inline comments.Jun 22 2018, 9:24 AM
libomptarget/deviceRTLs/nvptx/src/sync.cu
36–38 ↗(On Diff #152462)

They are declared in interface.h which should be included from omptarget-nvptx.h, no?

ABataev added inline comments.Jun 22 2018, 9:32 AM
libomptarget/deviceRTLs/nvptx/src/sync.cu
36–38 ↗(On Diff #152462)

Ah, yes. Ok, I'll restore the original order.

ABataev updated this revision to Diff 152496.Jun 22 2018, 9:36 AM

Restored original order of the barrier functions

Sounds good to me, I'll wait for @grokos to take a look.

grokos accepted this revision.Jun 25 2018, 5:43 AM

Looks good to me, thanks for submitting those fixes!

This revision is now accepted and ready to land.Jun 25 2018, 5:43 AM
This revision was automatically updated to reflect the committed changes.