stranges kernel crashes

hello everybody,

I’m encountering stranges problems on a cuda program that i’m doing, I hope that somebody can tell me of similar experiences :

I process images using 3 filters, the ouput of a pixel being a mix of the 3 filter outputs, so I use 3 device function to get my responses :

int x = filter1Response(…);
int y = filter2Response(…);
int z = filter3Response(…);

I tested each response separaterly and they seems ok, but next, as I’m using 1 thread per pixel in my image, I try to affect the output directly :

odata[blockIdx.x * blockDim.x + threadIdx.x] = x * y + z * z;

and the program doesn’t work at all : no visible error, but each cudaMemcpy seems to get in memory the result of
the previous succesful execution.

but if I try something like that :

odata[blockIdx.x * blockDim.x + threadIdx.x] = x;
odata[blockIdx.x * blockDim.x + threadIdx.x] = odata[blockIdx.x * blockDim.x + threadIdx.x] * y;

i can see the right output for xy… if I try to use local variables to store the values, I find the same problem, but I can’t rely only on odata to store the values for this kind of operation…

I’m really without a clue here, if somebody can give me advice, I would be grateful…

Not a linux issue. Better to ask in the cuda programming forum.