Display CUB and CUDNN paths (if defined) in BuildInfo

Print BuildInfo at the very begining of the program. convenient for checking
build type.
This commit is contained in:
Yongqiang Wang 2015-12-21 21:56:33 -08:00
Родитель b54cfccc37
Коммит 6777bbe0b7
3 изменённых файлов: 19 добавлений и 2 удалений

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

@ -345,6 +345,9 @@ void PrintBuiltInfo()
#ifdef _CUB_PATH_ #ifdef _CUB_PATH_
fprintf(stderr, "\t\tCUB_PATH: %s\n", _CUB_PATH_); fprintf(stderr, "\t\tCUB_PATH: %s\n", _CUB_PATH_);
#endif #endif
#ifdef _CUDNN_PATH_
fprintf(stderr, "\t\tCUDNN_PATH: %s\n", _CUDNN_PATH_);
#endif
#ifdef _GIT_EXIST #ifdef _GIT_EXIST
fprintf(stderr, "\t\tBuild Branch: %s\n", _BUILDBRANCH_); fprintf(stderr, "\t\tBuild Branch: %s\n", _BUILDBRANCH_);
fprintf(stderr, "\t\tBuild SHA1: %s\n", _BUILDSHA1_); fprintf(stderr, "\t\tBuild SHA1: %s\n", _BUILDSHA1_);
@ -568,7 +571,7 @@ int wmainOldCNTKConfig(int argc, wchar_t* argv[]) // called from wmain which i
RedirectStdErr(logpath); RedirectStdErr(logpath);
} }
PrintBuiltInfo(); PrintBuiltInfo(); // this one goes to log file
std::string timestamp = TimeDateStamp(); std::string timestamp = TimeDateStamp();
//dump config info //dump config info
@ -643,10 +646,11 @@ int wmainOldCNTKConfig(int argc, wchar_t* argv[]) // called from wmain which i
// main wrapper that catches C++ exceptions and prints them // main wrapper that catches C++ exceptions and prints them
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
int wmain1(int argc, wchar_t* argv[]) // called from wmain which is a wrapper that catches & repots Win32 exceptions int wmain1(int argc, wchar_t* argv[]) // called from wmain which is a wrapper that catches & reports Win32 exceptions
{ {
try try
{ {
PrintBuiltInfo(); // print build info directly in case that user provides zero argument (convenient for checking build type)
if (argc <= 1) if (argc <= 1)
InvalidArgument("No command-line argument given."); InvalidArgument("No command-line argument given.");
// detect legacy CNTK configuration // detect legacy CNTK configuration

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

@ -33,6 +33,16 @@ if "%cuda_path%" == "" (
echo #define _CUDA_PATH_ "%cuda_path:\=\\%" >> buildinfo.h$$ echo #define _CUDA_PATH_ "%cuda_path:\=\\%" >> buildinfo.h$$
) )
if not "%cudnn_path%" == "" (
echo #define _CUDNN_PATH_ "%cudnn_path:\=\\%" >> buildinfo.h$$
)
if not "%cub_path%" == "" (
echo #define _CUB_PATH_ "%cub_path:\=\\%" >> buildinfo.h$$
)
echo #endif >> buildinfo.h$$ echo #endif >> buildinfo.h$$
::: update file only if it changed (otherwise CNTK.cpp will get rebuilt each time) ::: update file only if it changed (otherwise CNTK.cpp will get rebuilt each time)

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

@ -56,6 +56,9 @@ makebuildinfo()
if [ ! -z "$CUB_PATH" ]; then if [ ! -z "$CUB_PATH" ]; then
printf "#define _CUB_PATH_ \"%s\"\n" $CUB_PATH >> $target printf "#define _CUB_PATH_ \"%s\"\n" $CUB_PATH >> $target
fi fi
if [ ! -z "$CUDNN_PATH" ]; then
printf "#define _CUDNN_PATH_ \"%s\"\n" $CUDNN_PATH >> $target
fi
printf "#define _BUILDTYPE_ \"%s\"\n" $BUILDTYPE >> $target printf "#define _BUILDTYPE_ \"%s\"\n" $BUILDTYPE >> $target
printf "#endif\n" >> $target printf "#endif\n" >> $target
} }