This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [OpenACC] declare directive
- From: Jakub Jelinek <jakub at redhat dot com>
- To: James Norris <jnorris at codesourcery dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 12 Nov 2015 10:09:59 +0100
- Subject: Re: [OpenACC] declare directive
- Authentication-results: sourceware.org; auth=none
- References: <5638E164 dot 5010207 at codesourcery dot com> <87611h1zi7 dot fsf at kepler dot schwinge dot homeip dot net> <563CD07A dot 3000404 at codesourcery dot com> <20151106190352 dot GG5675 at tucnak dot redhat dot com> <563F6BA5 dot 9020606 at codesourcery dot com> <5640C35C dot 9030907 at codesourcery dot com> <20151109162117 dot GU5675 at tucnak dot redhat dot com> <56412830 dot 9030100 at codesourcery dot com> <20151111083233 dot GE5675 at tucnak dot redhat dot com> <5643E66E dot 9000202 at codesourcery dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Nov 11, 2015 at 07:07:58PM -0600, James Norris wrote:
> + oacc_declare_returns->remove (t);
> +
> + if (oacc_declare_returns->elements () == 0)
> + {
> + delete oacc_declare_returns;
> + oacc_declare_returns = NULL;
> + }
Something for incremental patch:
1) might be nice to have some assertion that at the end of gimplify_body
or so oacc_declare_returns is NULL
2) what happens if you refer to automatic variables of other functions
(C or Fortran nested functions, maybe C++ lambdas); shall those be
unmapped at the end of the (nested) function's body?
> @@ -5858,6 +5910,10 @@ omp_default_clause (struct gimplify_omp_ctx *ctx, tree decl,
> flags |= GOVD_FIRSTPRIVATE;
> break;
> case OMP_CLAUSE_DEFAULT_UNSPECIFIED:
> + if (is_global_var (decl)
> + && ctx->region_type & (ORT_ACC_PARALLEL | ORT_ACC_KERNELS)
Please put this condition as cheapest first. I'd also surround
it into (), just to make it clear that the bitwise & is intentional.
Perhaps () != 0.
> + && device_resident_p (decl))
> + flags |= GOVD_MAP_TO_ONLY | GOVD_MAP;
> + case GOMP_MAP_FROM:
> + kinds[i] = GOMP_MAP_FORCE_FROM;
> + GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
> + &kinds[i], 0, 0);
Wrong indentation.
Ok with those two changes and please think about the incremental stuff.
Jakub