From bbfa646131136bd5a77d9fc08cc573a1c007666c Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Sun, 29 Nov 2015 22:41:17 -0600 Subject: [PATCH] Fix build against CL 1.1 --- cffi_build.py.in | 25 +------------------------ src/c_wrapper/wrap_cl.h | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/cffi_build.py.in b/cffi_build.py.in index d7cdbee0..d7759405 100644 --- a/cffi_build.py.in +++ b/cffi_build.py.in @@ -48,30 +48,7 @@ if {CL_ENABLE_GL}: ffi.set_source("pyopencl._cffi", """ - #ifndef __APPLE__ - #include <CL/cl.h> - - #ifdef HAVE_GL - #include <GL/gl.h> - #include <CL/cl_gl.h> - #include <CL/cl_gl_ext.h> - #endif - #else - #include <OpenCL/opencl.h> - - #ifdef HAVE_GL - #include <OpenGL/OpenGL.h> - #include <OpenCL/cl_gl.h> - #include <OpenCL/cl_gl_ext.h> - #endif - #endif - - extern "C" {{ - #include <wrap_cl_core.h> - #ifdef HAVE_GL - #include <wrap_cl_gl_core.h> - #endif - }} + #include "wrap_cl.h" """, define_macros=list({EXTRA_DEFINES}.items()), include_dirs=( diff --git a/src/c_wrapper/wrap_cl.h b/src/c_wrapper/wrap_cl.h index 58acc505..41e57c26 100644 --- a/src/c_wrapper/wrap_cl.h +++ b/src/c_wrapper/wrap_cl.h @@ -79,7 +79,20 @@ typedef cl_uint cl_kernel_exec_info; #ifndef CL_VERSION_1_2 typedef intptr_t cl_device_partition_property; typedef cl_uint cl_kernel_arg_info; -typedef struct _cl_image_desc cl_image_desc; + +typedef struct _cl_image_desc { + cl_mem_object_type image_type; + size_t image_width; + size_t image_height; + size_t image_depth; + size_t image_array_size; + size_t image_row_pitch; + size_t image_slice_pitch; + cl_uint num_mip_levels; + cl_uint num_samples; + cl_mem buffer; +} cl_image_desc; + typedef cl_bitfield cl_mem_migration_flags; #endif @@ -87,10 +100,6 @@ typedef cl_bitfield cl_mem_migration_flags; typedef cl_bitfield cl_mem_migration_flags_ext; #endif -#ifndef cl_ext_device_fission -typedef cl_ulong cl_device_partition_property_ext; -#endif - struct clbase; typedef clbase *clobj_t; -- GitLab