From 6777bbe0b757b5204edd8b15a95c1857890e9fd3 Mon Sep 17 00:00:00 2001 From: Yongqiang Wang Date: Mon, 21 Dec 2015 21:56:33 -0800 Subject: [PATCH] Display CUB and CUDNN paths (if defined) in BuildInfo Print BuildInfo at the very begining of the program. convenient for checking build type. --- Source/CNTK/CNTK.cpp | 8 ++++++-- Source/CNTK/prebuild.bat | 10 ++++++++++ Tools/generate_build_info | 3 +++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Source/CNTK/CNTK.cpp b/Source/CNTK/CNTK.cpp index e7753e2c7..e85dd7801 100644 --- a/Source/CNTK/CNTK.cpp +++ b/Source/CNTK/CNTK.cpp @@ -345,6 +345,9 @@ void PrintBuiltInfo() #ifdef _CUB_PATH_ fprintf(stderr, "\t\tCUB_PATH: %s\n", _CUB_PATH_); #endif +#ifdef _CUDNN_PATH_ + fprintf(stderr, "\t\tCUDNN_PATH: %s\n", _CUDNN_PATH_); +#endif #ifdef _GIT_EXIST fprintf(stderr, "\t\tBuild Branch: %s\n", _BUILDBRANCH_); 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); } - PrintBuiltInfo(); + PrintBuiltInfo(); // this one goes to log file std::string timestamp = TimeDateStamp(); //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 // --------------------------------------------------------------------------- -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 { + PrintBuiltInfo(); // print build info directly in case that user provides zero argument (convenient for checking build type) if (argc <= 1) InvalidArgument("No command-line argument given."); // detect legacy CNTK configuration diff --git a/Source/CNTK/prebuild.bat b/Source/CNTK/prebuild.bat index 9f841d104..12631cf52 100644 --- a/Source/CNTK/prebuild.bat +++ b/Source/CNTK/prebuild.bat @@ -33,6 +33,16 @@ if "%cuda_path%" == "" ( 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$$ ::: update file only if it changed (otherwise CNTK.cpp will get rebuilt each time) diff --git a/Tools/generate_build_info b/Tools/generate_build_info index a155fc84e..62686222e 100755 --- a/Tools/generate_build_info +++ b/Tools/generate_build_info @@ -56,6 +56,9 @@ makebuildinfo() if [ ! -z "$CUB_PATH" ]; then printf "#define _CUB_PATH_ \"%s\"\n" $CUB_PATH >> $target fi + if [ ! -z "$CUDNN_PATH" ]; then + printf "#define _CUDNN_PATH_ \"%s\"\n" $CUDNN_PATH >> $target + fi printf "#define _BUILDTYPE_ \"%s\"\n" $BUILDTYPE >> $target printf "#endif\n" >> $target }