- printf("COPY : %s, DIAGOS = %d / %d\n", (ret==0)?"OK":"ERREUR", h_n_diagos,MAX_DIAGOS);
- for (int d=0; d<200;d++){
- printf("| (%d,%d)-(%d,%d) ", h_diagos_snake[d].x, h_diagos_snake[d].y, h_diagos_snake[d].z, h_diagos_snake[d].w );
+ //recup data rectangles
+ int ret;
+ ret = cudaMemcpy( h_all_crit, d_all_crit, Nperm*sizeof(t_rectangle_snake), cudaMemcpyDeviceToHost) ;
+ printf("COPIE DATA = %s\n",(ret==0)?"OK":"ERR");
+
+ //optimum sur CPU
+ best_crit = h_all_crit[0].crit ;
+ ind_best_crit = 0 ;
+ for (int k=1; k<100; k++){
+ if ((h_all_crit[k].crit > 0) && (h_all_crit[k].crit < best_crit)) {
+ best_crit = h_all_crit[k].crit ;
+ ind_best_crit = k ;
+ }
+ printf("%d -> ( %d, %d )--( %d, %d) CRITERE = %f\n", k, h_all_crit[k].bpi, h_all_crit[k].bpj,
+ h_all_crit[k].opi, h_all_crit[k].opj, h_all_crit[k].crit );