[gomp4] add reduction lock initializer
Nathan Sidwell
nathan@acm.org
Tue Aug 25 19:18:00 GMT 2015
Cesar discovered another quirk of PTX. Inspite of PTX documenting that static
variables can be initialized and default to zero, there's a little note that it
doesn't work for .shared variables. Thus we need code to initialize the worker
lock variable used for reductions.
This implements a new internal function 'IFN_GOACC_LOCK_INIT', with the same
arguments as the LOCK and UNLOCK functions. The intent is that it is emitted at
the reduction setup point and expands to target-specific code.
For PTX it's deleted for everything but worker level, and for that we expand to
an initialization of the lock variable. We can simply use the same insn as the
unlocker, but I renamed it to be less confusing.
nathan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gomp4-lock-init.patch
Type: text/x-patch
Size: 11596 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150825/9c03a028/attachment.bin>
More information about the Gcc-patches
mailing list