[Openmp-commits] [PATCH] D62393: [OPENMP][NVPTX]Mark parallel level counter as volatile.
Artem Belevich via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Jun 13 10:48:35 PDT 2019
tra added a comment.
In D62393#1542098 <https://reviews.llvm.org/D62393#1542098>, @__simt__ wrote:
> In D62393#1542042 <https://reviews.llvm.org/D62393#1542042>, @tra wrote:
> > C++ volatile will give you that. You also rely on atomicity. C++ volatile does not guarantee that, even if NVPTX does happen to. It's a mere coincidence. What if next PTX revision provides a better way to implement C++ volatile without providing atomicity? Then your code will all of a sudden break in new and exciting ways.
> I think it's completely healthy and fair to be skeptical that we'll do the right thing by you, but FWIW the changes I want to make to CUDA `volatile` after we ship `std::atomic<T>` go in the other direction. And the legacy requirements are pretty entrenched here, too.
I didn't mean this to be a critical statement. I apologize if it came out as such. The example was purely hypothetical to illustrate the point that one should not assume that a C++ qualifier will always do what C++ standard does not guarantee.
CHANGES SINCE LAST ACTION
More information about the Openmp-commits