From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87573 invoked by alias); 3 Aug 2015 15:15:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 87556 invoked by uid 89); 3 Aug 2015 15:15:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 03 Aug 2015 15:15:34 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7294DAC6D for ; Mon, 3 Aug 2015 15:15:31 +0000 (UTC) To: GCC Patches From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [hsa] HSA: fix kernel initialization for dependent kernels. Message-ID: <55BF8593.2000103@suse.cz> Date: Mon, 03 Aug 2015 15:15:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040909090803090700050206" X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00079.txt.bz2 This is a multi-part message in MIME format. --------------040909090803090700050206 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 74 Hello. Following patch has been installed to HSA branch. Thanks, Martin --------------040909090803090700050206 Content-Type: text/x-patch; name="0002-HSA-fix-kernel-initialization-for-dependent-kernels.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-HSA-fix-kernel-initialization-for-dependent-kernels.pat"; filename*1="ch" Content-length: 1711 >From 125ee1ed4123527d4ce841631d4930ac96bec281 Mon Sep 17 00:00:00 2001 From: mliska 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 * 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 --------------040909090803090700050206--