Lately I have been trying to generate a vector report of an OpenCV project implemented on the raspberry pi 2 model B, but for some reason there is no output. The same algorithm produces vector report when running on host PC. OpenCV is compiled with the relevant flags, and the CMakeLists.txt is as follows:

cmake_minimum_required(VERSION 2.8)
project( myProject )
add_subdirectory( src  )
include_directories( "${PROJECT_SOURCE_DIR}/headers"  )
link_directories ( "${PROJECT_SOURCE_DIR}/src" )
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -std=c++11 -mcpu=native -march=native -mfpu=neon -mfloat-abi=hard -fopenmp -ftree-vectorizer-verbose=2")
find_package( OpenCV REQUIRED )
add_executable( myProject main.cpp )
target_link_libraries( myProject src)
target_link_libraries( myProject ${OpenCV_LIBS} )

I am compiling with gcc 4.9.2 and the output for

gcc -mcpu=native -march=native -Q --help=target


The following options are target specific:

-mabi=                                aapcs-linux
-mabort-on-noreturn                   [disabled]
-mandroid                             [disabled]
-mapcs                                [disabled]
-mapcs-float                          [disabled]
-mapcs-frame                          [disabled]
-mapcs-reentrant                      [disabled]
-mapcs-stack-check                    [disabled]
-march=                               armv7ve
-marm                                 [enabled]
-mbig-endian                          [disabled]
-mbionic                              [disabled]
-mcallee-super-interworking           [disabled]
-mcaller-super-interworking           [disabled]
-mcpu=                                cortex-a7
-mfix-cortex-m3-ldrd                  [enabled]
-mfloat-abi=                          hard
-mfp16-format=                        none
-mfpu=                                vfp
-mglibc                               [enabled]
-mlittle-endian                       [enabled]
-mlong-calls                          [disabled]
-mlra                                 [enabled]
-mneon-for-64bits                     [disabled]
-mnew-generic-costs                   [disabled]
-mold-rtx-costs                       [disabled]
-mpic-data-is-text-relative           [enabled]
-mpoke-function-name                  [disabled]
-mrestrict-it                         [enabled]
-msched-prolog                        [enabled]
-msingle-pic-base                     [disabled]
-mslow-flash-data                     [disabled]
-mstructure-size-boundary=            0x20
-mthumb                               [disabled]
-mthumb-interwork                     [enabled]
-mtls-dialect=                        gnu
-mtp=                                 auto
-mtpcs-frame                          [disabled]
-mtpcs-leaf-frame                     [disabled]
-mtune=                               [default]
-muclibc                              [disabled]
-munaligned-access                    [enabled]
-mvectorize-with-neon-double          [disabled]
-mvectorize-with-neon-quad            [enabled]
-mword-relocations                    [disabled]
-mwords-little-endian                 [disabled]

I am assuming there is auto-vectorization functionality with -O3 and there are no specific code manipulations required in order to achieve SIMD parallelism with NEON instruction set (Please correct me if I am wrong). Thank you.


I had posted the same question on the Raspberry Pi forums and all thanks to the user: Paeryn, for the answer. I am re-posting his answer here :

With the latest GCC compilers the -ftree-vectorizer-verbose option is depreciated in favour of -fopt-info-vec. The -fopt-info flag can have several categories added:

  • -ipa : intra-procedural optimizations

  • -loop : loop optimizations

  • -vec : vector optimizations

  • -inline : inline optimizations

  • -all : all of the above

See man gcc for further details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.