I am working on OpenCL and I code like this in MS VS 2012:
cl_float test[480000];
It can be complied successfully but the program crashes when it enter the function which the codes above are in. Error Code: 0xC000041D.
It is interrupted near the end of file "chkstk.asm":
; Find next lower page and probe
cs20:
sub eax, _PAGESIZE_ ; decrease by PAGESIZE
test dword ptr [eax],eax ; probe page.
jmp short cs10
_chkstk endp
end
On the line test dword ptr [eax],eax ; probe page.
.
I don't think this array is too big to be allocated.
So next, I want to try another way:
cl_float4 *PixVectIn=(cl_float4*)malloc(480000*sizeof(cl_float4));
for(unsigned int a=0;a<800;a++){
for(unsigned int b=0;b<600;b++){
PixVectIn[a*800+b].x=PixVect[a][b][0];
PixVectIn[a*800+b].y=PixVect[a][b][1];
PixVectIn[a*800+b].z=PixVect[a][b][2];
}
}
The program also can be built. This time, it crashes when run the "for" loop.
It stop at PixVectIn[a*800+b].x=PixVect[a][b][0];
. It shows me the same error code and at this moment, a=600 and b=252. Looks like it reaches a boundary something.
I'm not sure. It may because I changed certain options in project properties.