Re: [eigen] Back from google

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]




On Wed, Nov 4, 2009 at 12:24 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
2009/11/4 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> 2009/11/4 Keir Mierle <mierle@xxxxxxxxx>:
>>> * Just use sqrt() ? The questions are: are we OK to always pay for a
>>> sqrt here? This seems like unneeded extra performance degradation for
>>> small dyn-size matrices (of course it's negligible for large
>>> matrices). In the default case of a compile-time constant, GCC >= 4.3
>>> is able to compute the sqrt at compile-time, but i wonder about MSVC
>>> and ICC.
>>
>> If the variable is encapsulated in a binary library, then the square root
>> can also be stored in a variable so that it is only recomputed if the size
>> changes; for example:
>> void Eigen::SetCacheBlockSize(int new_size) {
>>   ei_cache_block_size = new_size;
>>   ei_sqrt_cache_block_size = sqrt(new_size)
>> }
>>>
>>> * Introduce a separate preprocessor #define to let the user specify a
>>> runtime cache size variable name?
>>>
>>> Or going farther into the direction of binary libraries:
>>>
>>> * Introduce a preprocessor symbol to define some global variables,
>>> e.g. one for the cpu cache size? We'd need to tell the user that if he
>>> wants to use the corresponding feature, then one of his source file
>>> must define that macro before #including Eigen.
>>>
>>> There is of course always the option of creating an optional tiny
>>> binary lib, but i still don't see a compelling reason to do that...
>>
>> I don't think a small binary library is crazy, provided it is optional and
>> disabled by default.
>
> "optional and disabled by default" works well indeed to address needs
> of a company like Google where someone will take care of enabling that
> feature. But it doesn't work so well with linux distros who will want
> to stick to the default configuration, or will somehow pressure us to
> make that the default as soon as some package requires eigen to be
> configured with this option.

I also would like to make this point: the only thing we can't do
without a binary library, is to define global variables. But for that
we can provide macros allowing the user to create them in one source
file.

So the only question, in the debate binary-library-or-not, is to
choose between a binary library and a macro trick like that.

I am in favor of either macro tricks or simply offering a .cpp file that users can #include in their application source. Having a real binary component is considerable effort for little gain compared to having users compile in some extra code.

Keir
 

Benoit





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/