From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19686 invoked by alias); 30 Sep 2015 13:27:35 -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 19585 invoked by uid 89); 30 Sep 2015 13:27:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_50,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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, 30 Sep 2015 13:27:26 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 82E6B2CAF04; Wed, 30 Sep 2015 13:27:25 +0000 (UTC) Received: from localhost.localdomain (vpn1-5-139.ams2.redhat.com [10.36.5.139]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8UDRN7B006202; Wed, 30 Sep 2015 09:27:24 -0400 Subject: Re: New OpenACC pass and Target Hook To: Nathan Sidwell , Jakub Jelinek References: <560ADA25.4000900@acm.org> Cc: GCC Patches , Cesar Philippidis From: Bernd Schmidt Message-ID: <560BE33B.2040302@redhat.com> Date: Wed, 30 Sep 2015 13:47:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <560ADA25.4000900@acm.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg02348.txt.bz2 On 09/29/2015 08:36 PM, Nathan Sidwell wrote: > This patch implements an openacc device-specific lowering pass, and an > openacc target hook for validating compute dimensions. > > The pass 'oaccdevlow' is inserted early after LTO readback. It is > active for offloaded openacc functions, and openacc routines. Currently > its only action is to validate the compute dimensions specified for an > offloaded function. > +/* Validate compute dimensions, fill in non-unity defaults. FN_LEVEL > + indicates the level at which a routine might spawn a loop. It is > + negative for non-routines. */ > + > +static bool > +nvptx_validate_dims (tree ARG_UNUSED (decl), int *ARG_UNUSED (dims), > + int ARG_UNUSED (fn_level)) The function name and/or comment should mention OpenACC, it could be confusing otherwise. I don't know what style to use for unused args now that we have C++. I'm fine with this, and it presumably will be changed anyway. > +DEFHOOK > +(validate_dims, > +"This hook should check the launch dimensions provided. It should fill\n\ > +in anything that needs to default to non-unity and verify non-defaults.\n\ > +Defaults are represented as -1. Diagnostics should be issued as\n\ > +appropriate. Return true if changes have been made. You must override\n\ > +this hook to provide dimensions larger than 1.", > +bool, (tree decl, int dims[], int fn_level), > +default_goacc_validate_dims) I feel the documentation should be expanded to say what FN_LEVEL does. I guess it's one of gang/worker/vector. Without real code to look at yet I'm left wondering how the hook would use it. It sounds like this is for both omp-low created child functions, and also for acc routine functions. That should be documented here. > +bool > +default_goacc_validate_dims (tree ARG_UNUSED (decl), int *ARG_UNUSED (dims), > + int ARG_UNUSED (fn_level)) dims is not unused in this function. Otherwise it looks ok to me. Bernd