[vsipl++] [patch] Tunable parameters

Jules Bergmann jules at codesourcery.com
Wed Sep 10 18:41:52 UTC 2008


>> Ok to apply?
> 
> Jules,
> 
> this looks fine. Could you please add a comment (to the rt_valid() 
> function, say), clarifying the meaning of 'tunable', i.e. to prevent the 
> library from dispatching, thus enabling our benchmarks to measure both, 
> PPU, as well as SPU, depending on --svpp-num-spes ?

Stefan,

Perhaps we can come up with a better name.

Originally, the threshold was checked directly in rt_valid:

	bool rt_valid(...)
	{
	  return size >= 16384 && ...
	}

Since the number was magic and subject to change (as we optimize the 
library, as hardware changes), I thought it would be good practice to 
label the number as a "tunable parameter," and perhaps include some 
history on how it's value was arrived at:

	bool rt_valid(...)
	{
	   return
		// Tunable: compare vmul -2 --svpp-num-spes {0,8} ...
	        size >= 16384 &&
		...
	}

That way we could search for magic numbers in the source ("/Tunable", 
and have the information on how they were generated.

Because other factors go into choosing the right number (operation, 
value type, etc), it made sense to move the magic number into an 
evaluator function:

	bool rt_valid(...)
	{
	  return
	    size >= tunable_threshold() &&
	    ...
	}


If the "tunable" prefix is confusing, perhaps just "threshold()" would 
be more clear?  That is still searchable.

				-- Jules

-- 
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705



More information about the vsipl++ mailing list