From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13153 invoked by alias); 2 Nov 2015 19:29: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 13142 invoked by uid 89); 2 Nov 2015 19:29:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Mon, 02 Nov 2015 19:29:30 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 6098C42E5A2; Mon, 2 Nov 2015 19:29:28 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-136.ams2.redhat.com [10.36.116.136]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA2JTQAn015555 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 2 Nov 2015 14:29:27 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id tA2JTNaD032490; Mon, 2 Nov 2015 20:29:24 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id tA2JTKNf032489; Mon, 2 Nov 2015 20:29:20 +0100 Date: Mon, 02 Nov 2015 19:29:00 -0000 From: Jakub Jelinek To: Julian Brown Cc: James Norris , GCC Patches , "Joseph S. Myers" , Nathan Sidwell Subject: Re: [Bulk] [OpenACC 0/7] host_data construct Message-ID: <20151102192920.GM478@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <56293476.5020801@codesourcery.com> <562A578E.4080907@codesourcery.com> <20151026183422.GW478@tucnak.redhat.com> <20151102183339.365c3d33@octopus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151102183339.365c3d33@octopus> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00111.txt.bz2 On Mon, Nov 02, 2015 at 06:33:39PM +0000, Julian Brown wrote: > As the author of the original patch, I have to say using the mapping > structures seems like a far better approach, but I've hit some trouble > with the details of adapting OpenACC to use that method. > > Firstly, on trunk at least, use_device_ptr variables are restricted to > pointer or array types: that restriction doesn't exist in OpenACC, nor > actually could I find it in the OpenMP 4.1 document (my guess is the ^^ 4.5 ;) > standards are supposed to match in this regard). I think that a program > such as this should work: > > void target_fn (int *targ_data); > > int > main (int argc, char *argv[]) > { > char out; > int myvar; > #pragma omp target enter data map(to: myvar) > > #pragma omp target data use_device_ptr(myvar) map(from:out) > { > target_fn (&myvar); > out = 5; > } > > return 0; > } You are right, I've been misreading the standard (the only testcases that have been provided with the change were using arrays and so it was non-obvious that it relies on array to pointer decay). I'll work on changing the implementation accordingly tomorrow. Jakub