Re: Maximum size of CLBuffer<FloatBuffer>
Posted by
Sven Gothel on
Nov 27, 2014; 9:32pm
URL: https://forum.jogamp.org/Maximum-size-of-CLBuffer-FloatBuffer-tp4033567p4033665.html
On 11/18/2014 03:23 AM, Wade Walker [via jogamp] wrote:
> I'm not sure how we'd get around this, since
> java.nio.ByteBuffer.allocateDirect() takes an int size, and in Java int is
> always 32-bit signed two's complement. Even array indices in Java are 32-bit
> ints, so a one-dimensional array is no bigger. The native OpenCL
> clCreateBuffer() function can create bigger buffers if CL_DEVICE_ADDRESS_BITS
> from clGetDeviceInfo() is 64, but you can't create a CL buffer from a Java
> direct buffer that way, since JOCL uses the direct buffer's size to call
> clCreateBuffer() with :)
>
> One option might be to subdivide your buffer into chunks of 1GB or so, and
> process the chunks one at a time. Even on a huge graphics card, you'd only
> have 12 chunks to deal with. You'd have to do something like this if your
> array is bigger than your physical memory anyway, which it sounds like you're
> getting close to.
GlueGen's MappedByteBufferInputStream employs using NIO memory chunks,
here a file's memory mapped region:
<
http://forum.jogamp.org/How-to-delete-direct-Buffers-tp4033631p4033659.html>
IMHO you can use that .. or we may add a specialization.
~Sven