Tuning framework
Kevin Ryde
user42 at zip.com.au
Wed Nov 19 07:31:35 CET 2003
nisse at lysator.liu.se (Niels Möller) writes:
>
> There's one parameter to tune, HGCD_SCHOENHAGE_THRESHOLD. I think I've
> figured out to add the tuning glue glue to gmp-impl.h, but I'm a
> little confused about what I'm supposed to add to tune/tuneup.c and
> tune/common.c.
The first thing you need is a measuring function. It takes care of
setting up temp space and then calling the routine for the requested
number of repetitions.
For the GCDs I've tried to make multiple calls, so that one unlucky
bit of data doesn't get through unusually quickly, then run
repetitions of those calls. (s->time_divisor expresses how many such
multiple calls there were.)
If the threshold is embedded within a routine then it needs to be
recompiled with that as a variable (eg. DIVREM_2_THRESHOLD), or if
it's just a contest between two routines then tuneup.c has those as
"function" and "function2" (eg. SET_STR_THRESHOLD).
More information about the gmp-devel
mailing list