Subject: Re: [boost] How to structurate libraries ?
From: Patrick Mihelich (patrick.mihelich_at_[hidden])
Date: 2009-01-19 20:39:10
On Mon, Jan 19, 2009 at 3:10 PM, Mathias Gaunard <
> Joel Falcou wrote:
> Ok, I'm really curious to here what you think is worthy to be a library
>> and what is only worth a mere patch ?
> Why not modify Boost.uBlas so that it uses vectorization, then use
> Boost.uBlas as a basis to write other vectorization-aware libraries?
Modifying Boost.uBlas to use vectorization necessarily implies writing a
generic wrapper for SIMD instructions, as well as other support
infrastructure including aligned memory allocation. I believe this is more
or less what Joel has proposed.
At least, this is the only sensible way I see to vectorize uBlas. It is the
way that has worked well for other linear algebra libraries. Perhaps you can
suggest a specific alternative approach?
Using Boost.uBlas as a basis for other vectorization-aware libraries doesn't
make sense to me because not all applications that can benefit from SIMD
match the linear algebra domain. How would you write Boost.Dynamic Bitset in
terms of uBlas? Why would uBlas even expose a bit vector or logical
operations? It doesn't fit the domain. However, it is possible to write both
libraries in terms of low-level data packets with efficient operations, and
this is what Boost.SIMD would provide.
Have you ever tried optimizing *any* code using vector intrinsics on any
>> kind of platform ?
> I have used the GCC vector intrinsics, yes.
> I didn't find it that hard. At least much easier than writing inline
Well, that isn't a very high bar :). Have you tried customizing a function
for different versions of SSE, or gone back later and changed what data type
you're using? My experience with using vector intrinsics is that there is
abundant room for it to be easier.