Skip to content

Commit

Permalink
Fix symbol not found for create_image_from_desc on CL 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Nov 30, 2015
1 parent e12f38a commit 90b73be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/c_wrapper/error.h
Expand Up @@ -21,6 +21,13 @@
#define PYOPENCL_CL_CASTABLE_THIS data()
#endif

#define PYOPENCL_UNSUPPORTED(ROUTINE, VERSION) \
auto err = (error*)malloc(sizeof(error)); \
err->routine = strdup(#ROUTINE); \
err->msg = strdup("unsupported in " VERSION); \
err->code = CL_INVALID_VALUE \

This comment has been minimized.

Copy link
@FreddieWitherden

FreddieWitherden Nov 30, 2015

Seems to be a missing ;.

This comment has been minimized.

Copy link
@inducer

inducer Dec 1, 2015

Author Owner

Should be fixed in 4bb4089. Thanks again for your report!

This comment has been minimized.

Copy link
@FreddieWitherden

FreddieWitherden Dec 1, 2015

PyOpenCL now builds and imports on my OpenCL 1.1 box. Will run test the sub region corrections tomorrow and report back.

err->other = 0; \
return err;

class clerror : public std::runtime_error {
private:
Expand Down
6 changes: 4 additions & 2 deletions src/c_wrapper/image.cpp
Expand Up @@ -81,21 +81,23 @@ create_image_3d(clobj_t *img, clobj_t _ctx, cl_mem_flags flags,
});
}

#if PYOPENCL_CL_VERSION >= 0x1020

error*
create_image_from_desc(clobj_t *img, clobj_t _ctx, cl_mem_flags flags,
cl_image_format *fmt, cl_image_desc *desc, void *buf)
{
#if PYOPENCL_CL_VERSION >= 0x1020
auto ctx = static_cast<context*>(_ctx);
return c_handle_error([&] {
auto mem = pyopencl_call_guarded(clCreateImage, ctx, flags, fmt,
desc, buf);
*img = new_image(mem, fmt);
});
#else
PYOPENCL_UNSUPPORTED(clCreateImage, "CL 1.1 and below")
#endif
}

#endif

error*
image__get_image_info(clobj_t _img, cl_image_info param, generic_info *out)
Expand Down

0 comments on commit 90b73be

Please sign in to comment.