Browse Source

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.
master
Alexei Sheplyakov 16 years ago
parent
commit
bab7afc539
  1. 20
      tests/timecatalan.cc
  2. 23
      tests/timeeuler.cc
  3. 7
      tests/timeexp1.cc
  4. 14
      tests/timezeta3.cc

20
tests/timecatalan.cc

@ -8,6 +8,18 @@
#include <cln/timing.h> #include <cln/timing.h>
#include "float/lfloat/cl_LF.h" #include "float/lfloat/cl_LF.h"
#include <iostream> #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 cln;
using namespace std; using namespace std;
@ -21,12 +33,8 @@ int main (int argc, char * argv[])
if (argc < 2) if (argc < 2)
exit(1); exit(1);
uintL len = atoi(argv[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; cl_LF p;
ln(cl_I_to_LF(1000,len+10)); // fill cache ln(cl_I_to_LF(1000,len+10)); // fill cache
{ CL_TIMING; { CL_TIMING;

23
tests/timeeuler.cc

@ -7,6 +7,19 @@
#include <cstring> #include <cstring>
#include <cln/timing.h> #include <cln/timing.h>
#include "float/lfloat/cl_LF.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; using namespace cln;
int main (int argc, char * argv[]) int main (int argc, char * argv[])
@ -19,14 +32,8 @@ int main (int argc, char * argv[])
if (argc < 2) if (argc < 2)
exit(1); exit(1);
uintL len = atoi(argv[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; cl_LF p;
ln(cl_I_to_LF(1000,len+10)); // fill cache ln(cl_I_to_LF(1000,len+10)); // fill cache
#if 0 #if 0

7
tests/timeexp1.cc

@ -6,6 +6,12 @@
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <cln/timing.h> #include <cln/timing.h>
namespace cln
{
// FIXME: don't use internal functions!
extern cl_LF compute_exp1 (uintC len);
}
using namespace cln; using namespace cln;
int main (int argc, char * argv[]) int main (int argc, char * argv[])
@ -18,7 +24,6 @@ int main (int argc, char * argv[])
if (argc < 2) if (argc < 2)
exit(1); exit(1);
uintL len = atoi(argv[1]); uintL len = atoi(argv[1]);
extern cl_LF compute_exp1 (uintC len);
cl_LF p; cl_LF p;
{ CL_TIMING; { CL_TIMING;
for (int rep = repetitions; rep > 0; rep--) for (int rep = repetitions; rep > 0; rep--)

14
tests/timezeta3.cc

@ -6,6 +6,15 @@
#include <cstring> #include <cstring>
#include <cln/timing.h> #include <cln/timing.h>
#include "float/lfloat/cl_LF.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; using namespace cln;
#include <iostream> #include <iostream>
using namespace std; using namespace std;
@ -20,11 +29,6 @@ int main (int argc, char * argv[])
if (argc < 2) if (argc < 2)
exit(1); exit(1);
uintL len = atoi(argv[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; cl_LF p;
ln(cl_I_to_LF(1000,len+10)); // fill cache ln(cl_I_to_LF(1000,len+10)); // fill cache
{ CL_TIMING; { CL_TIMING;

Loading…
Cancel
Save