This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][libomptarget] Fix data sharing and globalization infrastructure to work in SPMD mode
ClosedPublic

Authored by gtbercea on Jul 11 2018, 1:25 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

gtbercea created this revision.Jul 11 2018, 1:25 PM
gtbercea edited reviewers, added: caomhin; removed: KevinBuist.Jul 11 2018, 1:25 PM
gtbercea retitled this revision from [OpenMP] Fix data sharing and globalization infrastructure to work in SPMD mode to [OpenMP][libomptarget] Fix data sharing and globalization infrastructure to work in SPMD mode.
gtbercea updated this revision to Diff 155053.Jul 11 2018, 1:31 PM

Reset StackP correctly.

ABataev added inline comments.Jul 12 2018, 9:08 AM
libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
47 ↗(On Diff #155053)

Better to check !isSPMDMode() at first

337 ↗(On Diff #155053)

Seems to me the code is not clang-formatted

466 ↗(On Diff #155053)

You can just compare pointers as is, no need to cast

grokos added inline comments.Jul 12 2018, 9:17 AM
libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
416 ↗(On Diff #155053)

Better use SafeMalloc.

libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h
295–296 ↗(On Diff #155053)

Leftover comment from the previous implementation? In data_sharing.cu we said that for uniformity the master thread uses slots of the same size as the workers.

316 ↗(On Diff #155053)

Is master_rootS still needed? From what I understand, all threads (master and workers) now use the same slot type, that's why worker_rootS was increased in size from WARPSIZE-1 to WARPSIZE.

gtbercea marked an inline comment as done.Jul 12 2018, 10:02 AM
gtbercea added inline comments.
libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h
316 ↗(On Diff #155053)

It is for the ibm-devel data sharing. We can take this out once we deprecate/remove the "old" data sharing scheme.

gtbercea marked an inline comment as done.Jul 12 2018, 10:02 AM
gtbercea updated this revision to Diff 155253.Jul 12 2018, 12:31 PM
gtbercea marked 4 inline comments as done.

Address comments and fix formatting.

gtbercea marked an inline comment as done.Jul 12 2018, 12:36 PM
gtbercea updated this revision to Diff 155255.Jul 12 2018, 1:17 PM

Clean-up.

ABataev added inline comments.Jul 12 2018, 1:20 PM
libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
478 ↗(On Diff #155255)

USe SafeFree

grokos accepted this revision.Jul 13 2018, 2:08 AM

I don't have any further comments.

@ABataev: When you are also happy with formatting etc. please accept the patch.

This revision is now accepted and ready to land.Jul 13 2018, 2:08 AM
gtbercea updated this revision to Diff 155384.Jul 13 2018, 7:40 AM

SafeFree.

gtbercea marked an inline comment as done.Jul 13 2018, 7:41 AM
This revision was automatically updated to reflect the committed changes.