Beispiel #1
0
int main(int argc, char* argv[])
{
    if (argc != 5)
    {
        printf("expected four arguments (see source)\n");
        return 0;
    }

    test_support_init();

    arg_t arg;
    arg.length1 = atoi(argv[1]);
    arg.length2 = atoi(argv[2]);
    arg.bits1 = atoi(argv[3]);
    arg.bits2 = atoi(argv[4]);

    double min_time, max_time;

    for (unsigned long i = 0; i < 3; i++)
    {
        arg.which = 0;
        prof_repeat(&min_time, &max_time, target, &arg);
        printf(" mpz_poly: min = %.3le, \tmax = %.3le\n", min_time, max_time);
        fflush(stdout);

        arg.which = 1;
        prof_repeat(&min_time, &max_time, target, &arg);
        printf("fmpz_poly: min = %.3le, \tmax = %.3le\n", min_time, max_time);
        fflush(stdout);
    }

    test_support_cleanup();

    return 0;
}
Beispiel #2
0
int main(void)
{
   double min, max;
   fac_one_line_t params;
   flint_rand_t state;
   int i;
   flint_randinit(state);

   params.composites = flint_malloc(1024*sizeof(ulong));

   printf("factor_one_line:\n");
   
   for (i = 4; i <= 64; i++)
   {
      fill_array(params.composites, i, state);
      params.bits = i;
	  prof_repeat(&min, &max, sample, &params);
      printf("bits = %d, time is %.3f us\n", 
		  i, max/(double)ITERS);
   }

   flint_randclear(state);
   flint_free(params.composites);
   return 0;
}
Beispiel #3
0
int main(void)
{
    double min_default, min_classical, min_inline, min_multi_mod, max;
    mat_mul_t params;
    long bits, dim;

    for (bits = 1; bits <= 2000; bits = (long) ((double) bits * 1.3) + 1)
    {
        params.bits = bits;

        printf("fmpz_mat_mul (bits = %ld):\n", params.bits);

        for (dim = 1; dim <= 512; dim = (long) ((double) dim * 1.3) + 1)
        {
            params.m = dim;
            params.n = dim;
            params.k = dim;

            params.algorithm = 0;
            prof_repeat(&min_default, &max, sample, &params);

            params.algorithm = 1;
            prof_repeat(&min_classical, &max, sample, &params);

            params.algorithm = 2;
            prof_repeat(&min_inline, &max, sample, &params);

            params.algorithm = 3;
            prof_repeat(&min_multi_mod, &max, sample, &params);

            printf("dim = %ld default/classical/inline/multi_mod %.2f %.2f %.2f %.2f (us)\n", 
                dim, min_default, min_classical, min_inline, min_multi_mod);

            if (min_multi_mod < 0.6*min_default)
                printf("BAD!\n");

            if (min_inline < 0.6*min_default)
                printf("BAD!\n");

            if (min_multi_mod < 0.7*min_inline)
                break;
        }
    }

    return 0;
}
Beispiel #4
0
int main(void)
{
    double min, max;

    prof_repeat(&min, &max, sample, NULL);

    printf("udiv_qrnnd min time is %.3f cycles, max time is %.3f cycles\n",
           (min/(double)FLINT_CLOCK_SCALE_FACTOR)/100, (max/(double)FLINT_CLOCK_SCALE_FACTOR)/100);

    return 0;
}
Beispiel #5
0
int main(void)
{
    double min_recursive, min_multi_mod, min_zeta, max;
    bernoulli_vec_t params;
    long n;

    printf("n / recursive / multi_mod / zeta / best [times in us]\n");

    for (n = 2; n <= 10000; n = (long) ((double) n * 1.2) + 1)
    {
        params.n = n;

        if (n < 1500)
        {
            params.algorithm = 0;
            prof_repeat(&min_recursive, &max, sample, &params);
        }
        else
            min_recursive = 0.0;

        params.algorithm = 1;
        prof_repeat(&min_multi_mod, &max, sample, &params);

        params.algorithm = 2;
        prof_repeat(&min_zeta, &max, sample, &params);

        printf("%ld %.2f %.2f %.2f ", 
            n, min_recursive, min_multi_mod, min_zeta);

        if (min_recursive && min_recursive < min_multi_mod && \
            min_recursive < min_zeta)
            printf("(recursive)\n");
        else if (min_multi_mod < min_zeta)
            printf("(multi_mod)\n");
        else
            printf("(zeta)\n");
    }

    return 0;
}
Beispiel #6
0
int main(void)
{
   double min, max;
   info_t info;
   slong k, scale;

   printf("Number field element trace\n");
   flint_printf("bits = %ld\n", BITS);

   for (k = 4; k <= 1000; k = (slong) ceil(1.1*k))
   {
      info.length = k;
      info.monic = 0;

      scale = 1000;
      if (k >= 50) scale = 100;
      if (k >= 500) scale = 40;
      
      prof_repeat(&min, &max, sample, (void *) &info);
      
      flint_printf("generic: length %wd, min %.3e us, max %.3e us\n", 
           info.length,
		   (min/scale),
           (max/scale)
	     );

      info.monic = 1;
     
      prof_repeat(&min, &max, sample, (void *) &info);
         
      flint_printf("monic  : length %wd, min %.3e us, max %.3e us\n", 
           info.length,
		   (min/scale),
           (max/scale)
	     );
   }

   return 0;
}
Beispiel #7
0
int main(void)
{
   double min, max;
   info_t info;
   slong k, scale;

   printf("1: With precomputed inverse\n");
   printf("2: Without precomputed inverse\n\n");

   for (k = 1; k <= 10000; k = (slong) ceil(1.1*k))
   {
      info.limbs = k;
      info.algo = 1;

      scale = 200;
   
      prof_repeat(&min, &max, sample, (void *) &info);
         
      flint_printf("1: limbs %wd, min %.3g ms, max %.3g ms\n", 
           info.limbs,
		   ((min/(double)FLINT_CLOCK_SCALE_FACTOR)/scale)/2400000.0,
           ((max/(double)FLINT_CLOCK_SCALE_FACTOR)/scale)/2400000.0
	     );

     info.algo = 2;
     
     prof_repeat(&min, &max, sample, (void *) &info);
         
      flint_printf("2: limbs %wd, min %.3g ms, max %.3g ms\n\n", 
           info.limbs,
		   ((min/(double)FLINT_CLOCK_SCALE_FACTOR)/scale)/2400000.0,
           ((max/(double)FLINT_CLOCK_SCALE_FACTOR)/scale)/2400000.0
	     );
   }

   return 0;
}
Beispiel #8
0
int main(void)
{
   double min, max;
   info_t info;
   mp_bitcnt_t i;

   for (i = 2; i <= FLINT_BITS; i++)
   {
      info.bits = i;

	  prof_repeat(&min, &max, sample, (void *) &info);

      printf("bits %ld, c/l = %.1lf\n", 
         i, (min/(double)FLINT_CLOCK_SCALE_FACTOR)/1000
	  );
   }

   return 0;
}
Beispiel #9
0
int main(void)
{
   double min1, min2, min3, min4, min5, max;
   info_t info;
   int i;

   for (i = FLINT_BITS/2 + 1; i <= FLINT_BITS; i++)
   {
      info.bits = i;
	  info.type = 1;
      prof_repeat(&min1, &max, sample, (void *) &info);

	  printf("bits %d, ll_inv %.1f c/l\n", 
           i,
		   (min1/(double)FLINT_CLOCK_SCALE_FACTOR)/10000
 	  );
   }

   return 0;
}