Bug#684444: including CL/cl.hpp produces compile errors

2012-09-04 Thread Andreas Beckmann
Hi Vincent,

please check whether CL_USE_DEPRECATED_OPENCL_1_1_APIS is already
defined instead of redefining it:

$ g++ -I . -c a.cpp -W -Wall -DCL_USE_DEPRECATED_OPENCL_1_1_APIS
In file included from a.cpp:1:0:
./CL/cl.hpp:152:0: warning: "CL_USE_DEPRECATED_OPENCL_1_1_APIS"
redefined [enabled by default]
:0:0: note: this is the location of the previous definition
In file included from /usr/include/CL/opencl.h:43:0,
 from ./CL/cl.hpp:175,
 from a.cpp:1:
/usr/include/CL/cl_gl.h:107:2: warning: #warning
CL_USE_DEPRECATED_OPENCL_1_1_APIS is defined. These APIs are unsupported
and untested in OpenCL 1.2! [-Wcpp]


Andreas


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#684444: including CL/cl.hpp produces compile errors

2012-09-04 Thread Andreas Beckmann
Control: tag -1 + patch

On Wednesday, 29. August 2012 17:44:49 Vincent Danjean wrote:
>   I've been hit by this bug, too. Would you accept a patch to solve it?
> Here is such a patch in attachment.

Thanks.

Andreas


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#684444: including CL/cl.hpp produces compile errors

2012-08-29 Thread Vincent Danjean
Package: opencl-headers
Version: 1.2-2012.04.18a-1
Followup-For: Bug #68

  Hi,

  I've been hit by this bug, too. Would you accept a patch to solve it?
Here is such a patch in attachment.

This allows to compile the first and second program and it emits
an error for the third one explaining the problem:
vdanjean@eyak:/tmp$ cat toto.cpp 
#include 
vdanjean@eyak:/tmp$ cat toto2.cpp 
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
#include 
#include 
vdanjean@eyak:/tmp$ cat toto3.cpp 
#include 
#include 
vdanjean@eyak:/tmp$ 

vdanjean@eyak:/tmp$ g++ -Wall -c toto.cpp 
In file included from /usr/include/CL/opencl.h:43:0,
 from /usr/include/CL/cl.hpp:175,
 from toto.cpp:1:
/usr/include/CL/cl_gl.h:107:2: warning: #warning 
CL_USE_DEPRECATED_OPENCL_1_1_APIS is defined. These APIs are unsupported and 
untested in OpenCL 1.2! [-Wcpp]
vdanjean@eyak:/tmp$ g++ -Wall -c toto2.cpp 
In file included from /usr/include/CL/opencl.h:43:0,
 from toto2.cpp:2:
/usr/include/CL/cl_gl.h:107:2: warning: #warning 
CL_USE_DEPRECATED_OPENCL_1_1_APIS is defined. These APIs are unsupported and 
untested in OpenCL 1.2! [-Wcpp]
vdanjean@eyak:/tmp$ g++ -Wall -c toto3.cpp 
In file included from toto3.cpp:2:0:
/usr/include/CL/cl.hpp:183:4: error: #error some OpenCL headers have already 
been included without CL_USE_DEPRECATED_OPENCL_1_1_APIS defined
In file included from toto3.cpp:2:0:
/usr/include/CL/cl.hpp: In function ‘cl_int cl::UnloadCompiler()’:
/usr/include/CL/cl.hpp:1627:12: error: ‘::clUnloadCompiler’ has not been 
declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image2D::Image2D(const 
cl::Context&, cl_mem_flags, cl::ImageFormat, size_t, size_t, size_t, void*, 
cl_int*)’:
/usr/include/CL/cl.hpp:2386:19: error: ‘::clCreateImage2D’ has not been declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image2DGL::Image2DGL(const 
cl::Context&, cl_mem_flags, GLenum, GLint, GLuint, cl_int*)’:
/usr/include/CL/cl.hpp:2431:19: error: ‘::clCreateFromGLTexture2D’ has not been 
declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image3D::Image3D(const 
cl::Context&, cl_mem_flags, cl::ImageFormat, size_t, size_t, size_t, size_t, 
size_t, void*, cl_int*)’:
/usr/include/CL/cl.hpp:2485:19: error: ‘::clCreateImage3D’ has not been declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image3DGL::Image3DGL(const 
cl::Context&, cl_mem_flags, GLenum, GLint, GLuint, cl_int*)’:
/usr/include/CL/cl.hpp:2531:19: error: ‘::clCreateFromGLTexture3D’ has not been 
declared
/usr/include/CL/cl.hpp: In member function ‘cl_int 
cl::CommandQueue::enqueueMarker(cl::Event*) const’:
/usr/include/CL/cl.hpp:3766:13: error: ‘::clEnqueueMarker’ has not been declared
/usr/include/CL/cl.hpp: In member function ‘cl_int 
cl::CommandQueue::enqueueWaitForEvents(const std::vector&) const’:
/usr/include/CL/cl.hpp:3773:13: error: ‘::clEnqueueWaitForEvents’ has not been 
declared
/usr/include/CL/cl.hpp: In member function ‘cl_int 
cl::CommandQueue::enqueueBarrier() const’:
/usr/include/CL/cl.hpp:3888:13: error: ‘::clEnqueueBarrier’ has not been 
declared
vdanjean@eyak:/tmp$ 

  Regards,
Vincent

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386 armel mipsel

Kernel: Linux 3.2.0-3-amd64 (SMP w/8 CPU cores)
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
--- cl.hpp.orig	2012-08-29 17:16:34.903025550 +0200
+++ cl.hpp	2012-08-29 17:40:23.763928115 +0200
@@ -140,6 +140,17 @@
 #ifndef CL_HPP_
 #define CL_HPP_
 
+/* This is a OpenCL 1.1 header but other headers are 1.2
+   so we must define CL_USE_DEPRECATED_OPENCL_1_1_APIS
+   and check that other headers have not already been
+   included without this define
+ */
+#if !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) \
+  && (defined(__OPENCL_CL_H) || defined (__OPENCL_CL_GL_H))
+# define __CL_USE_DEPRECATED_OPENCL_1_1_APIS_WAS_NOT_DEFINED_BUT_HEADERS_INCLUDED
+#endif
+#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
+
 #ifdef _WIN32
 #include 
 #include 
@@ -164,6 +175,16 @@
 #include 
 #endif // !__APPLE__
 
+#ifdef __CL_USE_DEPRECATED_OPENCL_1_1_APIS_WAS_NOT_DEFINED_BUT_HEADERS_INCLUDED
+  /* Now, we can check if previously included headers was 1.2 headers.
+ 1.1 headers would perfectly works with this header.
+  */
+# if defined(CL_VERSION_1_2)
+#  error some OpenCL headers have already been included without CL_USE_DEPRECATED_OPENCL_1_1_APIS defined
+# endif
+# undef __CL_USE_DEPRECATED_OPENCL_1_1_APIS_WAS_NOT_DEFINED_BUT_HEADERS_INCLUDED
+#endif
+
 #if !defined(CL_CALLBACK)
 #define CL_CALLBACK
 #endif //CL_CALLBACK


Bug#684444: including CL/cl.hpp produces compile errors

2012-08-15 Thread Andreas Beckmann
On 2012-08-10 06:28, Joel wrote:
> In file included from t.cc:1:0:
> /usr/include/CL/cl.hpp: In function ‘cl_int cl::UnloadCompiler()’:
> /usr/include/CL/cl.hpp:1606:12: error: ‘::clUnloadCompiler’ has not
> been declared

See workaround in
http://www.khronos.org/message_boards/viewtopic.php?f=28&t=4550&p=15047&hilit=cl.hpp#p15047

Andreas


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#684444: including CL/cl.hpp produces compile errors

2012-08-09 Thread Joel
Package: opencl-headers
Version: 1.2-2012.04.18a-1

t.cc:

#include 

int main()
{}

---
g++ -L/usr/lib/x86_64-linux-gnu/ -lOpenCL t.cc

produces:
---
In file included from t.cc:1:0:
/usr/include/CL/cl.hpp: In function ‘cl_int cl::UnloadCompiler()’:
/usr/include/CL/cl.hpp:1606:12: error: ‘::clUnloadCompiler’ has not
been declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image2D::Image2D(const
cl::Context&, cl_mem_flags, cl::ImageFormat, size_t, size_t, size_t,
void*, cl_int*)’:
/usr/include/CL/cl.hpp:2365:19: error: ‘::clCreateImage2D’ has not been declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image2DGL::Image2DGL(const
cl::Context&, cl_mem_flags, GLenum, GLint, GLuint, cl_int*)’:
/usr/include/CL/cl.hpp:2410:19: error: ‘::clCreateFromGLTexture2D’ has
not been declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image3D::Image3D(const
cl::Context&, cl_mem_flags, cl::ImageFormat, size_t, size_t, size_t,
size_t, size_t, void*, cl_int*)’:
/usr/include/CL/cl.hpp:2464:19: error: ‘::clCreateImage3D’ has not been declared
/usr/include/CL/cl.hpp: In constructor ‘cl::Image3DGL::Image3DGL(const
cl::Context&, cl_mem_flags, GLenum, GLint, GLuint, cl_int*)’:
/usr/include/CL/cl.hpp:2510:19: error: ‘::clCreateFromGLTexture3D’ has
not been declared
/usr/include/CL/cl.hpp: In member function ‘cl_int
cl::CommandQueue::enqueueMarker(cl::Event*) const’:
/usr/include/CL/cl.hpp:3745:13: error: ‘::clEnqueueMarker’ has not been declared
/usr/include/CL/cl.hpp: In member function ‘cl_int
cl::CommandQueue::enqueueWaitForEvents(const std::vector&)
const’:
/usr/include/CL/cl.hpp:3752:13: error: ‘::clEnqueueWaitForEvents’ has
not been declared
/usr/include/CL/cl.hpp: In member function ‘cl_int
cl::CommandQueue::enqueueBarrier() const’:
/usr/include/CL/cl.hpp:3867:13: error: ‘::clEnqueueBarrier’ has not
been declared
---
This is on testing with g++ (Debian 4.7.1-2) 4.7.1


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org