inducer / pyopencl

OpenCL integration for Python, plus shiny features
http://mathema.tician.de/software/pyopencl
Other
1.06k stars 241 forks source link

An error in the documentation of cl.enqueue_copy #483

Closed doetools closed 2 years ago

doetools commented 3 years ago

In this documentation, I think it should be dst_offset instead of dest_offset, per the input arguments of function _enqueue_copy_buffer in pyopencl/cffi_cl.py, on line 1330.

image

doetools commented 3 years ago

It turned out I was confused by cl.enqueue_copy and _cl._enqueue_copy_buffer. The input argument of the first uses order of dst_buffer, src_buffer while that of the second uses src_buffer, dst_buffer (I guess the reason is to make it be on par with OpenCL specification of clEnqueueCopyBuffer). The former one uses dest_offset while the latter uses dst_offset as positional argument. In the _init_.py, there is a conversion to pop out dest_offset key and writes a key of dst_offset.

Don't get me wrong, I love using pyopencl (even more than C OpenCL)! It was my feeling that this part took me some effort to figure out. Someone with a C OpenCL background (like me) might come across this situation too.

inducer commented 3 years ago
inducer commented 2 years ago

452 has deprecations to standardize on dst_offset.