diff --git a/doc/fluid/dev/contribute_to_paddle_cn.md b/doc/fluid/dev/contribute_to_paddle_cn.md index 955216ca62e71b4d3666e1662aa86c9495d2e7d6..bcb71b3da1f1fad3def2d820b6f9b7330a6e4d54 120000 --- a/doc/fluid/dev/contribute_to_paddle_cn.md +++ b/doc/fluid/dev/contribute_to_paddle_cn.md @@ -1 +1 @@ -../../v2/dev/contribute_to_paddle_cn.md \ No newline at end of file +../../v2/dev/contribute_to_paddle_cn.md diff --git a/doc/fluid/dev/contribute_to_paddle_en.md b/doc/fluid/dev/contribute_to_paddle_en.md index f9fc68c37e17a8a365b0d7fae86c16b0d094631f..16679a406334cadce45f7a838773ea8b781c67de 120000 --- a/doc/fluid/dev/contribute_to_paddle_en.md +++ b/doc/fluid/dev/contribute_to_paddle_en.md @@ -1 +1 @@ -../../v2/dev/contribute_to_paddle_en.md \ No newline at end of file +../../v2/dev/contribute_to_paddle_en.md diff --git a/doc/fluid/new_docs/advanced_usage/development/contribute_to_paddle.md b/doc/fluid/new_docs/advanced_usage/development/contribute_to_paddle.md index 1126df7a829ab6d98e58a44e8f9c6459feae9a8b..9f1af6133fdaa6d82b4e0bda0efaca10c750f80e 120000 --- a/doc/fluid/new_docs/advanced_usage/development/contribute_to_paddle.md +++ b/doc/fluid/new_docs/advanced_usage/development/contribute_to_paddle.md @@ -1 +1 @@ -../../../dev/contribute_to_paddle_cn.md \ No newline at end of file +../../../dev/contribute_to_paddle_cn.md diff --git a/doc/fluid/new_docs/advanced_usage/development/cpu_profiling_cn.md b/doc/fluid/new_docs/advanced_usage/development/cpu_profiling_cn.md index 1381a3b05f6761c60742eb9365708d94ad8a2642..8c13564629a4e0851bb7540f23df468a78b7bae2 120000 --- a/doc/fluid/new_docs/advanced_usage/development/cpu_profiling_cn.md +++ b/doc/fluid/new_docs/advanced_usage/development/cpu_profiling_cn.md @@ -1 +1 @@ -../../../howto/optimization/cpu_profiling_cn.md \ No newline at end of file +../../../howto/optimization/cpu_profiling_cn.md diff --git a/doc/fluid/new_docs/advanced_usage/development/host_memory_profiling_cn.md b/doc/fluid/new_docs/advanced_usage/development/host_memory_profiling_cn.md index 904968ba4a8d6cc6489c91a0a751e0a33dcc873c..5501686e9823c1b270b46f38c946ddd18d8f5c05 120000 --- a/doc/fluid/new_docs/advanced_usage/development/host_memory_profiling_cn.md +++ b/doc/fluid/new_docs/advanced_usage/development/host_memory_profiling_cn.md @@ -1 +1 @@ -../../../howto/optimization/host_memory_profiling_cn.md \ No newline at end of file +../../../howto/optimization/host_memory_profiling_cn.md diff --git a/doc/fluid/new_docs/advanced_usage/development/new_op.md b/doc/fluid/new_docs/advanced_usage/development/new_op.md index dce0348585b8c484c1418a03a5fde5d78b0afcc9..a0d1af57ba6f836cec151501a6fdb68bc3756d8d 120000 --- a/doc/fluid/new_docs/advanced_usage/development/new_op.md +++ b/doc/fluid/new_docs/advanced_usage/development/new_op.md @@ -1 +1 @@ -../../../dev/new_op_cn.md \ No newline at end of file +../../../dev/new_op_cn.md diff --git a/doc/fluid/new_docs/advanced_usage/development/timeline_cn.md b/doc/fluid/new_docs/advanced_usage/development/timeline_cn.md index a05540e82a7fa795dcd8e7306261ef9bef57426f..1a782fd363a70b28cff18ef1dc5a2c084b3aa3ae 120000 --- a/doc/fluid/new_docs/advanced_usage/development/timeline_cn.md +++ b/doc/fluid/new_docs/advanced_usage/development/timeline_cn.md @@ -1 +1 @@ -../../../howto/optimization/timeline_cn.md \ No newline at end of file +../../../howto/optimization/timeline_cn.md diff --git a/doc/v2/dev/contribute_to_paddle_en.md b/doc/v2/dev/contribute_to_paddle_en.md index c97564d93a7f0a753a23cd97d2467d595bd154ff..72723396444c0a6cc0516f6f2379b2d868ba59f7 120000 --- a/doc/v2/dev/contribute_to_paddle_en.md +++ b/doc/v2/dev/contribute_to_paddle_en.md @@ -1 +1 @@ -../../../CONTRIBUTING.md \ No newline at end of file +../../../CONTRIBUTING.md diff --git a/paddle/fluid/framework/data_type.h b/paddle/fluid/framework/data_type.h index 8002a50206a2f2565eddaa69dda6209964cad671..f8c72ffc8964e64a10cff04f322f40b39b2fe263 100644 --- a/paddle/fluid/framework/data_type.h +++ b/paddle/fluid/framework/data_type.h @@ -58,7 +58,7 @@ inline void VisitDataType(proto::VarType::Type type, Visitor visitor) { PADDLE_THROW("Not supported %d", type); } } -#else +#else // the msvc compiler do not implement two-stage name lookup correctly. template inline void VisitDataType(proto::VarType::Type type, Visitor visitor) { @@ -91,7 +91,7 @@ inline void VisitDataType(proto::VarType::Type type, Visitor visitor) { PADDLE_THROW("Not supported %d", type); } } -#endif // _WIN32 +#endif // _WIN32 extern std::string DataTypeToString(const proto::VarType::Type type); extern size_t SizeOfType(std::type_index type); diff --git a/paddle/fluid/framework/data_type_transform.cu b/paddle/fluid/framework/data_type_transform.cu index f46491293ef4ad688c1bce9327f5f28011dec809..7dd9cb5cfd440ca05a471e4731e1fc68fafb3588 120000 --- a/paddle/fluid/framework/data_type_transform.cu +++ b/paddle/fluid/framework/data_type_transform.cu @@ -1 +1,15 @@ +// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + data_type_transform.cc \ No newline at end of file diff --git a/paddle/fluid/framework/lod_tensor.cc b/paddle/fluid/framework/lod_tensor.cc index 0155465cea6c837368632c14911f239f78de0e1c..dc22e8e581663e6be1a5bcd4d81f753dc2e49d2e 100644 --- a/paddle/fluid/framework/lod_tensor.cc +++ b/paddle/fluid/framework/lod_tensor.cc @@ -28,7 +28,7 @@ limitations under the License. */ #if defined(_WIN32) #include "paddle/fluid/recordio/scanner.h" #include "paddle/fluid/recordio/writer.h" -#endif // _WIN32 +#endif // _WIN32 namespace paddle { namespace framework { @@ -337,14 +337,14 @@ class Writer {}; class Scanner {}; void WriteToRecordIO(recordio::Writer *writer, const std::vector &tensor, - const platform::DeviceContext &dev_ctx) { -} + const platform::DeviceContext &dev_ctx) {} bool ReadFromRecordIO(recordio::Scanner *scanner, const platform::DeviceContext &dev_ctx, - std::vector *result_ptr) { + std::vector *result_ptr) { PADDLE_ENFORCE("windows didn't supported recordio!."); - return true;} -#endif // _WIN32 + return true; +} +#endif // _WIN32 std::vector LoDTensor::SplitLoDTensor( const std::vector places) const { check_memory_size(); diff --git a/paddle/fluid/framework/lod_tensor_test.cc b/paddle/fluid/framework/lod_tensor_test.cc index bb176aa14d1b0d307dea2ee98d21a4b029a49201..cbf5fd04d73007d303d0fd96064e3a2d7f21cfb8 100644 --- a/paddle/fluid/framework/lod_tensor_test.cc +++ b/paddle/fluid/framework/lod_tensor_test.cc @@ -321,7 +321,7 @@ TEST(LoDTensor, RecordIO) { TestRecordIO(); TestRecordIO(); } -#endif // !defined(_WIN32) +#endif // !defined(_WIN32) } // namespace framework } // namespace paddle diff --git a/paddle/fluid/framework/rw_lock.h b/paddle/fluid/framework/rw_lock.h index 70121316525c2713298479470bf690f5ac4612bb..a068d3543d9d2abec203f86362a8be5ba135d04d 100644 --- a/paddle/fluid/framework/rw_lock.h +++ b/paddle/fluid/framework/rw_lock.h @@ -16,7 +16,7 @@ limitations under the License. */ #if !defined(_WIN32) #include -#endif // !_WIN32 +#endif // !_WIN32 #include "paddle/fluid/platform/enforce.h" diff --git a/paddle/fluid/framework/tensor_util.cu b/paddle/fluid/framework/tensor_util.cu index edd88c4e547016c7ec0e0c95547b3ede4b6f3c60..251c3a5e4097b7735bd9e2e9e3972bedae95d67e 120000 --- a/paddle/fluid/framework/tensor_util.cu +++ b/paddle/fluid/framework/tensor_util.cu @@ -1 +1,15 @@ +// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + tensor_util.cc \ No newline at end of file diff --git a/paddle/fluid/memory/detail/system_allocator.cc b/paddle/fluid/memory/detail/system_allocator.cc index e36c338fcea819e41cc3ad4fddf1f3dd070b25ef..bf7a9e8264763628ce76e61863d6e3b936799105 100644 --- a/paddle/fluid/memory/detail/system_allocator.cc +++ b/paddle/fluid/memory/detail/system_allocator.cc @@ -16,13 +16,13 @@ limitations under the License. */ #include "paddle/fluid/memory/detail/system_allocator.h" #ifdef _WIN32 -#include #include +#include #else #include // for mlock and munlock #endif -#include // for malloc and free -#include // for std::max +#include // for malloc and free +#include // for std::max #include "gflags/gflags.h" #include "paddle/fluid/platform/assert.h" @@ -44,15 +44,15 @@ namespace detail { void* AlignedMalloc(size_t size) { void* p = nullptr; size_t alignment = 32ul; - #ifdef PADDLE_WITH_MKLDNN +#ifdef PADDLE_WITH_MKLDNN // refer to https://github.com/01org/mkl-dnn/blob/master/include/mkldnn.hpp // memory alignment alignment = 4096ul; - #endif +#endif #ifdef _WIN32 p = _aligned_malloc(size, alignment); #else - PADDLE_ENFORCE_EQ(posix_memalign(&p, alignment, size), 0, "Alloc %ld error!", + PADDLE_ENFORCE_EQ(posix_memalign(&p, alignment, size), 0, "Alloc %ld error!", size); #endif PADDLE_ENFORCE(p, "Fail to allocate CPU memory: size = %d .", size); diff --git a/paddle/fluid/operators/math/math_function.h b/paddle/fluid/operators/math/math_function.h index 03bfe595b0967e3c8a461e4a218d5921595cbe76..7ec78d9ef8e7ff966674b043c017f2fbedb77bb9 100644 --- a/paddle/fluid/operators/math/math_function.h +++ b/paddle/fluid/operators/math/math_function.h @@ -17,7 +17,6 @@ limitations under the License. */ #include "paddle/fluid/platform/dynload/mklml.h" #endif - #ifdef PADDLE_USE_OPENBLAS #include #endif diff --git a/paddle/fluid/platform/cpu_info.cc b/paddle/fluid/platform/cpu_info.cc index ef9312b5db6556aa78b14bad2d92a84a933b4f8e..90a0db3829b5eae329e41d2869149e60759506be 100644 --- a/paddle/fluid/platform/cpu_info.cc +++ b/paddle/fluid/platform/cpu_info.cc @@ -24,8 +24,8 @@ limitations under the License. */ #include #elif defined(_WIN32) #define NOMINMAX -#include #include +#include #else #include #endif @@ -47,8 +47,9 @@ DEFINE_uint64(initial_cpu_memory_in_mb, #endif "Initial CPU memory for PaddlePaddle, in MD unit."); #else -DEFINE_uint64(initial_cpu_memory_in_mb, 500ul, "Initial CPU memory for PaddlePaddle, in MD unit."); -#endif // !defined(_WIN32) +DEFINE_uint64(initial_cpu_memory_in_mb, 500ul, + "Initial CPU memory for PaddlePaddle, in MD unit."); +#endif // !defined(_WIN32) DEFINE_double( fraction_of_cuda_pinned_memory_to_use, 0.5, @@ -68,10 +69,10 @@ inline size_t CpuTotalPhysicalMemory() { if (sysctl(mib, 2, &size, &len, NULL, 0) == 0) return (size_t)size; return 0L; #elif defined(_WIN32) -MEMORYSTATUSEX sMeminfo; -sMeminfo.dwLength = sizeof(sMeminfo); -GlobalMemoryStatusEx(&sMeminfo); -return sMeminfo.ullTotalPhys; + MEMORYSTATUSEX sMeminfo; + sMeminfo.dwLength = sizeof(sMeminfo); + GlobalMemoryStatusEx(&sMeminfo); + return sMeminfo.ullTotalPhys; #else int64_t pages = sysconf(_SC_PHYS_PAGES); int64_t page_size = sysconf(_SC_PAGE_SIZE); diff --git a/paddle/fluid/platform/device_tracer.h b/paddle/fluid/platform/device_tracer.h index 2aed4c6e83ccd3adc8d656ddf4e2e45bc76d5c84..f59fc40b71699a790978e22fd7e26da8d4d94c5f 100644 --- a/paddle/fluid/platform/device_tracer.h +++ b/paddle/fluid/platform/device_tracer.h @@ -17,7 +17,7 @@ limitations under the License. */ #include #else #include -#endif // !_WIN32 +#endif // !_WIN32 #include #include // NOLINT @@ -36,13 +36,11 @@ namespace platform { inline uint64_t PosixInNsec() { struct timeval tv; gettimeofday(&tv, nullptr); - return 1000 * (static_cast(tv.tv_sec) * 1000000 + tv.tv_usec); + return 1000 * (static_cast(tv.tv_sec) * 1000000 + tv.tv_usec); } #else - inline uint64_t PosixInNsec() { - return static_cast(0); -} -#endif // !_WIN32 +inline uint64_t PosixInNsec() { return static_cast(0); } +#endif // !_WIN32 // DeviceTracer performs the following tasks: // 1. Register cuda callbacks for various events: kernel, memcpy, etc. diff --git a/paddle/fluid/platform/enforce.h b/paddle/fluid/platform/enforce.h index 876f1d2acea59797753b3a544980a74e1afe1888..a0414994e1352159f3868370fd0ef1a11d083620 100644 --- a/paddle/fluid/platform/enforce.h +++ b/paddle/fluid/platform/enforce.h @@ -33,9 +33,9 @@ limitations under the License. */ #include #include "glog/logging.h" -#include "paddle/fluid/platform/port.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" @@ -261,20 +261,21 @@ inline void throw_on_error(T e) { throw ::paddle::platform::EOFException("There is no next data.", __FILE__, \ __LINE__); \ } while (false) - + #else #define PADDLE_ENFORCE(...) ::paddle::platform::throw_on_error(__VA_ARGS__); #endif -#else // !_WIN32 +#else // !_WIN32 #define GLOG_NO_ABBREVIATED_SEVERITIES - // disable enforce, caused by the varardic macro exception error -#define PADDLE_THROW(x) \ - do { \ - throw std::make_exception_ptr(std::runtime_error("Windows disable the enforce.")); \ +// disable enforce, caused by the varardic macro exception error +#define PADDLE_THROW(x) \ + do { \ + throw std::make_exception_ptr( \ + std::runtime_error("Windows disable the enforce.")); \ } while (false) #define PADDLE_ENFORCE(x) x -#endif // !_WIN32 +#endif // !_WIN32 /* * Some enforce helpers here, usage: diff --git a/paddle/fluid/platform/port.h b/paddle/fluid/platform/port.h index 6075650ed9582b1973abacb1e5eba3e591cce1d8..a0a2d29500e7afbe8a9a43f010d5fd2d0c560467 100644 --- a/paddle/fluid/platform/port.h +++ b/paddle/fluid/platform/port.h @@ -1,31 +1,3 @@ -<<<<<<< HEAD -#pragma once - -#include -#include - -#if !defined(_WIN32) -#include // for dladdr -#include // for backtrace -#else -#define NOMINMAX // windows min(), max() macro will mess std::min,max -#include -#include -namespace { - -static void* dlsym(void *handle, const char* symbol_name) { - FARPROC found_symbol; - found_symbol = GetProcAddress((HMODULE)handle, symbol_name); - - if (found_symbol == NULL) { - throw std::runtime_error(std::string(symbol_name) + " not found."); - } - return (void*)found_symbol; -} -} // namespace anoymous - -#endif -======= // Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -63,4 +35,3 @@ static void* dlsym(void* handle, const char* symbol_name) { } #endif ->>>>>>> origin/develop