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]

[PATCH] Fix NVPTX offloading with dynamic libcuda.so.1 loading on powerpc


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


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