提交 3adfdf0c 编写于 作者: F FoREacH

Fix nvcc stray character Issue #760

上级 2039070e
......@@ -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: " << str(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.
先完成此消息的编辑!
想要评论请 注册