X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/snake_gpu.git/blobdiff_plain/935bdd1c8b99ce5d70b6e4a53ca29f06353e8baa..c17ca25473465d5550bc7e3e27b87b3d33d28dc6:/src/lib_kernel_snake_2_gpu.cu diff --git a/src/lib_kernel_snake_2_gpu.cu b/src/lib_kernel_snake_2_gpu.cu index 8d819a8..b807cb7 100644 --- a/src/lib_kernel_snake_2_gpu.cu +++ b/src/lib_kernel_snake_2_gpu.cu @@ -33,6 +33,27 @@ __global__ void genere_snake_rectangle_4nodes_gpu(snake_node_gpu * d_snake, int } } +__global__ void genere_diagos_rectangle(uint4 * d_diagos, int h, int l, int q){ + int inci = h/q; + int incj = l/q; + int iM,jM, iN, jN ; + int idxDiago = 0 ; + // boucle double pour les positions du point NO de la diagonale + for ( iM = 0; iM < q-1; iM++){ + for (jM = 0 ; jM < q-1 ; jM++){ + //boucle double pour les positions du point SE de la diagonale + for (iN = iM+1; iN < q; iN++){ + for (jN = jM+1; jN < q; jN++){ + d_diagos[idxDiago].x = iM*inci; + d_diagos[idxDiago].y = jM*incj; + d_diagos[idxDiago].z = iN*inci; + d_diagos[idxDiago].w = jN*incj; + idxDiago++; + } + } + } + } +} __global__ void genere_snake_rectangle_Nnodes_gpu(snake_node_gpu * d_snake, int dist_bords, int i_dim, int j_dim){ int nb_node_seg = 9 ;