[PyOpenCL] pyopencl.array padding for edge cases
lists at informa.tiker.net
Sun Aug 21 07:26:45 PDT 2011
On Sun, 21 Aug 2011 08:57:43 +0000 (UTC), Steven <keldor at centcom.com> wrote:
> The problem is that my_array.flatten[:16384] only returns an array with
> 16384 elements if my_array is at least that large. In my case, it's
> actually slightly smaller in the edge case, since I have to add a dead zone
> to the end of the image so that it slices into buffers of the same size.
> However, the input image is unsliced and thus doesn't have this dead zone,
> hence the final slice will go out of bounds and end up truncated.
> This causes enqueue_copy to fail with an INVALID PARAMETER error, which I
> strongly suspect is because the source array and destination buffer are of
> different sizes. Ideally, it would not fail, but rather simply copy
> min(source_size,dest_size) bytes, which is the desired result in this case.
Copying a small source array into a big destination array is fine
according to my experiments. You can test this by simply allocating too
much memory in examples/demo.py. Can you post a simplified test that
exhibits the behavior you describe?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the PyOpenCL