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: [gomp4] various OpenACC/PTX built-ins and a reduction tweak


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


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