[patch,openacc] Check for sufficient parallelism when calling acc routines in Fortran

Bernhard Reutner-Fischer rep.dot.nop@gmail.com
Tue Oct 2 20:30:00 GMT 2018


On 2 October 2018 17:06:17 CEST, Cesar Philippidis <cesar@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, 



More information about the Fortran mailing list