当我尝试在TITAN BLACK中运行我的cuda程序时有一个问题,这样的事情(我简化了它看起来并不复杂)
int DIMX, DIMZ,DIMXM, DIMZM;
DIMXM=5700;
DIMZM=5700;
DIMX=DIMXM+20;
DIMZ=DIMZM+10;
float *temptxz = (float*)malloc( sizeof(float)*(DIMX*DIMZ));
float *temptxx = (float*)malloc( sizeof(float)*(DIMX*DIMZ));
float *temptzz = (float*)malloc( sizeof(float)*(DIMX*DIMZ));
float *tempvz = (float*)malloc( sizeof(float)*(DIMX*DIMZ));
float *tempvx = (float*)malloc( sizeof(float)*(DIMX*DIMZ));
for (int ij=0; ij<DIMX*DIMZ; ij++)
{
temptxz[ij]=0.0;
temptxx[ij]=0.0;
temptzz[ij]=0.0;
tempvx[ij]=0.0;
tempvz[ij]=0.0;
}
Run Code Online (Sandbox Code Playgroud)
NX = 4700可以; NZ = 4700; 但如果我增加一点(使内存大小超过2 GB),编译就可以了,但是当我运行程序时它崩溃并且警告是"0xC0000005:访问冲突写入位置0x00000000".
是因为malloc中存在某种限制大小?或者关于音调记忆的东西,在TITAN黑色中说它只有2 GB?
对不起我可怕的英语.谢谢