Bug in clCreateImage2D()

Bug in clCreateImage2D()

First - would love to see Windows x64 support.
Second - clCreateImage2D() crashes consistently, if CL_MEM_COPY_HOST_PTR is passed.
To repro, modify the GodRays sample. In GodRays.cpp, within ExecuteGodRaysKernel(), replace the first clCreateBuffer() call with the following lines:

const cl_image_format imgfmt = { CL_RGBA, CL_FLOAT };
g_inputBuffer = clCreateImage2D(g_context, CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR, &imgfmt, arrayWidth, arrayHeight, 0, inputArray, &err);

You don't need to modify the .cl; you should see an access violation within clCreateImage2D(), in intelocl.dll at offset 0x4037b.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

>>First - would love to see Windows x64 support.
The lastest SDK includes x64 support !!! Please, notice Intel refreshed the Alpha just a few days ago!

>>Second - clCreateImage2D() crashes consistently, if CL_MEM_COPY_HOST_PTR is passed.
Yep, it's strange... in theory should work with 0 but perhaps you could try to pass sizeof(cl_float4)*arrayWidth instead.

The CL 1.1 spec, section "5.3.1 Creating Image Objects" around page 74 is clear though, the image pitch could be zero and it should work:

image_row_pitch is the scan-line pitch in bytes. This must be 0 if host_ptr is NULL and can be
either 0 or >= image_width * size of element in bytes if host_ptr is not NULL. If host_ptr is not
NULL and image_row_pitch = 0, image_row_pitch is calculated as image_width * size of
element in bytes. If image_row_pitch is not 0, it must be a multiple of the image element size in
bytes

Please, notice Intel refreshed the Alpha just a few days ago!

Cool, didn't see that. x64! and they even fixed my clCreateImage2D() bug! Thanks guys.
Guess my report was just a few days late :-)

you could try to pass sizeof(cl_float4)*arrayWidth instead

Yeah, I did try that. Only thing that worked for me was switching to CL_MEM_USE_HOST_PTR instead of COPY. But it's fixed now, so I'm happy. Thanks for the heads-up.

Leave a Comment

Please sign in to add a comment. Not a member? Join today