This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] OpenACC use_device clause ICE fix
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Chung-Lin Tang <cltang at codesourcery dot com>
- Cc: Bernd Schmidt <bschmidt at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Thomas Schwinge <thomas at codesourcery dot com>, Julian Brown <julian at codesourcery dot com>
- Date: Mon, 25 Jan 2016 11:02:05 +0100
- Subject: Re: [PATCH] OpenACC use_device clause ICE fix
- Authentication-results: sourceware.org; auth=none
- References: <568BC1F5 dot 1010101 at codesourcery dot com> <569F88DD dot 7050703 at redhat dot com> <56A0E99B dot 8040206 at codesourcery dot com> <20160121153200 dot GG3017 at tucnak dot redhat dot com> <56A5E268 dot 3000001 at codesourcery dot com> <20160125095817 dot GG3017 at tucnak dot redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jan 25, 2016 at 10:58:17AM +0100, Jakub Jelinek wrote:
> --- gcc/testsuite/c-c++-common/goacc/use_device-1.c.jj 2016-01-25 10:56:33.472310437 +0100
> +++ gcc/testsuite/c-c++-common/goacc/use_device-1.c 2016-01-25 10:56:43.128176481 +0100
> @@ -0,0 +1,15 @@
> +/* { dg-do compile } */
> +
> +void
> +foo (float *x, float *y)
> +{
> + int n = 1 << 20;
> +#pragma acc data create(x[0:n]) copyout(y[0:n])
> + {
> +#pragma acc host_data use_device(x,y)
> + {
> + for (int i = 1; i < n; i++)
> + y[0] += x[i] * y[i];
> + }
> + }
> +}
Though the testcase looks invalid to me, how can you dereference
the device pointer on the host? Though, for a testcase that it doesn't ICE
maybe good enough.
Jakub