option to compile with -march=native to speed up CPU performance

On my laptop without GPU this gives me a significant improvement.
From about 26 seconds (9 with OpenMP) down to (still) 12 seconds (5 with OpenMP).

Intel(R) Core(TM) i5-6500T CPU @ 2.50GHz (4 cores)
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609

Deactivated by default to not break e.g. distributed compilation and cross compilation.
This commit is contained in:
Zeno Gantner 2017-12-19 16:09:04 +01:00 committed by GitHub
parent 80d9bec20f
commit 493b1e3c65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ GPU=0
CUDNN=0
OPENCV=0
OPENMP=0
NATIVECPU=0
DEBUG=0
ARCH= -gencode arch=compute_30,code=sm_30 \
@ -32,6 +33,10 @@ ifeq ($(OPENMP), 1)
CFLAGS+= -fopenmp
endif
ifeq ($(NATIVECPU), 1)
CFLAGS+= -march=native
endif
ifeq ($(DEBUG), 1)
OPTS=-O0 -g
endif