[Pkg-opencl-devel] Bug#760310: opencl-headers: use __vector for altivec to avoid conflicts

Aurelien Jarno aurel32 at debian.org
Tue Sep 2 19:16:26 UTC 2014


Package: opencl-headers
Version: 1.2-2014.04.13-1
Severity: important
Tags: patch
User: debian-powerpc at lists.debian.org
Usertags: ppc64el

Altivec vectors can be defined with either the "vector" keyword or the
"__vector" type [1]. In general "__vector" should be prefered for
include files, as otherwise it might conflicts with other type define
in the source code (define a vector class in C++ is quite common).

<CL/cl_platform.h> from opencl-headers defines altivec types using the
"vector" keyword. This causes opencv to fail to build on powerpc if the
code is compiled with -maltivec, or by default on ppc64el which always
has altivec enabled.

Other distribution patches the internal copy of cl_platform.h included
in opencv by replacing "vector" with "__vector" [2]. In Debian it has to
be done in the opencl-headers package, as the internal copy is not used.
The patch below fixes the issue. It would be nice if you can include it
quickly as it currently block the ppc64el bootstrap in Debian. Thanks in
advance.


[1] http://publib.boulder.ibm.com/infocenter/lnxpcomp/v7v91/index.jsp?topic=%2Fcom.ibm.vacpp7l.doc%2Flanguage%2Fref%2Fclrc03altivec_types.htm
[2] http://lists.opensuse.org/opensuse-commit/2014-01/msg00786.html


--- a/cl_platform.h
+++ b/cl_platform.h
@@ -332,13 +332,13 @@
 /* Define basic vector types */
 #if defined( __VEC__ )
    #include <altivec.h>   /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */
-   typedef vector unsigned char     __cl_uchar16;
-   typedef vector signed char       __cl_char16;
-   typedef vector unsigned short    __cl_ushort8;
-   typedef vector signed short      __cl_short8;
-   typedef vector unsigned int      __cl_uint4;
-   typedef vector signed int        __cl_int4;
-   typedef vector float             __cl_float4;
+   typedef __vector unsigned char     __cl_uchar16;
+   typedef __vector signed char       __cl_char16;
+   typedef __vector unsigned short    __cl_ushort8;
+   typedef __vector signed short      __cl_short8;
+   typedef __vector unsigned int      __cl_uint4;
+   typedef __vector signed int        __cl_int4;
+   typedef __vector float             __cl_float4;
    #define  __CL_UCHAR16__  1
    #define  __CL_CHAR16__   1
    #define  __CL_USHORT8__  1

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: ppc64el (ppc64le)

Kernel: Linux 3.14-2-powerpc64le (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

-- no debconf information



More information about the Pkg-opencl-devel mailing list