OpenCV compilation with Intel C++ Compiler

OpenCV compilation with Intel C++ Compiler

imagem de Engin F.

Which compiler flags should be used for OpenCV compilation to get best performance from library?

I want to benefit from vectorization properties of compiler and want machine code of OpenCV which fully benefits SSE and AVX instructions.

At least some clues about this issue will be fine for me.

6 posts / 0 new
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de Sergey Kostrov

>>Which compiler flags should be used for OpenCV compilation to get best performance from library?..

It would be nice to see a set of Intel C++ compiler options you currently use. Take into account that some Intel C++ compiler options are turned on by default and use icl.exe -help. Here is a list you could try:

/O3
/QaxSSE2 and /QaxAVX
/Qvec
/Qstd=c99
/Qrestrict
/Qansi-alias
/Qipo
/Qunroll=8
/Qopt-block-factor:3
/Qopt-mem-layout-trans:3
/Qopt-prefetch:4

imagem de Sergey Kostrov

Here are two sets of compiler options to be considered:

[ Intel C++ compiler ]

/O3
/Oi
/Ot
/Oy
/GF
/MT
/GS-
/fp:fast=2
/W5
/Wp64
/Zi
/Gr
/TP
/Qopenmp
/Qfp-speculation:fast
/Qopt-matmul
/Qparallel
/Qstd=c++0x
/Qrestrict
/Qunroll:4
/Qopt-block-factor:64
/Qopt-streaming-stores:auto

[ Microsoft C++ compiler ]

/O2
/Oi
/Ot
/Oy
/GF
/Gm
/MT
/GS-
/fp:fast
/openmp
/W4
/Wp64
/Zi
/TP
/errorReport:prompt

Note: /Ox ( Full Optimization ) could be used instead of /O2

imagem de Engin F.

I will give them a try and share the results, thank you so much.

imagem de Sergey Kostrov

>>...I will give them a try and share the results...

The best way to continue is to add, or change, one option at a time with verification in Release Configuration that performance doesn't get worse. If you try all of them at the same time and performance gets worse then you won't know which option(s) is responsible for negative impact.

imagem de Engin F.

Himm that's a very good idea. I will give them try in a batch. Whenever I complete my profiler, I will compile different builds of OpenCV by using this way and profile these different builds. I will share profiler results with you.

Thank you so much for your concern.

Faça login para deixar um comentário.