This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Openacc launch API


Ping?

On 09/11/15 11:50, Nathan Sidwell wrote:
Ping?

https://gcc.gnu.org/ml/gcc-patches/2015-08/msg01498.html



On 09/07/15 08:48, Nathan Sidwell wrote:
On 08/25/15 09:29, Nathan Sidwell wrote:
Jakub,

This patch changes the launch API for openacc parallels.  The current scheme
passes the launch dimensions as 3 separate parameters to the GOACC_parallel
function.  This is problematic for a couple of reasons:

1) these must be validated in the host compiler

2) they provide no extension to support a variety of different offload devices
with different geometry requirements.

This patch changes things so that the function tables emitted by (ptx)
mkoffloads includes the geometry triplet for each function.  This allows them to
be validated and/or manipulated in the offload compiler.  However, this only
works for compile-time known dimensions -- which is a common case.  To deal with
runtime-computed dimensions we have to retain the host-side compiler's
calculation and pass that into the GOACC_parallel function.  We change
GOACC_parallel to take a variadic list of keyed operands ending with a sentinel
marker.  These keyed operands have a slot for expansion to support multiple
different offload devices.

We also extend the functionality of the 'oacc function' internal attribute.
Rather than being a simple marker, it now has a value, which is a TREE_LIST of
the geometry required.  The geometry is held as INTEGER_CSTs on the TREE_VALUE
slots.  Runtime-calculated values are represented by an INTEGER_CST of zero.
We'll also use this representation for  'routines', where the TREE_PURPOSE slot
will be used to indicate the levels at which a routine might spawn a partitioned
loop.  Again, to allow future expansion supporting a number of different offload
devices, this can become a list-of-lists, keyed by and offload device
identifier.  The offload  compiler can manipulate this data, and a later patch
will do this within a new oacc-xform pass.

I  did rename the GOACC_parallel entry point to GOACC_parallel_keyed and provide
a forwarding function. However, as the mkoffload data is incompatible, this is
probably overkill.  I've had to increment the (just committed) version number to
detect the change in data representation.  So any attempt to run an old binary
with a new libgomp will fail at the loading point.  We could simply keep the
same 'GOACC_parallel' name and not need any new symbols.  WDYT?

Ping?

https://gcc.gnu.org/ml/gcc-patches/2015-08/msg01498.html

nathan





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]