From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35092 invoked by alias); 24 Aug 2015 18:56:59 -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 35083 invoked by uid 89); 24 Aug 2015 18:56:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f169.google.com Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 24 Aug 2015 18:56:57 +0000 Received: by widdq5 with SMTP id dq5so59059118wid.1 for ; Mon, 24 Aug 2015 11:56:55 -0700 (PDT) X-Received: by 10.194.82.167 with SMTP id j7mr43158522wjy.123.1440442615002; Mon, 24 Aug 2015 11:56:55 -0700 (PDT) Received: from msticlxl57.ims.intel.com (fmdmzpr01-ext.fm.intel.com. [192.55.54.36]) by smtp.gmail.com with ESMTPSA id op6sm15696806wic.12.2015.08.24.11.56.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Aug 2015 11:56:54 -0700 (PDT) Date: Mon, 24 Aug 2015 19:10:00 -0000 From: Ilya Verbin To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, Kirill Yukhin Subject: Re: [gomp4.1] Initial support for some OpenMP 4.1 construct parsing Message-ID: <20150824185636.GA58465@msticlxl57.ims.intel.com> References: <874mnzrw1z.fsf@schwinge.name> <20150429120644.GG1751@tucnak.redhat.com> <20150609183608.GA47936@msticlxl57.ims.intel.com> <20150609202426.GG10247@tucnak.redhat.com> <20150625194529.GB33078@msticlxl57.ims.intel.com> <20150625201058.GK10247@tucnak.redhat.com> <20150717163136.GB15252@msticlxl57.ims.intel.com> <20150717164306.GT1780@tucnak.redhat.com> <20150720185342.GA350@msticlxl57.ims.intel.com> <20150824122657.GJ9425@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150824122657.GJ9425@tucnak.redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg01458.txt.bz2 On Mon, Aug 24, 2015 at 14:26:57 +0200, Jakub Jelinek wrote: > On Mon, Jul 20, 2015 at 09:53:42PM +0300, Ilya Verbin wrote: > > Latest liboffloadmic (I'm preparing an update for trunk) can take some pointer > > *ptr* as argument of __offload_offload, which is used for execution and data > > transfer. When given job is finished, it will call some callback in libgomp on > > host, passing *ptr* back to it, thus libgomp can distinguish which job has > > been finished. BTW, which word to use here to avoid confusion? (task? job?) > > > > I'm going to prototype something in libgomp using this interface. > > Based on the recent largish thread on omp-lang, it seems that the intent > is that depend clause on target* constructs is for an implicit "target task" > on the host side, so sorry for understanding it as dependencies on the > implicit task on the device instead before. As the "target task" is > supposed to be merged (i.e. sharing ICVs and variables), for > constructs without nowait and depend clauses we can do what we do right now, > perhaps later with some optimizations trying to invoke other tasks if > waiting for the hardware. I just got back from vacation, and trying to understand that conversation :) > For target* constructs with nowait and/or depend clauses, we'll need to pass > in the depend info (which is a pointer to array of addresses, with first > "address" being total count and second "address" being number of out/inout > dependencies at the beginning, and whether nowait is present or not (a bit > somewhere), then create some struct gomp_task for it supposedly with a new > GOMP_TASK_TARGET kind, and handle the dependency waiting etc. like for other > tasks, except that it will not have a real body, but saved arguments from > the GOMP_target* call (at least for not immediately > satisfied dependency my understanding from the mail thread is that > the data transfer operations are supposed to start only when the dependency > is met). So, what will happen with a target task on the host when all dependencies are satisfied and it is ready to start? As I understood: * libgomp will call GOMP_OFFLOAD_run with a new 'async' argument, or a new function GOMP_OFFLOAD_run_async, which will start target function on the device and immediately return control to libgomp. * The task will go into some pending state, allowing to run another tasks on the host (I'm not very familiar with task.c yet). * When target function is finished, the target runtime library will notify libgomp by callback. libgomp will remove the task and make dependent tasks (if any) ready to start. Is this correct? -- Ilya