Ask Your Question
2

OpenCV 3.1 HAL functions in lapack

asked 2016-06-17 03:53:14 -0500

textobot gravatar image

I am trying to get the concept of HAL, but right now in some parts (lapack.cpp) it looks a bit confusing:

First, we have HAL intrinsics implementations in separate headers, one of which is chosen depending on cpu commands supported (SSE2, NEON or cpp implementation). If we work with different platform, we can add new header fill it with specific definitions, add the rule for it to intrin.hpp, and add required changes to cmake config files.

Second, user redefinitions of cv_hal_foo aliases. It seems to be the most clear part of HAL. Standalone library, which needs only interface.h from core includes. If HAL interfaces are constant we can apply changes only to hal source files, rebuild hal library and test it with stable OpenCV build. Quite convenient and fast.

The third part and my questions. F.e. LU32f is implemented in OpenCV source file (matrix_decomp.cpp) as part of cv::hal:: namespaces. Why implement HAL in OpenCV sources? Why call the only implementation of LU32f hal? Why not make it standard and as for arithm.cpp functions, add some hal_ni_foo implementations to hal_replacement.hpp and define cv_hal_foo macros?

Thank you.

edit retag flag offensive close merge delete

Comments

berak gravatar imageberak ( 2016-06-17 04:34:23 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
3

answered 2016-06-27 04:23:57 -0500

mshabunin gravatar image
  1. You are right. You can find documentation for universal intriniscs here

  2. Yes, you are right. Note that HAL replacement library is meant to be standalone static library and OpenCV should be rebuilt to use it. Also note that replacement interfaces are not fully stabilized and can be changed until release 3.2.

  3. It was temporary solution, cv::hal::LU32f came from initial HAL variant. Please, take a look at the merged pull request 6535 - it has added calls to cv_hal_LU32fand cv_hal_LU64f along.

edit flag offensive delete link more

Comments

Thank you for clear answer.

textobot gravatar imagetextobot ( 2016-06-27 05:41:37 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-06-17 03:53:14 -0500

Seen: 984 times

Last updated: Jun 27 '16