mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
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:
5
Makefile
5
Makefile
@ -2,6 +2,7 @@ GPU=0
|
|||||||
CUDNN=0
|
CUDNN=0
|
||||||
OPENCV=0
|
OPENCV=0
|
||||||
OPENMP=0
|
OPENMP=0
|
||||||
|
NATIVECPU=0
|
||||||
DEBUG=0
|
DEBUG=0
|
||||||
|
|
||||||
ARCH= -gencode arch=compute_30,code=sm_30 \
|
ARCH= -gencode arch=compute_30,code=sm_30 \
|
||||||
@ -32,6 +33,10 @@ ifeq ($(OPENMP), 1)
|
|||||||
CFLAGS+= -fopenmp
|
CFLAGS+= -fopenmp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(NATIVECPU), 1)
|
||||||
|
CFLAGS+= -march=native
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
OPTS=-O0 -g
|
OPTS=-O0 -g
|
||||||
endif
|
endif
|
||||||
|
Reference in New Issue
Block a user