Hi,

I have a problem in my CUDA kernel function.

This is the function

//GPU Kernel

**global** void CalcProbKernel(float* Mu, float* Sigma, float* MLEConst1_minus_LogSigma,

int NbrOfRobotPos,

float* AnodeData, int* BestRobotPos, int ArraySize) {

int idx = blockDim.x * blockIdx.x + threadIdx.x;

if (idx >= ArraySize)

return;

```
float Help;
float Prob;
float BestProb = -1*1E10;
BestRobotPos[idx] = 0;
int index1,index2;
int Cntr1,Cntr2;
float LocalMu, LocalSigma, LocalMLEConst1, LocalAnodeData;
for (Cntr1=0;Cntr1<NbrOfRobotPos;Cntr1++){
Prob = 0;
for (Cntr2=0;Cntr2<64;Cntr2++){
index1 = Cntr1*64+Cntr2;
index2 = Cntr2+idx*64;
LocalMu = Mu[index1];
LocalSigma = Sigma[index1];
LocalMLEConst1 = MLEConst1_minus_LogSigma[index1];
LocalAnodeData = AnodeData[index2];
Help = (LocalAnodeData-LocalMu) / LocalSigma;
Prob = Prob + LocalMLEConst1 - 0.5 * Help * Help;
}
if (Prob > BestProb){
BestProb = Prob;
BestRobotPos[idx] = Cntr1;
}
```

}

}

It searches the index with the heighest probability. The problem is that it crashes (windows warning: display driver stopped responding)

If I change

index1 = Cntr1*64+Cntr2;

to

index1 = Cntr1*64+1; then it does not crash.

it works with every possible ConstantNbr in a range from 0 to 63

index1 = Cntr1*64+ConstantNbr;

It seems as if Cntr2 causes some problem. I am sure that the indexes in the kernel function stay in the appropriate range.

Has anybody got an idea?

Thanks

Karel D