[pipepar] Allocate variable statically in lattice

Not sure declarations leads to real allocation anyway (it should be done
according to the pragmas instead) but just in case, move the declaration
of variables in main so that they are statically allocated.
This commit is contained in:
Thomas Preud'homme 2012-09-04 19:58:26 +02:00
parent c32076505e
commit 4827baead3
1 changed files with 36 additions and 37 deletions

View File

@ -38,6 +38,42 @@ struct stage_state
double lattice_metrics[1 << CRC_BIT]; // cumulative metrics (~ 3.2 MB if 1 core)
};
uint_fast16_t p_matrix[NB_CORES][AAC_SCE_PROT_BIT / NB_CORES]; // P matrix (~ 3 KB)
double *lattice_metrics[NB_CORES];
struct stage_state state0;
#if NB_CORES > 1
struct stage_state state1; // ~3.2 MB / NB_CORES
#if NB_CORES > 2
struct stage_state state2; // ~3.2 MB / NB_CORES
#if NB_CORES > 3
struct stage_state state3; // ~3.2 MB / NB_CORES
#if NB_CORES > 4
struct stage_state state4; // ~3.2 MB / NB_CORES
#if NB_CORES > 5
struct stage_state state5; // ~3.2 MB / NB_CORES
#if NB_CORES > 6
struct stage_state state6; // ~3.2 MB / NB_CORES
#if NB_CORES > 7
struct stage_state state7; // ~3.2 MB / NB_CORES
#if NB_CORES > 8
struct stage_state state8; // ~3.2 MB / NB_CORES
#if NB_CORES > 9
struct stage_state state9; // ~3.2 MB / NB_CORES
#if NB_CORES > 10
struct stage_state state10; // ~3.2 MB / NB_CORES
#if NB_CORES > 11
struct stage_state state11; // ~3.2 MB / NB_CORES
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
// Heuristic to compute ln(exp(x) + exp(y)) with x = ln(a1/b1) and y = ln(a2/b2)
double jacolog(double x, double y)
@ -272,43 +308,6 @@ int compute_metrics(void)
{
int i, j;
unsigned int seed = 42;
uint_fast16_t p_matrix[NB_CORES][AAC_SCE_PROT_BIT / NB_CORES]; // P matrix (~ 3 KB)
double *lattice_metrics[NB_CORES];
struct stage_state state0;
#if NB_CORES > 1
struct stage_state state1; // ~3.2 MB / NB_CORES
#if NB_CORES > 2
struct stage_state state2; // ~3.2 MB / NB_CORES
#if NB_CORES > 3
struct stage_state state3; // ~3.2 MB / NB_CORES
#if NB_CORES > 4
struct stage_state state4; // ~3.2 MB / NB_CORES
#if NB_CORES > 5
struct stage_state state5; // ~3.2 MB / NB_CORES
#if NB_CORES > 6
struct stage_state state6; // ~3.2 MB / NB_CORES
#if NB_CORES > 7
struct stage_state state7; // ~3.2 MB / NB_CORES
#if NB_CORES > 8
struct stage_state state8; // ~3.2 MB / NB_CORES
#if NB_CORES > 9
struct stage_state state9; // ~3.2 MB / NB_CORES
#if NB_CORES > 10
struct stage_state state10; // ~3.2 MB / NB_CORES
#if NB_CORES > 11
struct stage_state state11; // ~3.2 MB / NB_CORES
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
{
int len;