-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added suffixed enums for cl_khr_image2d_from_buffer #44
added suffixed enums for cl_khr_image2d_from_buffer #44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Reviewed in conjunction with KhronosGroup/OpenCL-Docs#60.
There are CPUs (Intel i3-3250) that have support for OpenCL 1.2 and mentioned extension. I don't see why the extention becoming a feature in 2.0 justifies exclusion of the defines from versions prior to 2.0. |
It gets even worse when trying to implement zero copy image from buffer with the c++ headers in OpenCL 1.2 as it requires you to set the cl_image_desc structs buffer/mem_object union to the desired buffer object that needs to be transformed into an image (like in this example). The C++ Image2d Implementation simply uses the c versions clCreateImage function but with a fixed cl_image_desc which in turn doesn't let you specify the buffer/mem_object union... |
Hi @Smeany, regarding:
The basic idea is that you would use the This is slightly academic in that all devices that support the core feature also must support the extension, and both the suffixed and un-suffixed enums have the same value. For maximal compatibility you could use the suffixed enums exclusively - this would be my recommendation unless you're compiling for OpenCL 2.0 or newer devices. I'm not quite following the issue with Thanks! |
Thank you @bashbaug , I was not aware of the
|
Could you use this Image2D constructor? https://github.com/KhronosGroup/OpenCL-CLHPP/blob/master/include/CL/opencl.hpp#L4856 /*! \brief Constructs a 2D Image from a buffer.
* \note This will share storage with the underlying buffer.
*
* Wraps clCreateImage().
*/
Image2D(
const Context& context,
ImageFormat format,
const Buffer &sourceBuffer,
size_type width,
size_type height,
size_type row_pitch = 0,
cl_int* err = nullptr)
... Note, you will need to define |
This is a partial fix for #42.
This change adds
KHR
suffixed enums forcl_khr_imaged2d_from_buffer
to cl_ext.h.It also moves the un-suffixed enums for
cl_khr_image2d_from_buffer
in cl.h to a section protected by#ifdef CL_VERSION_2_0
, not#ifdef CL_VERSION_1_2
, since the extension became a core feature in OpenCL 2.0.