Pre-compilation of the usual instantiations

5 views
Skip to first unread message

Clement Pernet

unread,
Aug 27, 2015, 5:07:15 AM8/27/15
to ffpack...@googlegroups.com
Hi,

Compilation of some bits of the library is motivated by several reasons:
1 offer a compiled library to users not willing to compile it with most common template specializations.
2 speed-up compile time of the test-suite and benchmarks by reusing compiled code.
3 ...

Brice has recently done a great work in this direction, to solve 1 and offer in the same time a C
interface to all fflas-ffpack routines. It's in the interface/libs directory.

The current code does 2 things in 1:
- it wraps the C++ functions (e.g. ftrsm<Field>) in a C function (ftrsm_3_modular_double). An extra
parameter p (the field cardinality) is added and the finite field F is then constructed in each
function.
- these C functions are compiled and exposed in the fflas_c.la ffpack_c.la libraries.

However point 2 is not possible with the current code.
I therefore suggest that we update this interface by
- compiling the C++ instantiations and offer it as a library
- compiling the C wrapper on top of it and offer it as another library

In particular we would like to make this use of the compiled instantiations optional, so that users
may keep using the code as a source only library.

In Dublin (2010!), we discussed the topic and Jean-Guillaume came up with a solution:
http://linalg.org/projects/linalg/attachment/wiki/dublinbox/TestSeparate.tgz

I think this solution was a bit overkill and a simpler one, using explicit template instantiations
works as well, and avoid declaring a new function. See:
http://lig-membres.imag.fr/pernet/Depot/TestSeparate2.tgz

So what I'm proposing is to:
- compile a set of explicit template instantiations for all functions in fflas-ffpack over the usual
fields: Modular, ModularBalanced and the usual elements: double, float (maybe int32_t, but I think
it will encourage using this not so good element type).
- keep Brice's C interface, but have it simply linked to the C++ compiled code.

Any comment or objection is welcome.

Clément

Reply all
Reply to author
Forward
0 new messages