-1

私はCUDAでプログラミングしており、大きな配列で問題を抱えています

#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;
}

arraySize>356 を変更するとエラーが発生します:

Unhandled exception at 0x5499cb17 (msvcr100d.dll) in cuda2.exe: 0xC00000FD: Stack overflow.

カーソルは 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
...

私を助けてください

RAM = 8GB

GPU = NVIDIA Geforce GT 540M/1GB DDR3

Windows 7 64 ビット;

Visual Studio 2010;

4

1 に答える 1