[gomp4] remove goacc locking

Nathan Sidwell nathan@acm.org
Thu Oct 1 12:28:00 GMT 2015


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



More information about the Gcc-patches mailing list