On 10/9/20 5:44 AM, Walter Dnes wrote:
On Fri, Oct 09, 2020 at 12:26:17AM +0000, Jonathan Yong wrote

I have a skylake system:
CPU_FLAGS_X86: aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand
sse sse2 sse3 sse4_1 sse4_2 ssse3

   A heavy-handed 2-part solution
1) remove "avx2" from CPU_FLAGS_X86
This was my initial reaction, then I realized I don't need 32bit OpenCV (for now), since the only package depending on it is 64bit.

2) assuming you have "-march=native" or "-march=skylake" in your CFLAGS
and CXXFLAGS, follow that with "-march=no-avx2".  e.g...
"-march=skylake -march=no-avx2"

   This tells gcc "I don't have avx2, so don't compile any avx2 code".
I think the performance loss will be minimal.


The CMake configure arguments still tell OpenCV to build the AVX2 code unfortunately. So #1 is required regardless.

Attachment: OpenPGP_0x713B5FE29C145D45_and_old_rev.asc
Description: application/pgp-keys

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to