From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10562 invoked by alias); 6 Mar 2014 12:52:20 -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 10549 invoked by uid 89); 6 Mar 2014 12:52:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f171.google.com Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com) (209.85.214.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 06 Mar 2014 12:52:18 +0000 Received: by mail-ob0-f171.google.com with SMTP id wn1so2502647obc.16 for ; Thu, 06 Mar 2014 04:52:16 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.92.231 with SMTP id cp7mr265462obb.82.1394110336633; Thu, 06 Mar 2014 04:52:16 -0800 (PST) Received: by 10.182.22.137 with HTTP; Thu, 6 Mar 2014 04:52:16 -0800 (PST) In-Reply-To: <531861B3.7040007@codesourcery.com> References: <20131217113957.GA39975@msticlxl57.ims.intel.com> <52E7927B.8030509@codesourcery.com> <52E9137C.4020706@codesourcery.com> <530648F8.2010409@codesourcery.com> <5310B791.1000703@codesourcery.com> <20140305171518.GA26771@msticlxl57.ims.intel.com> <53183604.3080603@codesourcery.com> <531861B3.7040007@codesourcery.com> Date: Thu, 06 Mar 2014 12:52:00 -0000 Message-ID: Subject: Re: Fwd: [RFC][gomp4] Offloading patches (2/3): Add tables generation From: Ilya Verbin To: Bernd Schmidt Cc: Thomas Schwinge , "Michael V. Zolotukhin" , Jakub Jelinek , Richard Biener , Kirill Yukhin , Andrey Turetskiy , Ilya Tocar , gcc-patches , Nathan Sidwell Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00281.txt.bz2 2014-03-06 15:53 GMT+04:00 Bernd Schmidt : > No. I don't think we need a global constructor for registering > __OPENMP_TARGET_HOST__ - this would unnecessarily bloat crtbegin/crtend. We > also shouldn't need to have the target tables known outside of the image > constructed by the mkoffload tools. The way I imagine it, every mkoffload > tool creates its own constructor that looks like something like this: > > > __attribute__ ((constructor)) static void > init (void) > { > GOMP_offload_register_target (__OPENMP_TARGET_HOST__, > PTX_ID, ptx_target_table); > } > > That creates a mapping between host and target table for PTX_ID. If there > are multiple shared libraries with offload support, you can still obtain the > ordering you want from these GOMP_offload_register_target calls. Everything > is nicely private to the mkoffload-generated image. > > It's implemented in almost this fashion (slightly different naming and args, > and no real support in libgomp) in the patch kit I sent. OK, now I get it, this looks good. I will rewrite the patch for libgomp posted above to support this scheme. Since we will pass __OPENMP_HOST_TABLE__ to GOMP_offload_register, there is no need to pass it to GOMP_target[data/update], right? -- Ilya