Add ability to use part of an array as a parameter to OpenCL
Status: Beta
Brought to you by:
nythrix
If I am processing data sets larger than will fit in GPU memory, I currently have to copy each piece into a smaller .NET array, then pass that array to a new ComputeBuffer(...), or get an array from ComputeCommandQueue.Read(...) and copy its contents into my larger result array.
Here is a patch that overloads the ComputeBuffer constructor and the ComputeCommandQueue.Read method to allow them to take an array with a start offset and count.
Patch to ComputeBuffer.cs and ComputeCommandQueue.cs
Actually, it is possible to easily achieve this functionality, provided you have the latest version. I've attached a small example which demonstrates this. Let me know if you need further help.
Thanks for the patch. Because of issues with non-blocking calls it is not directly applicable but it reminded me of a feature I'd forgotten about.
Accepted with modifications. See also: https://sourceforge.net/tracker/?func=detail&aid=2970921&group_id=290412&atid=1229017