From 58ec20675e87f54bd7d4f18bc608a3040f503c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albin=20Ahlb=C3=A4ck?= Date: Wed, 1 Nov 2023 16:28:34 +0100 Subject: [PATCH] Prune printing for fft_small tests --- src/fft_small/test/t-fmpz_poly_mul.c | 2 - src/fft_small/test/t-mpn_add_inplace_c.c | 1 - src/fft_small/test/t-mul.c | 51 -------------------- src/fft_small/test/t-nmod_poly_mul.c | 21 --------- src/fft_small/test/t-sd_fft.c | 59 ------------------------ 5 files changed, 134 deletions(-) diff --git a/src/fft_small/test/t-fmpz_poly_mul.c b/src/fft_small/test/t-fmpz_poly_mul.c index b283606c8d..7c1c3d3ff8 100644 --- a/src/fft_small/test/t-fmpz_poly_mul.c +++ b/src/fft_small/test/t-fmpz_poly_mul.c @@ -10,12 +10,10 @@ */ #include "test_helpers.h" -#include "ulong_extras.h" #include "fmpz.h" #include "fmpz_vec.h" #include "fmpz_poly.h" #include "fft_small.h" -#include "profiler.h" TEST_FUNCTION_START(_fmpz_poly_mul_mid_mpn_ctx, state) { diff --git a/src/fft_small/test/t-mpn_add_inplace_c.c b/src/fft_small/test/t-mpn_add_inplace_c.c index 440681d8e3..f5b7c7ab4c 100644 --- a/src/fft_small/test/t-mpn_add_inplace_c.c +++ b/src/fft_small/test/t-mpn_add_inplace_c.c @@ -10,7 +10,6 @@ */ #include "test_helpers.h" -#include "ulong_extras.h" #include "mpn_extras.h" #include "fft_small.h" #include "crt_helpers.h" diff --git a/src/fft_small/test/t-mul.c b/src/fft_small/test/t-mul.c index 7a6947c25b..92027986ff 100644 --- a/src/fft_small/test/t-mul.c +++ b/src/fft_small/test/t-mul.c @@ -14,35 +14,6 @@ #include "fft_small.h" #include "machine_vectors.h" -/* Defined in t-mul.c and t-sd_fft.c */ -#ifndef flint_print_d_fixed -#define flint_print_d_fixed flint_print_d_fixed -void flint_print_d_fixed(double x, ulong l) -{ - ulong i; - TMP_INIT; - TMP_START; - char* s = TMP_ARRAY_ALLOC(l + 1, char); - - for (i = 0; i < l; i++) - s[i] = ' '; - s[l] = 0; - - ulong y = fabs(rint(x)); - while (l > 0) - { - s[--l] = '0' + (y%10); - y = y/10; - if (y == 0) - break; - } - - printf("%s", s); - - TMP_END; -} -#endif - void test_mul(mpn_ctx_t R, ulong minsize, ulong maxsize, ulong nreps, flint_rand_t state) { ulong* a = FLINT_ARRAY_ALLOC(maxsize, ulong); @@ -50,14 +21,6 @@ void test_mul(mpn_ctx_t R, ulong minsize, ulong maxsize, ulong nreps, flint_rand ulong* c = FLINT_ARRAY_ALLOC(maxsize, ulong); ulong* d = FLINT_ARRAY_ALLOC(maxsize, ulong); - ulong dgs = n_sizeinbase(nreps, 10); - - flint_printf(" mul "); - flint_print_d_fixed(0, dgs); - flint_printf("/"); - flint_print_d_fixed(nreps, dgs); - fflush(stdout); - minsize = n_max(10, minsize); maxsize = n_max(minsize, maxsize); for (ulong rep = 0; rep < nreps; rep++) @@ -73,16 +36,6 @@ void test_mul(mpn_ctx_t R, ulong minsize, ulong maxsize, ulong nreps, flint_rand d[i] = n_randlimb(state); } - for (ulong ii = 0; ii < 2*dgs + 6; ii++) - flint_printf("%c", '\b'); - fflush(stdout); - - flint_printf(" mul "); - flint_print_d_fixed(1+rep, dgs); - flint_printf("/"); - flint_print_d_fixed(nreps, dgs); - fflush(stdout); - mpn_ctx_mpn_mul(R, d, a, an, b, bn); mpn_mul(c, a, an, b, bn); for (ulong i = 0; i < an + bn; i++) @@ -118,10 +71,6 @@ void test_mul(mpn_ctx_t R, ulong minsize, ulong maxsize, ulong nreps, flint_rand flint_free(b); flint_free(c); flint_free(d); - - for (ulong ii = 0; ii < 2*dgs + 6; ii++) - flint_printf("%c", '\b'); - fflush(stdout); } TEST_FUNCTION_START(mpn_ctx_mpn_mul, state) diff --git a/src/fft_small/test/t-nmod_poly_mul.c b/src/fft_small/test/t-nmod_poly_mul.c index 126cc5075c..4e571d2b1d 100644 --- a/src/fft_small/test/t-nmod_poly_mul.c +++ b/src/fft_small/test/t-nmod_poly_mul.c @@ -80,9 +80,6 @@ TEST_FUNCTION_START(_nmod_poly_mul_mid_mpn_ctx, state) ulong * a, *b, * c, * d; ulong an, zn, zl, zh, sz, i, reps; - flint_printf("sqr nbits: %02wu", nbits); - fflush(stdout); - for (reps = 0; reps < 100; reps++) { flint_set_num_threads(1 + n_randint(state, 10)); @@ -125,10 +122,6 @@ TEST_FUNCTION_START(_nmod_poly_mul_mid_mpn_ctx, state) flint_free(c); flint_free(d); } - - for (i = 0; i < 13; i++) - flint_printf("%c", '\b'); - fflush(stdout); } for (nbits = 1; nbits <= FLINT_BITS; nbits ++) @@ -136,9 +129,6 @@ TEST_FUNCTION_START(_nmod_poly_mul_mid_mpn_ctx, state) ulong * a, * b, * c, * d; ulong an, bn, zn, zl, zh, sz, i, reps; - flint_printf("mul nbits: %02wu", nbits); - fflush(stdout); - for (reps = 0; reps < 100; reps++) { flint_set_num_threads(1 + n_randint(state, 10)); @@ -185,10 +175,6 @@ TEST_FUNCTION_START(_nmod_poly_mul_mid_mpn_ctx, state) flint_free(c); flint_free(d); } - - for (i = 0; i < 13; i++) - flint_printf("%c", '\b'); - fflush(stdout); } for (nbits = 2; nbits <= FLINT_BITS; nbits++) @@ -197,9 +183,6 @@ TEST_FUNCTION_START(_nmod_poly_mul_mid_mpn_ctx, state) ulong an, bn, qn, i, reps; nmod_poly_divrem_precomp_struct M[1]; - flint_printf("divrem nbits: %02wu", nbits); - fflush(stdout); - for (reps = 0; reps < 100; reps++) { flint_set_num_threads(1 + n_randint(state, 10)); @@ -267,10 +250,6 @@ TEST_FUNCTION_START(_nmod_poly_mul_mid_mpn_ctx, state) flint_free(r1); flint_free(r2); } - - for (i = 0; i < 16; i++) - flint_printf("%c", '\b'); - fflush(stdout); } mpn_ctx_clear(R); diff --git a/src/fft_small/test/t-sd_fft.c b/src/fft_small/test/t-sd_fft.c index b0d7003ecd..f798fb9c9f 100644 --- a/src/fft_small/test/t-sd_fft.c +++ b/src/fft_small/test/t-sd_fft.c @@ -23,53 +23,11 @@ vec1d vec1d_eval_poly_mod(const vec1d* a, ulong an, const vec1d b, const vec1d n return vec1d_reduce_to_pm1n(x, n, ninv); } -/* Defined in t-mul.c and t-sd_fft.c */ -#ifndef flint_print_d_fixed -#define flint_print_d_fixed flint_print_d_fixed -void flint_print_d_fixed(double x, ulong l) -{ - ulong i; - TMP_INIT; - TMP_START; - char* s = TMP_ARRAY_ALLOC(l + 1, char); - - for (i = 0; i < l; i++) - s[i] = ' '; - s[l] = 0; - - ulong y = fabs(rint(x)); - while (l > 0) - { - s[--l] = '0' + (y%10); - y = y/10; - if (y == 0) - break; - } - - printf("%s", s); - - TMP_END; -} -#endif - void test_v2_fft(sd_fft_ctx_t Q, ulong minL, ulong maxL, ulong ireps, flint_rand_t state) { ulong irepmul = 10; minL = n_max(minL, LG_BLK_SZ); - ulong dgs1 = n_sizeinbase(maxL, 10); - ulong dgs2 = n_sizeinbase(ireps + irepmul*maxL, 10); - - flint_printf(" fft "); - flint_print_d_fixed(0, dgs1); - flint_printf("."); - flint_print_d_fixed(0, dgs2); - flint_printf("/"); - flint_print_d_fixed(maxL, dgs1); - flint_printf("."); - flint_print_d_fixed(0, dgs2); - fflush(stdout); - for (ulong L = minL; L <= maxL; L++) { ulong i; @@ -81,19 +39,6 @@ void test_v2_fft(sd_fft_ctx_t Q, ulong minL, ulong maxL, ulong ireps, flint_rand ulong nreps = ireps + irepmul*L; for (ulong rep = 0; rep < nreps; rep++) { - for (ulong ii = 0; ii < 2*(dgs1 + dgs2) + 8; ii++) - flint_printf("%c", '\b'); - - flint_printf(" fft "); - flint_print_d_fixed(L, dgs1); - flint_printf("."); - flint_print_d_fixed(1+rep, dgs2); - flint_printf("/"); - flint_print_d_fixed(maxL, dgs1); - flint_printf("."); - flint_print_d_fixed(nreps, dgs2); - fflush(stdout); - // randomize input data for (i = 0; i < Xn; i++) X[i] = i + 1; @@ -147,10 +92,6 @@ void test_v2_fft(sd_fft_ctx_t Q, ulong minL, ulong maxL, ulong ireps, flint_rand flint_aligned_free(data); flint_free(X); } - - for (ulong ii = 0; ii < 2*(dgs1 + dgs2) + 8; ii++) - flint_printf("%c", '\b'); - fflush(stdout); } TEST_FUNCTION_START(sd_fft, state)