From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86521 invoked by alias); 4 Dec 2019 11:18:31 -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 86512 invoked by uid 89); 4 Dec 2019 11:18:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=corroborated, HX-Languages-Length:2079 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Dec 2019 11:18:28 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 9B38681387; Wed, 4 Dec 2019 12:18:26 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1muna3VEUXYA; Wed, 4 Dec 2019 12:18:26 +0100 (CET) Received: from lacambre-Precision-7540 (cambria105.c.subnet.rcn.com [207.237.145.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id F189981385; Wed, 4 Dec 2019 12:18:25 +0100 (CET) Date: Wed, 04 Dec 2019 11:18:00 -0000 From: Ghjuvan Lacambre To: Thomas Schwinge Cc: Olivier Hainque , Pierre-Marie de Rodat , gcc-patches@gcc.gnu.org Subject: Re: [Ada] Gigi support for OpenACC pragmas Message-ID: <20191204111730.q6uhh7guu75mvcml@lacambre-Precision-7540> References: <20181203155044.GA28253@adacore.com> <87zhg8xwv3.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Description: elete-pattern>~=elete-pattern>~= Content-Disposition: inline In-Reply-To: <87zhg8xwv3.fsf@euler.schwinge.homeip.net> X-SW-Source: 2019-12/txt/msg00200.txt.bz2 On 2019-12-04, 10:29:04, Thomas Schwinge wrote: >> --- gcc/ada/gcc-interface/trans.c >> +++ gcc/ada/gcc-interface/trans.c >> @@ -1309,6 +1533,274 @@ Pragma_to_gnu (Node_Id gnat_node) >> + case Name_Copy: >> + map_kind = GOMP_MAP_FORCE_TOFROM; >> + gnu_clauses = Iterate_Acc_Clause_Arg (gnat_expr, gnu_clauses, >> + Acc_Data_to_gnu, >> + &map_kind); >> + break; >> + >> + case Name_Copy_In: >> + map_kind = GOMP_MAP_FORCE_TO; >> + gnu_clauses = Iterate_Acc_Clause_Arg (gnat_expr, gnu_clauses, >> + Acc_Data_to_gnu, >> + &map_kind); >> + break; >> + >> + case Name_Copy_Out: >> + map_kind = GOMP_MAP_FORCE_FROM; >> + gnu_clauses = Iterate_Acc_Clause_Arg (gnat_expr, gnu_clauses, >> + Acc_Data_to_gnu, >> + &map_kind); >> + break; > >> + case Name_Create: >> + map_kind = GOMP_MAP_FORCE_ALLOC; >> + gnu_clauses = Iterate_Acc_Clause_Arg (gnat_expr, gnu_clauses, >> + Acc_Data_to_gnu, >> + &map_kind); >> + break; > >What's the rationale for using here the 'FORCE' mapping kind variants >instead of 'GOMP_MAP_TOFROM', 'GOMP_MAP_TO', 'GOMP_MAP_FROM', >'GOMP_MAP_ALLOC', as demanded starting with the OpenACC 2.5 revision >(default 'present_or_*' behavior)? Hello Thomas. I wrote this code a year and half ago so I don't remember exactly. From what I found in my notes, it seems like when I started working on this, the GCC version I worked with only supported OpenACC 2.0, which might explain why I used 'FORCE' here (this is corroborated by the OpenACC wiki page that mentions that GCC 7/8 only supported OpenAcc 2.0: https://gcc.gnu.org/wiki/OpenACC ). I haven't worked on this since then so that's probably why this hasn't been updated to support newer map kinds. It's also entirely possible that I simply made a mistake, I inferred most of what I know about supporting OpenACC in the GNAT frontend by reading what gcc's C and Fortran frontends did. Perhaps I didn't look at the right piece of code/was looking at an old piece of code. Thanks for taking a look at GNAT's OpenACC implementation and feel free to ask more questions :).