it seems that my code does nothing, don’t know what’s wrong with it tough…
int Base = threadIdx.x;
int End = Base + elementN;
float sum = 5.0f;
for(int i = Base; i < End; i += blockDim.x){
sum += d_data_A[i] * d_data_B[i];
}
//__syncthreads();
d_data_C[0] = sum;
}
when this kernel function returns, the result is 5.0, so the variable sum stays unchanged.
It seems CUDA dislikes out-of-bound access to device memory.
Moreover, strange things happen when you try to use datas taken by memory cells subject to collisions. In my case (I’m making a raytracing algorithm) such these conditions are often generated.
The worst drawback is that CUDA doesn’t execute my wrong code, thus achieving some excellent speed results !!! :huh: