This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[hsa] HSA: fix kernel initialization for dependent kernels.


Hello.

Following patch has been installed to HSA branch.

Thanks,
Martin
>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]