]> www.ginac.de Git - cln.git/commitdiff
benchmarks: time{catalan,euler,exp1,zeta3}.cc actually compile and work now.
authorAlexei Sheplyakov <varg@theor.jinr.ru>
Sun, 7 Sep 2008 14:39:54 +0000 (18:39 +0400)
committerAlexei Sheplyakov <varg@theor.jinr.ru>
Sun, 7 Sep 2008 14:39:54 +0000 (18:39 +0400)
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.

tests/timecatalan.cc
tests/timeeuler.cc
tests/timeexp1.cc
tests/timezeta3.cc

index 4ddb6beccd26a056b03229a30145ba28c5252d6d..36c1bf7f54e6aec864f99118c78fa8640225cb9a 100644 (file)
@@ -8,6 +8,18 @@
 #include <cln/timing.h>
 #include "float/lfloat/cl_LF.h"
 #include <iostream>
+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;
index 40f44eace139ddc8f9610b9cb8247a4f4f6464c9..f0730e6ee93c049d210a7066033aecf122a34f77 100644 (file)
@@ -7,6 +7,19 @@
 #include <cstring>
 #include <cln/timing.h>
 #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
index fac40e345eb89bf68162d9dea9ec5523888ea2c4..5aeab13508fd365b483b087d85545882c64a87a6 100644 (file)
@@ -6,6 +6,12 @@
 #include <cstdlib>
 #include <cstring>
 #include <cln/timing.h>
+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--)
index 898b958b59d07e21654a1e90061c1b03d3ac272d..cbdb8a037349decc74a51400de99f5f29a4c2c20 100644 (file)
@@ -6,6 +6,15 @@
 #include <cstring>
 #include <cln/timing.h>
 #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 <iostream>
 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;