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.

77 lines
2.0 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 <cl_random.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8. #include <cl_timing.h>
  9. #include "cl_LF.h"
  10. int main (int argc, char * argv[])
  11. {
  12. int repetitions = 1;
  13. if ((argc >= 3) && !strcmp(argv[1],"-r")) {
  14. repetitions = atoi(argv[2]);
  15. argc -= 2; argv += 2;
  16. }
  17. if (argc < 2)
  18. exit(1);
  19. uintL len = atoi(argv[1]);
  20. extern cl_LF compute_eulerconst (uintC len);
  21. extern cl_LF compute_eulerconst_expintegral (uintC len);
  22. extern cl_LF compute_eulerconst_expintegral1 (uintC len);
  23. extern cl_LF compute_eulerconst_expintegral2 (uintC len);
  24. extern cl_LF compute_eulerconst_besselintegral1 (uintC len);
  25. extern cl_LF compute_eulerconst_besselintegral2 (uintC len);
  26. extern cl_LF compute_eulerconst_besselintegral3 (uintC len);
  27. extern cl_LF compute_eulerconst_besselintegral4 (uintC len);
  28. cl_LF p;
  29. ln(cl_I_to_LF(1000,len+10)); // fill cache
  30. #if 0
  31. { CL_TIMING;
  32. for (int rep = repetitions; rep > 0; rep--)
  33. { p = compute_eulerconst(len); }
  34. }
  35. #else
  36. #if 0
  37. { CL_TIMING;
  38. for (int rep = repetitions; rep > 0; rep--)
  39. { p = compute_eulerconst_expintegral(len); }
  40. }
  41. // cout << p << endl;
  42. { CL_TIMING;
  43. for (int rep = repetitions; rep > 0; rep--)
  44. { p = compute_eulerconst_expintegral1(len); }
  45. }
  46. // cout << p << endl;
  47. { CL_TIMING;
  48. for (int rep = repetitions; rep > 0; rep--)
  49. { p = compute_eulerconst_expintegral2(len); }
  50. }
  51. // cout << p << endl;
  52. #endif
  53. { CL_TIMING;
  54. for (int rep = repetitions; rep > 0; rep--)
  55. { p = compute_eulerconst_besselintegral1(len); }
  56. }
  57. // cout << p << endl;
  58. #if 0
  59. { CL_TIMING;
  60. for (int rep = repetitions; rep > 0; rep--)
  61. { p = compute_eulerconst_besselintegral2(len); }
  62. }
  63. // cout << p << endl;
  64. { CL_TIMING;
  65. for (int rep = repetitions; rep > 0; rep--)
  66. { p = compute_eulerconst_besselintegral3(len); }
  67. }
  68. // cout << p << endl;
  69. #endif
  70. { CL_TIMING;
  71. for (int rep = repetitions; rep > 0; rep--)
  72. { p = compute_eulerconst_besselintegral4(len); }
  73. }
  74. // cout << p << endl;
  75. #endif
  76. }