Make AVX2 flag conditional on SUPPORT_AVX2 macro in linux build file

This commit is contained in:
anthonyaue 2016-06-21 13:02:39 -07:00
Родитель 1043f45466
Коммит 7527dd0154
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -167,6 +167,10 @@ ifdef KALDI_PATH
KALDI_LIBS += -lkaldi-util -lkaldi-matrix -lkaldi-base -lkaldi-hmm -lkaldi-cudamatrix -lkaldi-nnet -lkaldi-lat
endif
ifdef SUPPORT_AVX2
CPPFLAGS += -mavx2
endif
# Set up nvcc target architectures (will generate code to support them all, i.e. fat-binary, in release mode)
# In debug mode we will rely on JIT to create code "on the fly" for the underlying architecture
GENCODE_SM20 := -gencode arch=compute_20,code=\"sm_20,compute_20\"
@ -270,7 +274,6 @@ COMMON_SRC =\
$(SOURCEDIR)/Common/fileutil.cpp \
MATH_SRC =\
$(SOURCEDIR)/Math/BlockHandlerAVX.cpp \
$(SOURCEDIR)/Math/BlockHandlerSSE.cpp \
$(SOURCEDIR)/Math/CPUMatrix.cpp \
$(SOURCEDIR)/Math/CPUSparseMatrix.cpp \
@ -285,6 +288,11 @@ MATH_SRC =\
$(SOURCEDIR)/Math/ConvolutionEngine.cpp \
$(SOURCEDIR)/Math/BatchNormalizationEngine.cpp \
ifdef SUPPORT_AVX2
MATH_SRC +=\
$(SOURCEDIR)/Math/BlockHandlerAVX.cpp \
endif
ifdef CUDA_PATH
MATH_SRC +=\
$(SOURCEDIR)/Math/GPUMatrix.cu \
@ -301,7 +309,6 @@ MATH_SRC +=\
else
MATH_SRC +=\
$(SOURCEDIR)/Math/NoGPU.cpp
endif
MATH_SRC+=$(COMMON_SRC)