From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75601 invoked by alias); 7 Dec 2018 13:55:49 -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 75574 invoked by uid 89); 7 Dec 2018 13:55:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Relax, trans-stmt.c, transdeclc, privatize 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 ESMTP; Fri, 07 Dec 2018 13:55:46 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32186307EAA1; Fri, 7 Dec 2018 13:55:45 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-214.ams2.redhat.com [10.36.117.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 830C61A915; Fri, 7 Dec 2018 13:55:44 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id wB7Dtftu008325; Fri, 7 Dec 2018 14:55:41 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id wB7Dtevc008324; Fri, 7 Dec 2018 14:55:40 +0100 Date: Fri, 07 Dec 2018 13:55:00 -0000 From: Jakub Jelinek To: Julian Brown Cc: Bernhard Reutner-Fischer , GCC Patches , Cesar Philippidis , gfortran Subject: Re: [PATCH, OpenACC] Fortran "declare create"/allocate support for OpenACC Message-ID: <20181207135540.GJ12380@tucnak> Reply-To: Jakub Jelinek References: <20180920195908.04486d45@squid.athome> <20180921031422.5a080b4a@nbbrfq.loc> <20180921183159.2275bb0c@squid.athome> <20181004140413.2147eca1@squid.athome> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181004140413.2147eca1@squid.athome> User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00452.txt.bz2 On Thu, Oct 04, 2018 at 02:04:13PM +0100, Julian Brown wrote: > gcc/ > * omp-low.c (scan_sharing_clauses): Update handling of OpenACC declare > create, declare copyin and declare deviceptr to have local lifetimes. > (convert_to_firstprivate_int): Handle pointer types. > (convert_from_firstprivate_int): Likewise. Create local storage for > the values being pointed to. Add new orig_type argument. > (lower_omp_target): Handle GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}. > Add orig_type argument to convert_from_firstprivate_int call. > Allow pointer types with GOMP_MAP_FIRSTPRIVATE_INT. Don't privatize > firstprivate VLAs. > * tree-pretty-print.c (dump_omp_clause): Handle > GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}. > > gcc/fortran/ > * gfortran.h (enum gfc_omp_map_op): Add OMP_MAP_DECLARE_ALLOCATE, > OMP_MAP_DECLARE_DEALLOCATE. > (gfc_omp_clauses): Add update_allocatable. > * trans-array.c (gfc_array_allocate): Call > gfc_trans_oacc_declare_allocate for decls that have oacc_declare_create > attribute set. > * trans-decl.c (add_attributes_to_decl): Enable lowering of OpenACC > declare create, declare copyin and declare deviceptr clauses. > (find_module_oacc_declare_clauses): Relax oacc_declare_create to > OMP_MAP_ALLOC, and oacc_declare_copyin to OMP_MAP_TO, in order to > match OpenACC 2.5 semantics. > (finish_oacc_declare): Reset module_oacc_clauses before scanning each > namespace. > * trans-openmp.c (gfc_trans_omp_clauses): Use GOMP_MAP_ALWAYS_POINTER > (for update directive) or GOMP_MAP_FIRSTPRIVATE_POINTER (otherwise) for > allocatable scalar decls. Handle OMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE} > clauses. > (gfc_trans_oacc_executable_directive): Use GOMP_MAP_ALWAYS_POINTER > for allocatable scalar data clauses inside acc update directives. > (gfc_trans_oacc_declare_allocate): New function. > * trans-stmt.c (gfc_trans_allocate): Call > gfc_trans_oacc_declare_allocate for decls with oacc_declare_create > attribute set. > (gfc_trans_deallocate): Likewise. > * trans.h (gfc_trans_oacc_declare_allocate): Declare. > > gcc/testsuite/ > * gfortran.dg/goacc/declare-allocatable-1.f90: New test. > > include/ > * gomp-constants.h (enum gomp_map_kind): Define > GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE} and GOMP_MAP_FLAG_SPECIAL_4. > > libgomp/ > * oacc-mem.c (gomp_acc_declare_allocate): New function. > * oacc-parallel.c (GOACC_enter_exit_data): Handle > GOMP_MAP_DECLARE_{ALLOCATE,DEALLOCATE}. > * testsuite/libgomp.oacc-fortran/allocatable-array.f90: New test. > * testsuite/libgomp.oacc-fortran/allocatable-scalar.f90: New test. > * testsuite/libgomp.oacc-fortran/declare-allocatable-1.f90: New test. > * testsuite/libgomp.oacc-fortran/declare-allocatable-2.f90: New test. > * testsuite/libgomp.oacc-fortran/declare-allocatable-3.f90: New test. > * testsuite/libgomp.oacc-fortran/declare-allocatable-4.f90: New test. If Thomas is ok with this, it is fine for me. Jakub