{
const float i = s + 1;
const float xi = -1 + i * deltaX;
- threadResult += sqrtf(1-xi*xi);
+ threadResult += sqrtf(1 - xi * xi);
s += NB_THREAD;
}
const int TID_LOCAL = Indice1D::tidLocal();
if (TID_LOCAL == 0)
{
- atomicAdd(ptrResult, float(tabSM[0]));
+ atomicAdd(ptrResult, tabSM[0]);
}
}
bool saucisson()
{
- cout << "saucisson() ..." << endl;
+ cout << endl << "saucisson() ..." << endl;
// Nombre d'échantillon. Au-delà, la qualité du résultat n'est pas meilleure. Il faudrait employé des doubles à la place de floats.
const int N = 100000;
// Allocation coté GPU en global memory (GM).
- float* ptrDevResult = 0;
+ float* ptrDevResult;
HANDLE_ERROR(cudaMalloc(&ptrDevResult, sizeof(float)));
HANDLE_ERROR(cudaMemset(ptrDevResult, 0, sizeof(float)));