mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Maksim Shabunin
c04d62db8b
|
9 years ago | |
---|---|---|
.. | ||
c_hal | 9 years ago | |
slow_hal | 9 years ago | |
README.md | 9 years ago |
README.md
Custom HAL samples
Samples in this folder are intended to demonstrate functionality replacement mechanism in the OpenCV library.
The c_hal is the example of pure C replacement library with all functions returning error. It can be used to verify error handling in the function switching code.
The slow_hal contains naive C++ implementations of the element-wise logical array operations (and, or, xor, not) making them twice slower than the default.
Build custom HAL replacement library
- Create folder for build (for example
<home-dir>/my-hal-build
) - Go to the created folder and run cmake:
cmake <opencv-src>/samples/hal/slow_hal
- Run make
After build you will find static library in the build folder: libslow_hal.a
Build OpenCV with HAL replacement
- Create folder for build (for example
<home-dir>/my-opencv-build
) - Go to the created folder and run cmake:
cmake \ -DOPENCV_HAL_HEADERS="<opencv-src>/samples/hal/slow_hal/impl.hpp" \ -DOPENCV_HAL_LIBS="<home-dir>/my-hal-build/libslow_hal.a" \ <opencv-src>
- Run make (or
make opencv_perf_core
to build the demonstration test executable only) - After build you can run the tests and verify that some functions works slower:
./bin/opencv_perf_core --gtest_filter=*bitwise_and*