This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4] various OpenACC/PTX built-ins and a reduction tweak
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- Cc: Cesar Philippidis <cesar at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org, Thomas Schwinge <thomas at codesourcery dot com>
- Date: Wed, 17 Sep 2014 10:49:54 +0200
- Subject: Re: [gomp4] various OpenACC/PTX built-ins and a reduction tweak
- Authentication-results: sourceware.org; auth=none
- References: <5418D6B6 dot 40801 at codesourcery dot com> <20140917084411 dot GA12930 at physik dot fu-berlin dot de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Sep 17, 2014 at 10:44:12AM +0200, Tobias Burnus wrote:
> Cesar Philippidis wrote:
> > The patch introduces the following OpenACC/PTX-specific built-ins:
> ...
>
> It is not completely clear how they are supposed to get used. Should the
> user call them directly in some cases? Or are they only used internally?
>
> acc_on_device sounds like a function which would be in C/C++ made available
> to the user via #define acc_on_device __builtin_acc_on_device.
And not just providing acc_on_device prototype in some header? Without
looking at the OpenACC standard, it sounds like this function could be
similar to omp_is_initial_device, so can and should be handled supposedly
similarly.
>
> However, the rest looks as if it should rather be an internal function
> instead of a builtin. Or should the user really ever call the builtin
> directly?
GOMP_* functions are builtins and not internal functions too, all those
functions are library functions, while the user typically doesn't call them
directly, they still are implemented in the library. Internal functions are
used for something that doesn't have a library implementation and is not
something user can call directly.
> Regarding Fortran: Builtins aren't directly available to the user. You have to
> wrap them into an intrinsic to make them available. If they have to be made
> available via a module (e.g. via "module acc) - you have to create a virtual
> module, which provides the intrinsic. If you don't want to convert the whole
> module, you could create an auxiliar module (e.g. acc_internal_) which provides
> only those bits - and then include it ("use,intrinsic :: ...") it in the
> main module - written in normal Fortran.
For the user callable fortran functions, for OpenMP libgomp just provides
*_ entrypoints to * functions. Perhaps acc_on_device_ could be provided
too.
Jakub