Discussion:
[patch,openacc] Check for sufficient parallelism when calling acc routines in Fortran
Cesar Philippidis
2018-10-02 15:06:17 UTC
Permalink
This patch updates the Fortran FE OpenACC routine parser to enforce the
new OpenACC 2.5 routine directive semantics. In addition to emitting a
warning when the user doesn't specify a gang, worker or vector clause,
it also clarifies some error messages and introduces a new error when
the user tries to use an acc routine with insufficient parallelism,
e.g., calling a gang routine from a vector loop.

Is this patch OK for trunk? I bootstrapped and regtested it for x86_64
Linux with nvptx offloading.

Thanks,
Cesar
Bernhard Reutner-Fischer
2018-10-02 20:29:48 UTC
Permalink
On 2 October 2018 17:06:17 CEST, Cesar Philippidis <***@codesourcery.com> wrote:

s/ to for the/ for the/g

In routine-nested-parallelism.f you seem to always use a(1) as the lhs where I'd maybe have used a(i). Not that it's make a difference though.


@@ -2429,7 +2436,8 @@ gfc_match_oacc_routine (void)
&old_loc))
goto cleanup;

- gfc_current_ns->proc_name->attr.oacc_function = dims;
+ gfc_current_ns->proc_name->attr.oacc_function
+ = seen_error ? OACC_FUNCTION_SEQ : dims;

Surplus vertical space, I think.



@@ -2319,7 +2319,13 @@ gfc_match_oacc_routine (void)
{
if ((isym = gfc_find_function (buffer)) == NULL
&& (isym = gfc_find_subroutine (buffer)) == NULL)
- st = gfc_find_symtree (gfc_current_ns->sym_root, buffer);
+ {
+ st = gfc_find_symtree (gfc_current_ns->sym_root, buffer);
+ if (st == NULL && gfc_current_ns->proc_name->attr.contained
+ && gfc_current_ns->parent)
+ st = gfc_find_symtree (gfc_current_ns->parent->sym_root,
+ buffer);
+ }

I think we have a gfc_find_sym_tree() which will visit (all) parents and which maybe is appropriate here.

cheers,

Loading...