public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Julian Brown <julian@codesourcery.com>
Cc: James Norris <jnorris@codesourcery.com>,
	       GCC Patches <gcc-patches@gcc.gnu.org>,
	       "Joseph S. Myers" <joseph@codesourcery.com>,
	       Nathan Sidwell <Nathan_Sidwell@mentor.com>
Subject: Re: [OpenACC 0/7] host_data construct
Date: Tue, 01 Dec 2015 08:30:00 -0000	[thread overview]
Message-ID: <20151201083008.GO5675@tucnak.redhat.com> (raw)
In-Reply-To: <20151130193034.71143aa4@octopus>

On Mon, Nov 30, 2015 at 07:30:34PM +0000, Julian Brown wrote:
>     Julian Brown  <julian@codesourcery.com>
>     Cesar Philippidis  <cesar@codesourcery.com>
>     James Norris  <James_Norris@mentor.com>
> 
>     gcc/
>     * c-family/c-pragma.c (oacc_pragmas): Add PRAGMA_OACC_HOST_DATA.
>     * c-family/c-pragma.h (pragma_kind): Add PRAGMA_OACC_HOST_DATA.

c-family/, c/ and cp/ subdirectories have their own ChangeLog, so you need
to split the entry into multiple ChangeLog files and remove the directory
prefixes.

> @@ -6120,6 +6121,9 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code)
>  					 (splay_tree_key) decl);
>  		  if (n2)
>  		    {
> +		      if (octx->region_type == ORT_ACC_HOST_DATA)
> +		        error ("variable %qE declared in enclosing "
> +			       "host_data region", DECL_NAME (decl));

%<host_data%> instead?
>  		      nflags |= GOVD_MAP;
>  		      goto found_outer;
>  		    }
> @@ -6418,6 +6422,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
>        case OMP_TARGET_DATA:
>        case OMP_TARGET_ENTER_DATA:
>        case OMP_TARGET_EXIT_DATA:
> +      case OACC_HOST_DATA:
>  	ctx->target_firstprivatize_array_bases = true;
>        default:
>  	break;
> @@ -6683,6 +6688,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
>  	    case OMP_TARGET_DATA:
>  	    case OMP_TARGET_ENTER_DATA:
>  	    case OMP_TARGET_EXIT_DATA:
> +	    case OACC_HOST_DATA:
>  	      if (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER
>  		  || (OMP_CLAUSE_MAP_KIND (c)
>  		      == GOMP_MAP_FIRSTPRIVATE_REFERENCE))
> @@ -6695,6 +6701,22 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
>  	    }
>  	  if (remove)
>  	    break;
> +	  if (DECL_P (decl) && outer_ctx && (region_type & ORT_ACC))
> +	    {
> +	      struct gimplify_omp_ctx *octx;
> +	      for (octx = outer_ctx; octx; octx = octx->outer_context)
> +	        {
> +		  if (!(octx->region_type & (ORT_TARGET_DATA | ORT_TARGET)))
> +		    break;

Wouldn't it be better to do
		if (octx->region_type != ORT_ACC_HOST_DATA)
		  continue;
here, thus only lookup if you really want to use it?

> +		  splay_tree_node n2
> +		    = splay_tree_lookup (octx->variables,
> +					 (splay_tree_key) decl);
> +		  if (n2 && octx->region_type == ORT_ACC_HOST_DATA)

and remove the && ... part from the condition?

> +		    error_at (OMP_CLAUSE_LOCATION (c), "variable %qE "
> +			      "declared in enclosing host_data region",
> +			      DECL_NAME (decl));
> +		}
> +	    }
>  	  if (OMP_CLAUSE_SIZE (c) == NULL_TREE)
>  	    OMP_CLAUSE_SIZE (c) = DECL_P (decl) ? DECL_SIZE_UNIT (decl)
>  				  : TYPE_SIZE_UNIT (TREE_TYPE (decl));

Ok with those changes.

	Jakub

  reply	other threads:[~2015-12-01  8:30 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22 19:14 James Norris
2015-10-22 19:15 ` [OpenACC 2/7] host_data construct (C FE) James Norris
2015-10-22 19:15 ` [OpenACC 1/7] host_data construct (C/C++ common) James Norris
2015-10-22 19:16 ` [OpenACC 3/7] host_data construct (C front-end) James Norris
2015-10-22 19:18 ` [OpenACC 4/7] host_data construct (middle end) James Norris
2015-10-22 19:19 ` [OpenACC 5/7] host_data construct (gcc tests) James Norris
2015-10-22 19:20 ` [OpenACC 6/7] host_data construct James Norris
2015-10-22 19:22 ` [OpenACC 7/7] host_data construct (runtime tests) James Norris
2015-10-22 20:42 ` [OpenACC 0/7] host_data construct Joseph Myers
2015-10-22 20:53   ` James Norris
2015-10-23 16:01 ` [Bulk] " James Norris
2015-10-26 18:36   ` Jakub Jelinek
2015-10-27 15:57     ` Cesar Philippidis
2015-11-02 18:33     ` Julian Brown
2015-11-02 19:29       ` Jakub Jelinek
2015-11-12 11:16       ` Julian Brown
2015-11-18 12:48         ` Julian Brown
2015-11-19 13:13           ` Jakub Jelinek
2015-11-19 14:29             ` Julian Brown
2015-11-19 15:57               ` Jakub Jelinek
2015-11-30 19:34                 ` Julian Brown
2015-12-01  8:30                   ` Jakub Jelinek [this message]
2015-12-02 15:27                   ` Tom de Vries
2015-12-02 15:59                   ` Thomas Schwinge
2015-12-02 19:16                     ` Cesar Philippidis
2015-12-02 19:28                       ` Steve Kargl
2015-12-02 19:35                       ` Jakub Jelinek
2015-12-02 19:54                         ` Cesar Philippidis
2015-12-02 22:14                     ` [gomp4] " Thomas Schwinge
2016-04-08 13:41                       ` Fortran OpenACC host_data construct ICE (was: [gomp4] Re: [OpenACC 0/7] host_data construct) Thomas Schwinge
2016-02-02 13:57                     ` [OpenACC 0/7] host_data construct Thomas Schwinge
2015-11-13 15:31       ` [Bulk] " Jakub Jelinek
2015-12-23 11:02     ` Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151201083008.GO5675@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=Nathan_Sidwell@mentor.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jnorris@codesourcery.com \
    --cc=joseph@codesourcery.com \
    --cc=julian@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).