Pranav Bhatkhande
Pranav Bhatkhande

Reputation: 1

Getting a fatal error in cuda using visual studio 2008, code, logs, attached

I'm trying to write a cuda program for my school project. There seems to an error when I try to debug the project(cuda works fine, as I've run the examples and some of my previous code works fine too). I get a fatal error and the degugger points me to dgbhook.c and exits. Here is my code, am I doing something really stupid? Screen shots and code attached here(code is a pastie, linked at the end)

Code attached

Upvotes: 0

Views: 120

Answers (1)

Tom
Tom

Reputation: 21108

Before you even get to CUDA code you have the following:

#define N 15
//...
int main( void ) {
    float a[N], c[N];
    int i,m=3,n=18;
    //...
    for(i=m;i<=m+n-1;i++)
        a[i] = 0;

So you're writing up to a[20] and b[20] which seems like a likely source of problems...

You should make sure you're building with debug symbols then step into the code to track down the source of a problem like this.

Upvotes: 1

Related Questions