From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87058 invoked by alias); 9 Apr 2017 16:22:04 -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 86985 invoked by uid 89); 9 Apr 2017 16:22:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=Gr, 34am, 34AM, HSA 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 ESMTP; Sun, 09 Apr 2017 16:22:02 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id ACF2AABE6; Sun, 9 Apr 2017 16:22:00 +0000 (UTC) Date: Sun, 09 Apr 2017 16:22:00 -0000 From: Martin Jambor To: Thomas Schwinge Cc: Martin =?utf-8?B?TGnFoWth?= , GCC Patches Subject: Re: [HSA, PATCH] Load an HSA runtime via dlopen mechanism Message-ID: <20170409162200.i2amqt5hgduct4at@virgil.suse.cz> Mail-Followup-To: Thomas Schwinge , Martin =?utf-8?B?TGnFoWth?= , GCC Patches References: <5715EB44.1030903@suse.cz> <87pogrgtop.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87pogrgtop.fsf@euler.schwinge.homeip.net> User-Agent: Mutt/1.6.2 (2016-07-01) X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00425.txt.bz2 Hi, On Wed, Apr 05, 2017 at 10:11:34AM +0200, Thomas Schwinge wrote: > ... > > I ran into a case where the libgomp hsa plugin wouldn't load. The > following patch helped me to quickly diagnose and then fix that. OK for > trunk? Yes, thanks. Martin > > commit 54099202eb88464530dd3a55709c9afb85766ee0 > Author: Thomas Schwinge > Date: Wed Apr 5 09:58:02 2017 +0200 > > libgomp hsa plugin: debug output for HSA runtime library loading failure > > libgomp/ > * plugin/plugin-hsa.c (DLSYM_FN, init_hsa_runtime_functions): > Debug output for failure. > --- > libgomp/plugin/plugin-hsa.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git libgomp/plugin/plugin-hsa.c libgomp/plugin/plugin-hsa.c > index 9cc243d..90ca247 100644 > --- libgomp/plugin/plugin-hsa.c > +++ libgomp/plugin/plugin-hsa.c > @@ -491,14 +491,14 @@ static struct hsa_context_info hsa_context; > #define DLSYM_FN(function) \ > hsa_fns.function##_fn = dlsym (handle, #function); \ > if (hsa_fns.function##_fn == NULL) \ > - return false; > + goto dl_fail; > > static bool > init_hsa_runtime_functions (void) > { > void *handle = dlopen (hsa_runtime_lib, RTLD_LAZY); > if (handle == NULL) > - return false; > + goto dl_fail; > > DLSYM_FN (hsa_status_string) > DLSYM_FN (hsa_agent_get_info) > @@ -530,6 +530,10 @@ init_hsa_runtime_functions (void) > DLSYM_FN (hsa_ext_program_destroy) > DLSYM_FN (hsa_ext_program_finalize) > return true; > + > + dl_fail: > + HSA_DEBUG ("while loading %s: %s\n", hsa_runtime_lib, dlerror ()); > + return false; > } > > /* Find kernel for an AGENT by name provided in KERNEL_NAME. */ > > > Grüße > Thomas