From: Alexei Sheplyakov Date: Sun, 7 Sep 2008 14:39:54 +0000 (+0400) Subject: benchmarks: time{catalan,euler,exp1,zeta3}.cc actually compile and work now. X-Git-Tag: cln_1-3-0~23 X-Git-Url: https://www.ginac.de/CLN/cln.git//cln.git?p=cln.git;a=commitdiff_plain;h=bab7afc539d77e4f931936a591c8e57622ac85ec benchmarks: time{catalan,euler,exp1,zeta3}.cc actually compile and work now. These benchmarks use internal CLN functions. Even worse -- they expect to find these functions in the global namespace. Declare internal CLN functions in the namespace cln. --- diff --git a/tests/timecatalan.cc b/tests/timecatalan.cc index 4ddb6be..36c1bf7 100644 --- a/tests/timecatalan.cc +++ b/tests/timecatalan.cc @@ -8,6 +8,18 @@ #include #include "float/lfloat/cl_LF.h" #include +namespace cln +{ +// FIXME: using internal functions is a bad idea (even if it works +// on some ELF systems) +extern cl_LF compute_catalanconst_ramanujan (uintC len); +extern cl_LF compute_catalanconst_ramanujan_fast (uintC len); +extern cl_LF compute_catalanconst_expintegral1 (uintC len); +extern cl_LF compute_catalanconst_expintegral2 (uintC len); +extern cl_LF compute_catalanconst_cvz1 (uintC len); +extern cl_LF compute_catalanconst_cvz2 (uintC len); +} + using namespace cln; using namespace std; @@ -21,12 +33,8 @@ int main (int argc, char * argv[]) if (argc < 2) exit(1); uintL len = atoi(argv[1]); - extern cl_LF compute_catalanconst_ramanujan (uintC len); - extern cl_LF compute_catalanconst_ramanujan_fast (uintC len); - extern cl_LF compute_catalanconst_expintegral1 (uintC len); - extern cl_LF compute_catalanconst_expintegral2 (uintC len); - extern cl_LF compute_catalanconst_cvz1 (uintC len); - extern cl_LF compute_catalanconst_cvz2 (uintC len); + + cl_LF p; ln(cl_I_to_LF(1000,len+10)); // fill cache { CL_TIMING; diff --git a/tests/timeeuler.cc b/tests/timeeuler.cc index 40f44ea..f0730e6 100644 --- a/tests/timeeuler.cc +++ b/tests/timeeuler.cc @@ -7,6 +7,19 @@ #include #include #include "float/lfloat/cl_LF.h" +namespace cln +{ +// FIXME: don't use internal functions. +extern cl_LF compute_eulerconst (uintC len); +extern cl_LF compute_eulerconst_expintegral (uintC len); +extern cl_LF compute_eulerconst_expintegral1 (uintC len); +extern cl_LF compute_eulerconst_expintegral2 (uintC len); +extern cl_LF compute_eulerconst_besselintegral1 (uintC len); +extern cl_LF compute_eulerconst_besselintegral2 (uintC len); +extern cl_LF compute_eulerconst_besselintegral3 (uintC len); +extern cl_LF compute_eulerconst_besselintegral4 (uintC len); +} + using namespace cln; int main (int argc, char * argv[]) @@ -19,14 +32,8 @@ int main (int argc, char * argv[]) if (argc < 2) exit(1); uintL len = atoi(argv[1]); - extern cl_LF compute_eulerconst (uintC len); - extern cl_LF compute_eulerconst_expintegral (uintC len); - extern cl_LF compute_eulerconst_expintegral1 (uintC len); - extern cl_LF compute_eulerconst_expintegral2 (uintC len); - extern cl_LF compute_eulerconst_besselintegral1 (uintC len); - extern cl_LF compute_eulerconst_besselintegral2 (uintC len); - extern cl_LF compute_eulerconst_besselintegral3 (uintC len); - extern cl_LF compute_eulerconst_besselintegral4 (uintC len); + + cl_LF p; ln(cl_I_to_LF(1000,len+10)); // fill cache #if 0 diff --git a/tests/timeexp1.cc b/tests/timeexp1.cc index fac40e3..5aeab13 100644 --- a/tests/timeexp1.cc +++ b/tests/timeexp1.cc @@ -6,6 +6,12 @@ #include #include #include +namespace cln +{ +// FIXME: don't use internal functions! +extern cl_LF compute_exp1 (uintC len); +} + using namespace cln; int main (int argc, char * argv[]) @@ -18,7 +24,6 @@ int main (int argc, char * argv[]) if (argc < 2) exit(1); uintL len = atoi(argv[1]); - extern cl_LF compute_exp1 (uintC len); cl_LF p; { CL_TIMING; for (int rep = repetitions; rep > 0; rep--) diff --git a/tests/timezeta3.cc b/tests/timezeta3.cc index 898b958..cbdb8a0 100644 --- a/tests/timezeta3.cc +++ b/tests/timezeta3.cc @@ -6,6 +6,15 @@ #include #include #include "float/lfloat/cl_LF.h" +namespace cln +{ +// FIXME: don't use internal functions. +extern cl_LF zeta (int s, uintC len); +extern cl_LF compute_zeta_exp (int s, uintC len); +extern cl_LF compute_zeta_cvz1 (int s, uintC len); +extern cl_LF compute_zeta_cvz2 (int s, uintC len); +extern cl_LF zeta3 (uintC len); +} using namespace cln; #include using namespace std; @@ -20,11 +29,6 @@ int main (int argc, char * argv[]) if (argc < 2) exit(1); uintL len = atoi(argv[1]); - extern cl_LF zeta (int s, uintC len); - extern cl_LF compute_zeta_exp (int s, uintC len); - extern cl_LF compute_zeta_cvz1 (int s, uintC len); - extern cl_LF compute_zeta_cvz2 (int s, uintC len); - extern cl_LF zeta3 (uintC len); cl_LF p; ln(cl_I_to_LF(1000,len+10)); // fill cache { CL_TIMING;