提交 0b73318f 编写于 作者: G gangliao 提交者: GitHub

Merge pull request #789 from F0REacH/nvcc_stray_character_fix

Fix nvcc stray character Issue #760
......@@ -69,7 +69,7 @@ include(coveralls)
find_package(Git REQUIRED)
# version.cmake will get the current PADDLE_VERSION
include(version)
add_definitions(-DPADDLE_VERSION=\"${PADDLE_VERSION}\")
add_definitions(-DPADDLE_VERSION=${PADDLE_VERSION})
if(NOT WITH_GPU)
add_definitions(-DPADDLE_ONLY_CPU)
......
......@@ -33,7 +33,11 @@ void printVersion(std::ostream& os) {
#ifndef PADDLE_VERSION
#define PADDLE_VERSION "unknown"
#endif
os << "paddle version: " << PADDLE_VERSION << std::endl
// converts macro to string https://gcc.gnu.org/onlinedocs/cpp/Stringification.html
#define xstr(s) str(s)
#define str(s) #s
os << "paddle version: " << xstr(PADDLE_VERSION) << std::endl
<< std::boolalpha << "\t"
<< "withGpu: " << version::isWithGpu() << std::endl
<< "\t"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册