This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix NVPTX offloading with dynamic libcuda.so.1 loading on powerpc
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 13 Apr 2017 22:01:40 +0200
- Subject: [PATCH] Fix NVPTX offloading with dynamic libcuda.so.1 loading on powerpc
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3644B3D97C
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3644B3D97C
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
Finally got to debug why most libgomp offloading tests fail on
powerpc64le-linux when configured for NVPTX offloading.
The problem is -funsigned-char by default, so
if (cuda_lib_inited != -1)
was always true. Fixed thusly, bootstrapped/regtested on x86_64-linux
and powerpc64le-linux, committed to trunk.
2017-04-13 Jakub Jelinek <jakub@redhat.com>
* plugin/plugin-nvptx.c (cuda_lib_inited): Use signed char type
instead of char.
--- libgomp/plugin/plugin-nvptx.c.jj 2017-02-04 03:15:32.000000000 -0500
+++ libgomp/plugin/plugin-nvptx.c 2017-04-13 08:24:46.456531331 -0400
@@ -106,7 +106,7 @@ struct cuda_lib_s {
/* -1 if init_cuda_lib has not been called yet, false
if it has been and failed, true if it has been and succeeded. */
-static char cuda_lib_inited = -1;
+static signed char cuda_lib_inited = -1;
/* Dynamically load the CUDA runtime library and initialize function
pointers, return false if unsuccessful, true if successful. */
Jakub