Increasing maximum variable size allowed on GPU (MATLAB)

After failing to resolve a memory leak problem in my MEX code, I tried writing the code to be as similar as possible to the example provided by MATLAB (unfortunatly, there is only one example of using CUDA in MEX) but, I got an error - "Maximum variable size allowed on the device is exceeded" when I try doing this:

mxGPUArray * tmp = mxGPUCreateGPUArray(4,
                        rSize,
                        mxDOUBLE_CLASS,
                        mxREAL,
                        MX_GPU_INITIALIZE_VALUES);

I printed rSize (which defines the dimensions of the gpuArray) beforehand, and I tried allocating a gpuArray of the exact same size in Matlab (using gpuArray.zeros(...) ), With no problems.

I've already tried preallocating the space necessary, and modifying the values of one of the rhs variables, but because of the small (but problematic) memory leaks, I'm trying to make the code as similar as possible to a code that doesn't cause memory leaks.

Does anyone know how to solve this problem? Is there any way to change this limit?

链接地址: http://www.djcxy.com/p/29280.html

上一篇: MATLAB错误:超出设备允许的最大变量大小

下一篇: 在GPU上允许增加最大可变尺寸(MATLAB)