1 void verif_cumuls(int ** img_in, uint64 ** d_img_1, uint64 ** d_img_x, uint64 ** d_img_x2){
2 //allocation memoire CPU
7 /*pour test comparaison*/
11 cudaMemcpy( img_1b, *d_img_1, taille*sizeof(uint64), cudaMemcpyDeviceToHost );
12 cudaMemcpy( img_xb, *d_img_x, taille*sizeof(uint64), cudaMemcpyDeviceToHost);
13 cudaMemcpy( img_x2b, *d_img_x2, taille*sizeof(uint64), cudaMemcpyDeviceToHost);
15 for (int i=0; i<H; i++)
18 img_x[i][0] = img_in[i][0] ;
19 img_x2[i][0]= img_in[i][0]*img_in[i][0] ;
20 for (int j=1; j<L; j++)
22 img_1[i][j] = img_1[i][j-1] + 1 ;
23 img_x[i][j] = img_x[i][j-1] + img_in[i][j] ;
24 img_x2[i][j] = img_x2[i][j-1] + img_in[i][j]*img_in[i][j] ;
30 for (int i=0; i<H; i++){
31 for (int j=0; j<L; j++){
32 if( (img_1[i][j] != img_1b[i][j]) || (img_x[i][j] != img_xb[i][j]) || (img_x2[i][j] != img_x2b[i][j]) )
34 if (!(j%BS)) printf("\n");
35 #ifdef DISPLAY_ERR_IMG_CUMUL
36 printf("(%d,%d)CPU:%lu GPU:%lu\n",i, j, img_x2[i][j], img_x2b[i][j]);
37 printf("(%d,%d):CPU=%lu GPU=%lu\n",i,j,img_x[i][j], img_xb[i][j]);
44 printf("%d erreurs / %d points\n", cpt_err, cpt );