title: determine global memory available on GPU with JOCL?
body: <p>I'm writing a JOCl.org (which is different then jogamps jocl) running on GPU.  Were working with sufficient data that I need to be careful to stay under the GPU's global memory limit.  To do this I need a way of programmatically determining how much memory the GPU has.  I assume there must be a simple JOCL method/variable to do this, but for some reason I can't seem to figure out what it is.  I've looked at the CL.CL_MEM_SIZE and CL_DEVICE_GLOBAL_MEM_CACHE_SIZE but these both return something around 4100; I know I'm currently working with a graphics card that is suppose to contain 512 MB.</p>
  
  <p>Also, I can't seem to use nearly as much memory as I should.  In my worst case scenario I have to run a kernel that processes frames of 2^22 floats and will internally require twice as much data as frame size.  If I try to cache two frames (so 2 frames * 2^22 * 2^2 bytes/float * 2 for overhead = 2^26) I can cache without difficulty, but when I increase my caching so I process three frames at a time (or 2^25*3) I appear to run out of memory.  However, I believe I should only be using  ~100 of my 512 MB of global memory.  I believe I'm properly freeing memory when not used, but apparently I'm either doing something wrong or am misinterpreting the GPU's advertised 512 MB.  Can anyone help explain this confusion to me?</p>
  
  <p>Is there a way I can profile the GPU to get a sense for actual memory usage?</p>