On 04/20/2012 11:34 AM, Torbjorn Granlund wrote:
>   It's a bit touchy speed testing these.  There's no cycle counter
>   available in userspace, and Hz is depressingly low.  So I've had
>   to bump the minimum iterations way way up in order to get semi-
>   reliable results.  Which causes the speed testing to take quite
>   a long time.
>   
> What did you do to make it work?
> 
> I always get "Fatal error: too many (11) failed measurements (0.0)"
> on any arm system.

I used the following, almost certainly not appropriate for general application.


r~
diff -upr z/gmp-5.0.3/tune/common.c gmp-5.0.3/tune/common.c
--- z/gmp-5.0.3/tune/common.c   2012-01-27 03:59:30.000000000 -0500
+++ gmp-5.0.3/tune/common.c     2012-02-10 22:09:23.000000000 -0500
@@ -142,7 +142,7 @@ speed_measure (double (*fun) __GMP_PROTO
       s = &s_dummy;
     }
 
-  s->reps = 1;
+  s->reps = 10;
   s->time_divisor = 1.0;
   for (i = 0; i < numberof (t); i++)
     {
@@ -159,13 +159,9 @@ speed_measure (double (*fun) __GMP_PROTO
 
          if (t[i] == 0.0)
            {
-             zeros++;
-             if (zeros > max_zeros)
-               {
-                 fprintf (stderr, "Fatal error: too many (%d) failed 
measurements (0.0)\n", zeros);
-                 abort ();
-               }
-             continue;
+             if (++zeros < max_zeros)
+               continue;
+             goto increase_reps;
            }
 
          if (t[i] == -1.0)
@@ -175,7 +171,8 @@ speed_measure (double (*fun) __GMP_PROTO
            break;
 
          /* go to a value of reps to make t[i] >= precision */
-         reps_d = ceil (1.1 * s->reps
+       increase_reps:
+         reps_d = ceil (1.15 * s->reps
                         * speed_unittime * speed_precision
                         / MAX (t[i], speed_unittime));
          if (reps_d > 2e9 || reps_d < 1.0)
_______________________________________________
gmp-devel mailing list
gmp-devel@gmplib.org
http://gmplib.org/mailman/listinfo/gmp-devel

Reply via email to