public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [hsa] HSA: fix kernel initialization for dependent kernels.
@ 2015-08-03 15:15 Martin Liška
  0 siblings, 0 replies; only message in thread
From: Martin Liška @ 2015-08-03 15:15 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 74 bytes --]

Hello.

Following patch has been installed to HSA branch.

Thanks,
Martin

[-- Attachment #2: 0002-HSA-fix-kernel-initialization-for-dependent-kernels.patch --]
[-- Type: text/x-patch, Size: 1710 bytes --]

From 125ee1ed4123527d4ce841631d4930ac96bec281 Mon Sep 17 00:00:00 2001
From: mliska <mliska@suse.cz>
Date: Mon, 3 Aug 2015 13:00:42 +0200
Subject: [PATCH 2/3] HSA: fix kernel initialization for dependent kernels

libgomp/ChangeLog:

2015-08-03  Martin Liska  <mliska@suse.cz>

	* plugin/plugin-hsa.c (init_single_kernel): Initialize recursively
	all dependent kernels.
	(init_kernel): Moved from this location.
---
 libgomp/plugin/plugin-hsa.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/libgomp/plugin/plugin-hsa.c b/libgomp/plugin/plugin-hsa.c
index 144548a..c05de1e 100644
--- a/libgomp/plugin/plugin-hsa.c
+++ b/libgomp/plugin/plugin-hsa.c
@@ -682,6 +682,15 @@ init_single_kernel (struct kernel_info *kernel)
       fprintf (stderr, "  omp_data_size: %u\n",
 	       kernel->omp_data_size);
     }
+
+  /* FIXME: do not consider all kernels to live in a same module.  */
+  struct module_info *module = kernel->agent->first_module;
+  for (unsigned i = 0; i < kernel->dependencies_count; i++)
+    {
+      struct kernel_info *dependency = get_kernel_in_module
+	(module, kernel->dependencies[i]);
+      init_single_kernel (dependency);
+    }
 }
 
 /* Indent stream F by INDENT spaces.  */
@@ -766,16 +775,6 @@ init_kernel (struct kernel_info *kernel)
 
   init_single_kernel (kernel);
 
-  struct agent_info *agent = kernel->agent;
-  struct module_info *module = agent->first_module;
-
-  for (unsigned i = 0; i < kernel->dependencies_count; i++)
-    {
-      struct kernel_info *dependency = get_kernel_in_module
-	(module, kernel->dependencies[i]);
-      init_single_kernel (dependency);
-    }
-
   if (debug)
     fprintf (stderr, "\n");
 
-- 
2.4.6


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-03 15:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-03 15:15 [hsa] HSA: fix kernel initialization for dependent kernels Martin Liška

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).