WIP: Outil de mesure du temps CPU pour des nombres de vertex croissants; 'décrochage' exp vers 10⁶ vertex

This commit is contained in:
Jean Sirmai 2023-10-20 14:43:14 +02:00
parent 6bce5e4588
commit 89c593ad38
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 30 additions and 8 deletions

View File

@ -30,6 +30,7 @@
#include "../../include/graphics.h" #include "../../include/graphics.h"
#include "../../include/arrows.h" #include "../../include/arrows.h"
#include "../../include/grid.h" #include "../../include/grid.h"
// #include <bits/stdc++.h> TODO
#define VERTEX_SHADER_FILE "src/shaders/shader.vert" #define VERTEX_SHADER_FILE "src/shaders/shader.vert"
#define FRAG_SHADER_FILE "src/shaders/shader.frag" #define FRAG_SHADER_FILE "src/shaders/shader.frag"
@ -676,7 +677,7 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void)
int rand(void); int rand(void);
void srand(unsigned int seed); // printf ("Valeur max : %d\n", RAND_MAX); min + rand() % (max+1 - min); void srand(unsigned int seed); // printf ("Valeur max : %d\n", RAND_MAX); min + rand() % (max+1 - min);
int arbitrary = 200; int arbitrary = 0;
int space_X = 1 + rand() % arbitrary, int space_X = 1 + rand() % arbitrary,
space_Y = 1 + rand() % arbitrary, space_Y = 1 + rand() % arbitrary,
space_Z = 1 + rand() % arbitrary; space_Z = 1 + rand() % arbitrary;
@ -689,14 +690,35 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void)
int specif_arrows_nb = rand() % density_max / 3; int specif_arrows_nb = rand() % density_max / 3;
int arrows_nb = 0; int arrows_nb = 0;
while (arrows_nb < specif_arrows_nb){ /* while (arrows_nb < specif_arrows_nb){ */
/* arrows_nb = set_arrow (arrows, arrows_nb, */
/* rand() % arbitrary + 1, // load / weight */
/* rand() % 6, // site, */
/* rand() % space_X, // x */
/* rand() % space_Y, // y */
/* rand() % space_Z); // z */
/* } */
// clock_t start, end;
/* Recording the starting clock tick.*/
// start = clock();
arbitrary = 24;
space_X = arbitrary; space_Y = arbitrary; space_Z = arbitrary;
density_max = space_X * space_Y * space_Z;
for (int i =0; i < space_X; i++)
for (int j =0; j < space_Y; j++)
for (int k =0; k < space_Z; k++)
for (int u =0; u < 6; u++)
arrows_nb = set_arrow (arrows, arrows_nb, arrows_nb = set_arrow (arrows, arrows_nb,
rand() % arbitrary, // load / weight 1, // load / weight
rand() % 6, // site, u,//i % 6, // site,
rand() % space_X, // x i,//i % space_X, // x
rand() % space_Y, // y j,//i % space_Y, // y
rand() % space_Z); // z k//i % space_Z);
} );
// end = clock(); printf("Elapsed time %ld\n", end - start);
print_user_choices(arrows, arrows_nb, space_X, space_Y, space_Z, print_arrows_data, show_space_design); print_user_choices(arrows, arrows_nb, space_X, space_Y, space_Z, print_arrows_data, show_space_design);