a function to get multiplication threshold?

Serge Winitzki serge@cosmos.phy.tufts.edu
Wed, 18 Dec 2002 01:40:55 -0500 (EST)


On Wed, 18 Dec 2002, Kevin Ryde wrote:

> > However I think it's a useful piece of information to have.
> 
> Alas I don't think should be done, it's highly implementation
> dependent.

I'm not sure I understand why a function such as

unsigned gmp_mul_threshold { return MUL_KARATSUBA_THRESHOLD; }

should not be put into GMP.
 
> You'll be best off doing some measuring of the alternatives, and
> making a tuned threshold for your algorithm, like the thresholds
> within gmp.

I think this is too much work for what it's worth. For me, the reason
for using the rough thresholds like the MUL_THRESHOLD instead of
independent measurements is not to get an extra 10% speedup but to avoid
an a priori 300% slowdown.

> You could try using some of the stuff in tune/libspeed.la.
> speed_measure is the best, but it's a bit tricky.  speed_starttime and
> speed_endtime are easy, and still give the benefit of the various
> measuring methods we know for different systems.

Thanks, I'll take a look... but these functions are undocumented and
also not guaranteed to remain in GMP in the future?



-- 
	Serge