Hi all, For some strange reason, the OpenCL spec disallows allocating a zero-sized buffer. This wouldn't be so bad if it weren't for implementations that botch another part of the spec, namely that you're allowed to pass NULL pointers to kernels via clSetKernelArg, with effects of what I understand to be compliant invocations varying from segfaults to CL errors. (Yes, Intel, I'm looking at you.)
If you fall into a degenerate case here where your algorithm wants that zero-sized buffer, you can either decorate your code with lots of ifs, or you can try to make that degenerate case go through. I'm wondering whether it's a good idea to silently allocate one byte behind the user's back at the level of PyOpenCL and return that for the zero-sized buffer. On a related note, CL also disallows zero-sized grids. I'm wondering if I should also catch this at the PyOpenCL level and turn it into a no-op. The CL committee must have thought about these corner cases and decided on the current state of affairs. Are there compelling reasons to preserve this (I believe unhelpful) behavior in PyOpenCL? I'd much appreciate any comments--before I make API choices that become hard to back out. Andreas _______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
