Login  Register

Api copy works when copying individual elements but not the entire buffer

Posted by Coby Soss on Oct 25, 2012; 12:03am
URL: https://forum.jogamp.org/Api-copy-works-when-copying-individual-elements-but-not-the-entire-buffer-tp4026612.html

This code doesn't appear to send the correct data to the kernel.

clBuffer.getBuffer().clear();
clBuffer.getBuffer().rewind();
clBuffer.getBuffer().put(Buffer,0, Buffer.length);
clQueue.putWriteBuffer(clBuffer, true);

This code does

clBuffer.getBuffer().clear();
clBuffer.getBuffer().rewind();
clBuffer.getBuffer().put(0,Buffer[0]);
clQueue.putWriteBuffer(clBuffer, true);

Both overloads of put are being used correctly according to the java documentation. Is there something about the JOCL API that causes one version of put to be sent to the kernel and not the other?