Skip to content

Commit

Permalink
Fix build against CL 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Nov 30, 2015
1 parent 425ca5e commit bbfa646
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
25 changes: 1 addition & 24 deletions cffi_build.py.in
Expand Up @@ -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=(
Expand Down
19 changes: 14 additions & 5 deletions src/c_wrapper/wrap_cl.h
Expand Up @@ -79,18 +79,27 @@ 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

#ifndef cl_ext_migrate_memobject
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;

Expand Down

0 comments on commit bbfa646

Please sign in to comment.