#include #include #define MAXT 20 #define CT 0.335 #define END 3 #define N 20 //#define END 20 //#define N 5000 //float mt_1[N][N]; // matrix with the plate's state at time t-1 //float mt[N][N]; // idem for time t void debug_chp(float *chp) { int i, j; printf("\n"); for(i=0; i< N; i++) { printf("i:%d ", i); for(j=0; j>>(pt_1); //cudaMemcpy(t, pt_1, N*N*sizeof(float), cudaMemcpyDeviceToHost); //debug_chp(t); for(step=0; step < END; step++) { stepChp<<>>(pt_1,pt); float *tmp; tmp = pt_1; pt_1 = pt; pt = tmp; } cudaMemcpy(t, pt_1, N*N*sizeof(float), cudaMemcpyDeviceToHost); //debug_chp(t); cudaFree(pt_1); cudaFree(pt); f= fopen("simulacao.bin", "w"); fwrite(t, sizeof(float), N*N, f); fclose(f); free(t); return 0; }