Message ID | 87612rronb.fsf@kepler.schwinge.homeip.net |
---|---|
State | New |
Headers | show |
On 10/01/15 04:14, Thomas Schwinge wrote: > Hi Nathan! > > On Mon, 28 Sep 2015 11:56:09 -0400, Nathan Sidwell <nathan@acm.org> wrote: >> I've committed this to remove the now no longer needed lock and unlock builtins >> and related infrastructure. > > If I understand correctly, it is an implementation detail of the nvptx > offloading implementation that it doesn't require such locking > primitives, but such locking may still be required for other (future) > offloading implementations, at which point something like the following > would have to be introduced again: I thought about that. Other implementations can also use the lockless idiom. There's always going to be a cmp&swap atomic, otherwise the HW is terribly designed. lock/unlock doesn't work between PTX warps, as we've discovered, and I think the same will probably be true of HSA, as that's roughly the same conceptually. If it turns out I'm wrong, these bits can always be resurrected then. The reason I originally went with lock/unlock is that it was conceptually simpler. The lockless scheme is quite straight forwards, once one understands the underlying concept. nathan
diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp index c4033e0..3a9e01d 100644 --- gcc/ChangeLog.gomp +++ gcc/ChangeLog.gomp @@ -1,3 +1,7 @@ +2015-10-01 Thomas Schwinge <thomas@codesourcery.com> + + * config/nvptx/nvptx.c (nvptx_xform_lock): Remove function. + 2015-09-30 Thomas Schwinge <thomas@codesourcery.com> * tree-cfg.c (replace_ssa_name): Revert obsolete changes. diff --git gcc/config/nvptx/nvptx.c gcc/config/nvptx/nvptx.c index e81cbba..fcebf02 100644 --- gcc/config/nvptx/nvptx.c +++ gcc/config/nvptx/nvptx.c @@ -4322,15 +4322,6 @@ nvptx_xform_fork_join (gcall *call, const int dims[], return false; } -/* Check lock & unlock. We don't reqyire any locks. */ - -static bool -nvptx_xform_lock (gcall *ARG_UNUSED (call), - const int *ARG_UNUSED (dims), unsigned ARG_UNUSED (ifn_code)) -{ - return true; -} - static tree nvptx_get_worker_red_addr (tree type, tree rid, tree lid) {