[Liboil] Directed optimization

Marcus Brubaker aurelius.marcus at rogers.com
Thu May 18 13:51:24 PDT 2006

Maybe this exists already, maybe it doesn't, but I had an idea for
something which would make liboil considerably more useful, particularly
for me.  Basically, it comes from the idea that different applications
have different data profiles and optimizing using the same data profiles
for every app may result in selecting the wrong implementation.

For instance, I know that in my application the majority of my calls are
going to be on shorter arrays as I have a large number of 3 element
arrays of doubles.  Selecting the implementation for this case based on
test lengths of 100 or 1000 doesn't make much sense.  E.G., a 4 or 8
times unrolled version of multsum_f64 will perform much better with n =
1000 than a rolled implementation but the opposite is likely true with n
= 3.

Would it be (or is it already) possible to provide hints to oil_init
about the size of data to be expected?  Ranging from the individual
class level up to a global hint, this information could be immensely
useful if there was a simple interface to do such a thing.

Any thoughts?  I might be able to spend some time on this if someone
thinks it's a good idea and could provide a pointer towards how best to
implement it.


More information about the Liboil mailing list