- if (nb_nodes == 4) genere_snake_rectangle_4nodes_gpu<<< 1, 1>>>(*d_snake, 140, H, L) ;
- else if (nb_nodes == 40) genere_snake_rectangle_Nnodes_gpu<<< 1, 1>>>(*d_snake, (H+L)/20, H, L) ;
+
+ int MAX_DIAGOS = 1024*65536 ;
+ int ret, Q = 100 ;
+ uint4 * d_diagos_snake ;
+ uint4 * h_diagos_snake = new uint4[MAX_DIAGOS];
+
+
+ ret = cudaMalloc( (void**) &d_diagos_snake, MAX_DIAGOS*sizeof(uint4)) ;
+
+ genere_diagos_rectangle<<<1,1>>>(d_diagos_snake, H,L,Q);
+
+ ret = cudaMemcpy( h_diagos_snake, d_diagos_snake, MAX_DIAGOS*sizeof(uint4), cudaMemcpyDeviceToHost) ;
+ //cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidDevicePointer, cudaErrorInvalidMemcpyDirection
+
+ printf("COPY : %d, MAX_DIAGOS = %d\n", ret, 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 );
+ }
+
+ exit(0);
+ genere_snake_rectangle_4nodes_gpu<<< 1, 1>>>(*d_snake, 140, H, L) ;
+