From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112866 invoked by alias); 21 Jul 2015 09:51:40 -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 112811 invoked by uid 89); 21 Jul 2015 09:51:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS 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; Tue, 21 Jul 2015 09:51:34 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 46BF58E3F0; Tue, 21 Jul 2015 09:51:33 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-51.ams2.redhat.com [10.36.116.51]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6L9pVEF030456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Jul 2015 05:51:32 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t6L9pTdh028359; Tue, 21 Jul 2015 11:51:30 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t6L9pRtB028358; Tue, 21 Jul 2015 11:51:27 +0200 Date: Tue, 21 Jul 2015 09:59:00 -0000 From: Jakub Jelinek To: Nathan Sidwell , Ilya Verbin Cc: Thomas Schwinge , GCC Patches Subject: Re: fix gomp offload routine unloading Message-ID: <20150721095127.GG1780@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <55AD7F87.6020204@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55AD7F87.6020204@acm.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg01721.txt.bz2 On Mon, Jul 20, 2015 at 07:08:55PM -0400, Nathan Sidwell wrote: > 2015-07-20 Nathan Sidwell > > libgomp/ > * target.c (gomp_offload_image_to_device): Rename to ... > (gomp_load_image_to_device): ... here. > (GOMP_offload_register): Adjust call. > (gomp_init_device): Likewise. > (gomp_unload_image_from_device): New. Broken out of ... > (GOMP_offload_unregister): ... here. Call it. > (gomp_unload_device): New. > * libgomp.h (gomp_unload_device): Declare. > * oacc-init.c (acc_shutdown_1): Unload from device before deleting > mem maps. > > gcc/ > * config/nvptx/mkoffload.c (process): Add destructor call. Ok if also tested on Intel MIC, with a few changes: > + /* Find mapping at start of node array */ > + if (num_funcs || num_vars) > + { > + k.host_start = num_funcs ? (uintptr_t) host_func_table[0] : (uintptr_t) host_var_table[0]; Too long line, please wrap it. > + if (devicep->type == target_type && devicep->is_initialized) > + gomp_unload_image_from_device(devicep, host_table, target_data); Space before (. Jakub