> 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.