This commit is contained in:
Yongqiang Wang 2016-05-02 11:57:31 -07:00
Родитель dda0a50694 8ff2a75750
Коммит 29e464a96e
3 изменённых файлов: 35 добавлений и 1 удалений

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

@ -164,6 +164,17 @@ GENCODE_SM30 := -gencode arch=compute_30,code=\"sm_30,compute_30\"
GENCODE_SM35 := -gencode arch=compute_35,code=\"sm_35,compute_35\"
GENCODE_SM50 := -gencode arch=compute_50,code=\"sm_50,compute_50\"
# Should we relocate *.gcno and *.gcda files using -fprofile-dir option?
# Use GCOV_PREFIX and GCOV_PREFIX_STRIP if relocating:
# For example, if the object file /user/build/foo.o was built with -fprofile-arcs, the final executable will try to create the data file
# /user/build/foo.gcda when running on the target system. This will fail if the corresponding directory does not exist and it is unable
# to create it. This can be overcome by, for example, setting the environment as GCOV_PREFIX=/target/run and GCOV_PREFIX_STRIP=1.
# Such a setting will name the data file /target/run/build/foo.gcda
ifdef CNTK_CODE_COVERAGE
CXXFLAGS += -fprofile-arcs -ftest-coverage
LDFLAGS += -lgcov --coverage
endif
ifeq ("$(BUILDTYPE)","debug")
ifdef CNTK_CUDA_CODEGEN_DEBUG
GENCODE_FLAGS := $(CNTK_CUDA_CODEGEN_DEBUG)

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

@ -6,6 +6,7 @@ RUN=1
CLEAN_AFTER=0
CLEAN_BEFORE=0
RANDOM_OUTPUT=0
CODE_COVERAGE=no
FLAVORS="debug:release"
TARGETS="cpu:gpu"
TESTTARGETS="cpu:gpu"
@ -25,6 +26,7 @@ case $key in
echo " -f|--flavors <flavor1:flavor2...> - which flavor to build (by default $FLAVORS)"
echo " -t|--targets <target1:target2...> - which target to build (by default $TARGETS)"
echo " -tt|--test-targets <testtarget1:testtarget2...> - which target to test (by default $TESTTARGETS)"
echo " -cc|--code-coverage - build with support for code coverage (gcov)"
echo " -cb|--clean-build - clean up the enlistment binaries before build"
echo " -cba|--clean-build-after - clean up the enlistment binaries after build"
echo " -rnd|--random-output-suffix - add random suffix to output directory"
@ -66,6 +68,9 @@ case $key in
TESTTARGETS="${2,,}"
shift # past argument
;;
-cc|--code-coverage)
CODE_COVERAGE=yes
;;
-o|--output-directory)
OUTPUT_DIR="$2"
shift # past argument
@ -219,7 +224,7 @@ if [[ $BUILD == 1 ]]; then
OneBitSGDOPT=yes
fi
fi
./configure --with-build-top=$BUILD_DIR --with-acml=$ACML_PATH --with-buildtype=$FLAVOR --cuda=$CUDAOPT --1bitsgd=$OneBitSGDOPT
./configure --with-build-top=$BUILD_DIR --with-acml=$ACML_PATH --with-buildtype=$FLAVOR --cuda=$CUDAOPT --with-code-coverage=$CODE_COVERAGE --1bitsgd=$OneBitSGDOPT
if [[ $CLEAN_BEFORE == 1 ]]; then
make -C $BUILD_DIR -f $MAKEFILE clean 1>&6 2>&7 || exit $?
fi

18
configure поставляемый
Просмотреть файл

@ -54,6 +54,9 @@ mathlib=
default_use_1bitsgd=no
enable_1bitsgd=$default_use_1bitsgd
default_use_code_coverage=no
enable_code_coverage=$default_use_code_coverage
# List from best to worst choice
default_path_list="/usr /usr/local /opt /opt/local /opt/intel"
@ -209,6 +212,7 @@ function show_help ()
echo " --with-kaldi[=directory] $(show_default $(find_kaldi))"
echo " --with-opencv[=directory] $(show_default $(find_opencv))"
echo " --with-libzip[=directory] $(show_default $(find_libzip))"
echo " --with-code-coverage[=(yes|no)] $(show_default ${default_use_code_coverage})"
echo "Libraries search path:"
for head in $(default_paths)
do
@ -255,6 +259,17 @@ do
fi
;;
--with-code-coverage*)
if test x$optarg = xyes || test x$optarg = xno
then
enable_code_coverage=$optarg
else
echo "Invalid value for --with-code-coverage $optarg"
show_help
exit
fi
;;
--cuda*)
if test x$optarg = xyes || test x$optarg = xno
then
@ -645,6 +660,9 @@ fi
if test $enable_1bitsgd = yes ; then
echo CNTK_ENABLE_1BitSGD=true >> $config
fi
if test $enable_code_coverage = yes ; then
echo CNTK_CODE_COVERAGE=true >> $config
fi
# If we are not in the configure directory, generate a trampoline Makefile
makefile=$build_top/Makefile