[Rock-dev] Usage of SSE* CPU features ...

Jakob Schwendner jakob.schwendner at dfki.de
Mon Sep 5 18:45:13 CEST 2011


 

 

 On September 5, 2011 at 5:24 PM Sylvain Joyeux <sylvain.joyeux at dfki.de> wrote:

 > Some packages start to -- sometimes sneakily -- introduce dependence on
 > CPU features such as SSE*. Such packages are OpenCV and libelas
 >
 > In libelas, this support is mandatory, so there's not much to do about it.
 >
 > In OpenCV, it is experimental. The person that added opencv 2.3 to rock
 > turned these features ON by default.
 >
 > My question:
 >    * is opencv using an autodetection feature ? I.e. does it turn them
 > off at runtime if the CPU does not support them, or will the user get a
 > "wrong instruction" error ?
 >    * in the latter case, what should be the default ? I would go for "do
 > not enable SSE >= 4 by default" and explain how to enable it to users on
 > the wiki. For OpenCV, it would be reenabled by adding the following code
 > snippet in autoproj/overrides.rb
 >
 >    setup_package("external/opencv") do |pkg|
 >      pkg.define("ENABLE_SSE41","ON")
 >      pkg.define("ENABLE_SSE42","ON")
 >      pkg.define("ENABLE_SSSE3","ON")
 >    end
 >
 > For the time being, I disabled SSE >= 4 in the rock package set (that
 > seems to be the safest until we resolve the question).
 >Hi, 
 
There is a macro for cmake, that gets the right optimization settings for your
architecture: 
http://vir.homelinux.org/blog/archives/140-Automatic-Optimization-for-your-CPU-with-CMake.html
direct linkt to script:
http://gitorious.org/vc/vc/blobs/master/cmake/OptimizeForArchitecture.cmake
 
We could embed this into the base/types package. It doesn't help however with
opencv and libelas, I guess. In the long run, I would vote that autoproj itself
can do the differentiation between different compiler option, much like it does
for the operating systems now. For now using SSE2 should be ok (will fail e.g.
on gumstix however).  
 
cheers,
 
Jakob
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.dfki.de/pipermail/rock-dev/attachments/20110905/51dea32c/attachment.htm 


More information about the Rock-dev mailing list