During the execution of my program the user can change the size of data to be allocated on the device. So program crashes on large sizes of data. Access violation(Windows) or Segmentation fault(Linux) errors are appeared during execution following line:
Code :clCreateBuffer(cxGPUContext, CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR, new_size * sizeof(float), buffer , &ciErrNum);
I need to know the maximum size of data that can be allocated.
Is it any way to know the amount of free memory on the device?