I am programming in CUDA and problem in large array
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#define arraySize 356
int main()
{
srand((unsigned)time( NULL ));
char a[arraySize];
char b[arraySize];
char sigma[5] = "1234";
int i = 0;
int j = 0;
for(i=0; i<arraySize; i++)
{
a[i] = sigma[rand() % 4];
b[i] = sigma[rand() % 4];
}
for(i=0 ;i<arraySize; i++)
{
printf("%c",a[i]);
}
printf("\n");
for(i=0 ;i<arraySize; i++)
{
printf("%c",b[i]);
}
int c[(arraySize)*(arraySize)];
int c1[(arraySize)*(arraySize)];
getch();
return 0;
}
when modify arraySize>356 get error:
Unhandled exception at 0x5499cb17 (msvcr100d.dll) in cuda2.exe: 0xC00000FD: Stack overflow.
and cursor go to chkstk.asm
...
cs10:
cmp ecx, eax ; Is new TOS
jb short cs20 ; in probed page?
mov eax, ecx ; yes.
pop ecx
xchg esp, eax ; update esp
mov eax, dword ptr [eax] ; get return address
mov dword ptr [esp], eax ; and put it at new TOS
ret
; 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
...
please help me
RAM = 8GB
GPU = NVIDIA Geforce GT 540M/1GB DDR3
Windows 7 64bit;
Visual Studio 2010;