public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [hsa] HSA: fix kernel initialization for dependent kernels.
Date: Mon, 03 Aug 2015 15:15:00 -0000	[thread overview]
Message-ID: <55BF8593.2000103@suse.cz> (raw)

[-- 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


                 reply	other threads:[~2015-08-03 15:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55BF8593.2000103@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).