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.

31 lines
629 B

25 years ago
  1. #include <cl_number.h>
  2. #include <cl_io.h>
  3. #include <cl_float.h>
  4. #include <cl_float_io.h>
  5. #include <cl_lfloat.h>
  6. #include "cl_LF.h"
  7. #include <cl_real.h>
  8. #include <cl_random.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <cl_timing.h>
  12. int main (int argc, char * argv[])
  13. {
  14. int repetitions = 1;
  15. if ((argc >= 3) && !strcmp(argv[1],"-r")) {
  16. repetitions = atoi(argv[2]);
  17. argc -= 2; argv += 2;
  18. }
  19. if (argc < 2)
  20. exit(1);
  21. uintL len = atoi(argv[1]);
  22. cl_LF one = cl_I_to_LF(1,len);
  23. cl_F x = random_F(one);
  24. cl_F y;
  25. { CL_TIMING;
  26. for (int rep = repetitions; rep > 0; rep--)
  27. { y = sqrt(x); }
  28. }
  29. cout << y << endl;
  30. }