From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17643 invoked by alias); 17 Sep 2014 14:12:09 -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 17619 invoked by uid 89); 17 Sep 2014 14:12:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 17 Sep 2014 14:12:07 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1XUFxi-0000e7-Tw from Cesar_Philippidis@mentor.com ; Wed, 17 Sep 2014 07:12:02 -0700 Received: from [127.0.0.1] (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.181.6; Wed, 17 Sep 2014 07:12:02 -0700 Message-ID: <541996B1.5020808@codesourcery.com> Date: Wed, 17 Sep 2014 14:12:00 -0000 From: Cesar Philippidis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Jakub Jelinek , Tobias Burnus CC: , , Thomas Schwinge Subject: Re: [gomp4] various OpenACC/PTX built-ins and a reduction tweak References: <5418D6B6.40801@codesourcery.com> <20140917084411.GA12930@physik.fu-berlin.de> <20140917084954.GB17454@tucnak.redhat.com> In-Reply-To: <20140917084954.GB17454@tucnak.redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-SW-Source: 2014-09/txt/msg01371.txt.bz2 On 09/17/2014 01:49 AM, Jakub Jelinek wrote: > 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. All of the functions are internal except for acc_on_device. We do have a proper interface for it, but it's part of the libgomp runtime. Should I remove acc_on_device from this patch until the runtime is ready? >> 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. All of the GOACC_* functions introduced in this patch are internal functions without library functions, although that may change for GOACC_get_thread_num and GOACC_get_num_threads. Is there a better way to handle internal functions or is it correct as-is? I'm not that familiar with built-in functions. >> 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. Cesar