diff mbox

[gomp4] remove kernel-specific launch

Message ID 55AB97C0.4080303@acm.org
State New
Headers show

Commit Message

Nathan Sidwell July 19, 2015, 12:27 p.m. UTC
Tom,
as we discussed this patch removes the GOACC_kernels call, which forwards to 
GOACC_parallel.  We simply call GOACC_parallel directly.

ok for gomp4 branch?

nathan

Comments

Tom de Vries July 19, 2015, 4:14 p.m. UTC | #1
On 19/07/15 14:27, Nathan Sidwell wrote:
> Tom,
> as we discussed this patch removes the GOACC_kernels call, which
> forwards to GOACC_parallel.  We simply call GOACC_parallel directly.
>
> ok for gomp4 branch?
>

Hi Nathan,

yes, that looks good.

Thanks,
- Tom
Thomas Schwinge July 19, 2015, 8:30 p.m. UTC | #2
Hi!

On Sun, 19 Jul 2015 08:27:44 -0400, Nathan Sidwell <nathan@acm.org> wrote:
> Tom,
> as we discussed this patch removes the GOACC_kernels call, which forwards to 
> GOACC_parallel.  We simply call GOACC_parallel directly.
> 
> ok for gomp4 branch?

> 	gcc/
> 	* omp-low.c (expand_omp_target): Convert to
> 	BUILT_IN_GOACC_PARALLEL. Remove BUILT_IN_GOACC_KERNELS cases.
> 	* omp-builtins.def (BUILT_IN_GOACC_KERNELS): Delete.
> 
> 	libgomp/
> 	* oacc-parallel.c (GOACC_kernels): Delete.

Yes, thanks for the cleanup.  Please also adjust/remove the following:

    gcc/tree-parloops.c:    /* Remove GOACC_kernels.  */
    libgomp/libgomp.map:    GOACC_kernels;
    libgomp/libgomp_g.h:extern void GOACC_kernels (int, void (*) (void *), size_t,

Does it make sense then to rename GOACC_kernels_internal to
GOACC_kernels?


Grüße,
 Thomas
Tom de Vries July 19, 2015, 8:34 p.m. UTC | #3
On 19/07/15 22:30, Thomas Schwinge wrote:
> Does it make sense then to rename GOACC_kernels_internal to
> GOACC_kernels?

I prefer to keep the name GOACC_kernels_internal, IMO it's clearer.

Thanks,
- Tom
diff mbox

Patch

2015-07-19  Nathan Sidwell  <nathan@codesourcery.com>

	gcc/
	* omp-low.c (expand_omp_target): Convert to
	BUILT_IN_GOACC_PARALLEL. Remove BUILT_IN_GOACC_KERNELS cases.
	* omp-builtins.def (BUILT_IN_GOACC_KERNELS): Delete.

	libgomp/
	* oacc-parallel.c (GOACC_kernels): Delete.

Index: gcc/omp-builtins.def
===================================================================
--- gcc/omp-builtins.def	(revision 225982)
+++ gcc/omp-builtins.def	(working copy)
@@ -48,9 +48,6 @@  DEF_GOACC_BUILTIN_FNSPEC (BUILT_IN_GOACC
 			  BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_INT_INT_INT_SIZE_INT_INT_VAR,
 			  ATTR_FNSPEC_DOT_DOT_DOT_DOT_r_r_r_NOTHROW_LIST,
 			  ATTR_NOTHROW_LIST, "....rrr")
-DEF_GOACC_BUILTIN (BUILT_IN_GOACC_KERNELS, "GOACC_kernels",
-		   BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_INT_INT_INT_SIZE_INT_INT_VAR,
-		   ATTR_NOTHROW_LIST)
 DEF_GOACC_BUILTIN (BUILT_IN_GOACC_PARALLEL, "GOACC_parallel",
 		   BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_INT_INT_INT_SIZE_INT_INT_VAR,
 		   ATTR_NOTHROW_LIST)
Index: gcc/omp-low.c
===================================================================
--- gcc/omp-low.c	(revision 225982)
+++ gcc/omp-low.c	(working copy)
@@ -9339,14 +9339,15 @@  expand_omp_target (struct omp_region *re
 	  /* Don't emit the library call.  We've already done that.  */
 	  do_emit_library_call = false;
 	  /* Transform BUILT_IN_GOACC_KERNELS_INTERNAL into
-	     BUILT_IN_GOACC_KERNELS_INTERNAL.  Now that the function body will be
-	     split off, we can no longer regard the omp_data_array reference as
-	     non-escaping.  */
+	     BUILT_IN_GOACC_PARALLELL.  Now that the function
+	     body will be split off, we can no longer regard the
+	     omp_data_array reference as non-escaping.  */
 	  gsi = gsi_last_bb (entry_bb);
 	  gsi_prev (&gsi);
 	  gcall *call = as_a <gcall *> (gsi_stmt (gsi));
-	  gcc_assert (gimple_call_builtin_p (call, BUILT_IN_GOACC_KERNELS_INTERNAL));
-	  tree fndecl = builtin_decl_explicit (BUILT_IN_GOACC_KERNELS);
+	  gcc_assert (gimple_call_builtin_p
+		      (call, BUILT_IN_GOACC_KERNELS_INTERNAL));
+	  tree fndecl = builtin_decl_explicit (BUILT_IN_GOACC_PARALLEL);
 	  gimple_call_set_fndecl (call, fndecl);
 	  gimple_call_set_fntype (call, TREE_TYPE (fndecl));
 	  gimple_call_reset_alias_info (call);
@@ -9723,7 +9724,6 @@  expand_omp_target (struct omp_region *re
     case BUILT_IN_GOACC_DATA_START:
     case BUILT_IN_GOACC_DECLARE:
     case BUILT_IN_GOACC_ENTER_EXIT_DATA:
-    case BUILT_IN_GOACC_KERNELS:
     case BUILT_IN_GOACC_KERNELS_INTERNAL:
     case BUILT_IN_GOACC_PARALLEL:
     case BUILT_IN_GOACC_UPDATE:
@@ -9743,7 +9743,6 @@  expand_omp_target (struct omp_region *re
     case BUILT_IN_GOMP_TARGET_DATA:
     case BUILT_IN_GOMP_TARGET_UPDATE:
       break;
-    case BUILT_IN_GOACC_KERNELS:
     case BUILT_IN_GOACC_KERNELS_INTERNAL:
     case BUILT_IN_GOACC_PARALLEL:
       {
Index: libgomp/oacc-parallel.c
===================================================================
--- libgomp/oacc-parallel.c	(revision 225982)
+++ libgomp/oacc-parallel.c	(working copy)
@@ -530,37 +530,6 @@  GOACC_enter_exit_data (int device, size_
   acc_dev->openacc.async_set_async_func (acc_async_sync);
 }
 
-void
-GOACC_kernels (int device, void (*fn) (void *),
-	       size_t mapnum, void **hostaddrs, size_t *sizes,
-	       unsigned short *kinds,
-	       int num_gangs, int num_workers, int vector_length,
-	       size_t shared_size, int async, int num_waits, ...)
-{
-#ifdef HAVE_INTTYPES_H
-  gomp_debug (0, "%s: mapnum=%"PRIu64", hostaddrs=%p, sizes=%p, kinds=%p\n",
-	      __FUNCTION__, (uint64_t) mapnum, hostaddrs, sizes, kinds);
-#else
-  gomp_debug (0, "%s: mapnum=%lu, hostaddrs=%p, sizes=%p, kinds=%p\n",
-	      __FUNCTION__, (unsigned long) mapnum, hostaddrs, sizes, kinds);
-#endif
-
-  va_list ap;
-
-  goacc_lazy_initialize ();
-
-  va_start (ap, num_waits);
-
-  if (num_waits > 0)
-    goacc_wait (async, num_waits, ap);
-
-  va_end (ap);
-
-  GOACC_parallel (device, fn, mapnum, hostaddrs, sizes, kinds,
-		  num_gangs, num_workers, vector_length, shared_size,
-		  async, 0);
-}
-
 static void
 goacc_wait (int async, int num_waits, va_list ap)
 {