I am running the following code, which is a simple BFS.
every thread checks its set of nodes whether they are at the current level and marks its neighbours if they are not yet marked.
But I am getting this error.
cudaSafeCall() Runtime API error in file <main.cu>, line 76 : unspecified launch failure
when I return from the kernel, I do a thread synchronize and try to copy the array “levels” to the host memory and that it where the error is shown.
for(i=tid; i < numNodes; i+=numThreads){
if(levels[i] == currLevel){
int nbrStart = nodes[i], nbrEnd = nodes[i+1]; // ??
for(j=nbrStart; j<nbrEnd; j++){
nbr = edges[j];
if( levels[nbr] == -1)
levels[nbr] = currLevel+1;
}
}
Can somebody please help me. Thanks in Advance.