From cfbf1ba3054b0b679a14a5ea4c324af13ccc53b5 Mon Sep 17 00:00:00 2001 From: dzhwinter Date: Fri, 24 Aug 2018 15:44:04 +0800 Subject: [PATCH] add source --- paddle/fluid/framework/CMakeLists.txt | 9 +-------- paddle/fluid/operators/CMakeLists.txt | 4 ---- paddle/fluid/platform/cpu_info.cc | 6 +++--- paddle/fluid/platform/enforce.h | 14 +++++++++----- paddle/fluid/platform/macros.h | 2 -- paddle/fluid/pybind/CMakeLists.txt | 10 +--------- 6 files changed, 14 insertions(+), 31 deletions(-) diff --git a/paddle/fluid/framework/CMakeLists.txt b/paddle/fluid/framework/CMakeLists.txt index 5a5696976..2c62d4ed6 100644 --- a/paddle/fluid/framework/CMakeLists.txt +++ b/paddle/fluid/framework/CMakeLists.txt @@ -1,6 +1,6 @@ +add_subdirectory(ir) if (NOT WIN32) add_subdirectory(details) -add_subdirectory(ir) endif (NOT WIN32) # ddim lib proto_library(framework_proto SRCS framework.proto) @@ -114,19 +114,12 @@ else() cc_library(executor SRCS executor.cc DEPS op_registry device_context scope framework_proto glog lod_rank_table feed_fetch_method) endif() -<<<<<<< HEAD - - -if (NOT WIN32) -cc_library(parallel_executor SRCS parallel_executor.cc DEPS threaded_ssa_graph_executor scope_buffered_ssa_graph_executor graph graph_viz_pass multi_devices_graph_pass multi_devices_graph_print_pass multi_devices_graph_check_pass) -======= if (NOT WIN32) cc_library(parallel_executor SRCS parallel_executor.cc DEPS threaded_ssa_graph_executor scope_buffered_ssa_graph_executor graph graph_viz_pass multi_devices_graph_pass multi_devices_graph_print_pass multi_devices_graph_check_pass fast_threaded_ssa_graph_executor) ->>>>>>> origin/develop endif() # NOT WIN32 cc_library(prune SRCS prune.cc DEPS framework_proto) diff --git a/paddle/fluid/operators/CMakeLists.txt b/paddle/fluid/operators/CMakeLists.txt index 171f7ff76..8da0aaaaf 100644 --- a/paddle/fluid/operators/CMakeLists.txt +++ b/paddle/fluid/operators/CMakeLists.txt @@ -85,11 +85,7 @@ function(op_library TARGET) #remove windows unsupported op if (WIN32) -<<<<<<< HEAD foreach(windows_unsupport_op "nccl_op" "gen_nccl_id_op" "warpctc_op") -======= - foreach(windows_unsupport_op "nccl_op" "gen_nccl_id_op") ->>>>>>> origin/develop if ("${TARGET}" STREQUAL "${windows_unsupport_op}") return() endif() diff --git a/paddle/fluid/platform/cpu_info.cc b/paddle/fluid/platform/cpu_info.cc index 90a0db382..2880c0926 100644 --- a/paddle/fluid/platform/cpu_info.cc +++ b/paddle/fluid/platform/cpu_info.cc @@ -22,13 +22,13 @@ limitations under the License. */ #ifdef __APPLE__ #include #include + #elif defined(_WIN32) -#define NOMINMAX -#include +#define NOMINMAX // msvc max/min macro conflict with std::min/max #include #else #include -#endif +#endif // _WIN32 #include #include "gflags/gflags.h" diff --git a/paddle/fluid/platform/enforce.h b/paddle/fluid/platform/enforce.h index a0414994e..61a653d93 100644 --- a/paddle/fluid/platform/enforce.h +++ b/paddle/fluid/platform/enforce.h @@ -18,6 +18,11 @@ limitations under the License. */ #include // for __cxa_demangle #endif // __GNUC__ +#if defined(_WIN32) +#define NOMINMAX // msvc max/min macro conflict with std::min/max +#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h +#endif + #ifdef PADDLE_WITH_CUDA #include #include @@ -35,7 +40,6 @@ limitations under the License. */ #include "glog/logging.h" #include "paddle/fluid/platform/macros.h" #include "paddle/fluid/platform/port.h" -#include "paddle/fluid/platform/port.h" #include "paddle/fluid/string/printf.h" #include "paddle/fluid/string/to_string.h" @@ -263,10 +267,10 @@ inline void throw_on_error(T e) { } while (false) #else -#define PADDLE_ENFORCE(...) ::paddle::platform::throw_on_error(__VA_ARGS__); -#endif +#define PADDLE_ENFORCE(...) ::paddle::platform::throw_on_error(__VA_ARGS__) +#endif // REPLACE_ENFORCE_GLOG + #else // !_WIN32 -#define GLOG_NO_ABBREVIATED_SEVERITIES // disable enforce, caused by the varardic macro exception error #define PADDLE_THROW(x) \ do { \ @@ -274,7 +278,7 @@ inline void throw_on_error(T e) { std::runtime_error("Windows disable the enforce.")); \ } while (false) -#define PADDLE_ENFORCE(x) x +#define PADDLE_ENFORCE(x, ...) x #endif // !_WIN32 /* diff --git a/paddle/fluid/platform/macros.h b/paddle/fluid/platform/macros.h index 78775a2bb..4cc04b090 100644 --- a/paddle/fluid/platform/macros.h +++ b/paddle/fluid/platform/macros.h @@ -14,8 +14,6 @@ limitations under the License. */ #pragma once -#define GLOG_NO_ABBREVIATED_SEVERITIES - // Disable the copy and assignment operator for a class. #ifndef DISABLE_COPY_AND_ASSIGN #define DISABLE_COPY_AND_ASSIGN(classname) \ diff --git a/paddle/fluid/pybind/CMakeLists.txt b/paddle/fluid/pybind/CMakeLists.txt index 51713f474..b5bd07d40 100644 --- a/paddle/fluid/pybind/CMakeLists.txt +++ b/paddle/fluid/pybind/CMakeLists.txt @@ -1,4 +1,4 @@ -<<<<<<< HEAD + set(PYBIND_DEPS pybind python proto_desc memory executor prune feed_fetch_method) set(PYBIND_SRCS pybind.cc exception.cc protobuf.cc const_value.cc) if(NOT WIN32) @@ -8,20 +8,12 @@ endif() if(WITH_PYTHON) if(WITH_AMD_GPU) hip_library(paddle_pybind SHARED -<<<<<<< HEAD SRCS ${PYBIND_SRCS} -======= - SRCS pybind.cc exception.cc protobuf.cc const_value.cc recordio.cc ->>>>>>> origin/develop DEPS ${PYBIND_DEPS} ${GLOB_OP_LIB}) else() cc_library(paddle_pybind SHARED -<<<<<<< HEAD SRCS ${PYBIND_SRCS} -======= - SRCS pybind.cc exception.cc protobuf.cc const_value.cc recordio.cc ->>>>>>> origin/develop DEPS ${PYBIND_DEPS} ${GLOB_OP_LIB}) if(NOT APPLE AND NOT ANDROID AND NOT WIN32) -- GitLab