From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 818 invoked by alias); 17 Sep 2014 08:50:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 797 invoked by uid 89); 17 Sep 2014 08:50:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 17 Sep 2014 08:50:04 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8H8o0iI020520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 17 Sep 2014 04:50:00 -0400 Received: from tucnak.zalov.cz (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8H8nwhZ018523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2014 04:50:00 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.8/8.14.7) with ESMTP id s8H8nuWo021703; Wed, 17 Sep 2014 10:49:57 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.8/8.14.8/Submit) id s8H8nsMW021702; Wed, 17 Sep 2014 10:49:54 +0200 Date: Wed, 17 Sep 2014 08:50:00 -0000 From: Jakub Jelinek To: Tobias Burnus Cc: Cesar Philippidis , gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org, Thomas Schwinge Subject: Re: [gomp4] various OpenACC/PTX built-ins and a reduction tweak Message-ID: <20140917084954.GB17454@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <5418D6B6.40801@codesourcery.com> <20140917084411.GA12930@physik.fu-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140917084411.GA12930@physik.fu-berlin.de> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg01336.txt.bz2 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