openacc reference reductions

Nathan Sidwell nathan@acm.org
Tue Feb 9 15:33:00 GMT 2016


While I've not looked at the rest of the patch, this bit stood out:

> +static bool
> +is_oacc_parallel_reduction (tree var, omp_context *ctx)
> +{
> +  if (!is_oacc_parallel (ctx))
> +    return false;
> +
> +  tree clauses = gimple_omp_target_clauses (ctx->stmt);
> +
> +  /* Don't install a local copy of the decl if it used
> +     inside a acc parallel reduction.  */

^^ comment is misleading -- this routine's not installing anything

> +  if (is_oacc_parallel (ctx))

^^ already checked above.

> +    for (tree c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
> +      if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
> +	  && OMP_CLAUSE_DECL (c) == var)
> +	return true;
> +
> +  return false;
> +}
> +




More information about the Gcc-patches mailing list