title: With OpenCL, How to get GPU memory usage?
body: <p>I'm looking for a reliable way to determine current GPU memory usage with OpenCL. </p>
  
  <p>I have found NVidia API: <a href="http://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g376b97f5ab20321ca46f7cfa9511b978" rel="nofollow noreferrer">cudaMemGetInfo( size_t* free, size_t* total )</a> to get free memory and total memory on the current device.</p>
  
  <p>But I'm looking for a solution for AMD and OpenCL. I did not find if there is similar functionality in OpenCL and I don't know if AMD has something equivalent.</p>
  
  <p>I don't want to know how much free memory there is on OpenCL devices before allocating buffers but free memory afer allocating buffers. 
  A priori as indicated in <a href="https://stackoverflow.com/questions/3568115/how-do-i-determine-available-device-memory-in-opencl">How do I determine available device memory in OpenCL?</a>, With OpenCL, there is no way, and there is no need to know it.</p>