You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

25 years ago
  1. #include <cl_number.h>
  2. #include <cl_io.h>
  3. #include <cl_float.h>
  4. #include <cl_real.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7. #include <cl_timing.h>
  8. #include "cl_LF.h"
  9. int main (int argc, char * argv[])
  10. {
  11. int repetitions = 1;
  12. if ((argc >= 3) && !strcmp(argv[1],"-r")) {
  13. repetitions = atoi(argv[2]);
  14. argc -= 2; argv += 2;
  15. }
  16. if (argc < 2)
  17. exit(1);
  18. uintL len = atoi(argv[1]);
  19. extern cl_LF cl_zeta (int s, uintC len);
  20. extern cl_LF compute_zeta_exp (int s, uintC len);
  21. extern cl_LF compute_zeta_cvz1 (int s, uintC len);
  22. extern cl_LF compute_zeta_cvz2 (int s, uintC len);
  23. extern cl_LF cl_zeta3 (uintC len);
  24. cl_LF p;
  25. ln(cl_I_to_LF(1000,len+10)); // fill cache
  26. { CL_TIMING;
  27. for (int rep = repetitions; rep > 0; rep--)
  28. { p = compute_zeta_exp(3,len); }
  29. }
  30. cout << p << endl;
  31. { CL_TIMING;
  32. for (int rep = repetitions; rep > 0; rep--)
  33. { p = compute_zeta_cvz1(3,len); }
  34. }
  35. cout << p << endl;
  36. { CL_TIMING;
  37. for (int rep = repetitions; rep > 0; rep--)
  38. { p = compute_zeta_cvz2(3,len); }
  39. }
  40. cout << p << endl;
  41. { CL_TIMING;
  42. for (int rep = repetitions; rep > 0; rep--)
  43. { p = cl_zeta3(len); }
  44. }
  45. cout << p << endl;
  46. }