Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Makefile

*~
bazel-*
third_party/
2 changes: 1 addition & 1 deletion paddle/api/PaddleAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ limitations under the License. */
#include <stdexcept>
#include <string>
#include <vector>
#include "paddle/utils/Common.h"
#include "paddle/utils/GlobalConstants.h"
#include "paddle/utils/common.h"

/// Import PaddlePaddle's enumeration into global namespace.
using namespace paddle::enumeration_wrapper; // NOLINT
Expand Down
3 changes: 1 addition & 2 deletions paddle/api/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ limitations under the License. */
#include "PaddleAPI.h"

#include "paddle/parameter/Parameter.h"
#include "paddle/utils/Excepts.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/Flags.h"
#include "paddle/utils/PythonUtil.h"
#include "paddle/utils/Util.h"

#include <fenv.h>
#include <algorithm>
#include <iostream>
#include <iterator>
Expand Down
2 changes: 1 addition & 1 deletion paddle/gserver/dataproviders/DataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ limitations under the License. */
#include "paddle/math/Vector.h"
#include "paddle/parameter/Argument.h"
#include "paddle/utils/ClassRegistrar.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/Locks.h"
#include "paddle/utils/Logging.h"
#include "paddle/utils/Queue.h"
#include "paddle/utils/ThreadLocal.h"
#include "paddle/utils/Util.h"
#include "paddle/utils/common.h"

namespace paddle {
/**
Expand Down
3 changes: 1 addition & 2 deletions paddle/gserver/dataproviders/PyDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */

#include "PyDataProvider.h"
#include <fenv.h>
#include "paddle/utils/Excepts.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/PythonUtil.h"
#include "paddle/utils/Util.h"

Expand Down
2 changes: 1 addition & 1 deletion paddle/gserver/layers/GruCompute.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License. */

#include "ModelConfig.pb.h"
#include "hl_gpu.h"
#include "paddle/utils/common.h"
#include "paddle/utils/Common.h"

namespace paddle {

Expand Down
2 changes: 1 addition & 1 deletion paddle/gserver/layers/LstmCompute.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License. */

#include "ModelConfig.pb.h"
#include "hl_gpu.h"
#include "paddle/utils/common.h"
#include "paddle/utils/Common.h"

namespace paddle {

Expand Down
2 changes: 1 addition & 1 deletion paddle/gserver/layers/MultinomialSampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License. */

#include <memory>
#include <random>
#include "paddle/utils/common.h"
#include "paddle/utils/Common.h"

namespace paddle {

Expand Down
2 changes: 1 addition & 1 deletion paddle/math/BaseMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License. */
#include <stdint.h>
#include <cstddef>
#include "TensorExpression.h"
#include "paddle/utils/common.h"
#include "paddle/utils/Common.h"

namespace paddle {

Expand Down
2 changes: 1 addition & 1 deletion paddle/math/Matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ limitations under the License. */
#include "BaseMatrix.h"
#include "MemoryHandle.h"
#include "Vector.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/ThreadLocal.h"
#include "paddle/utils/common.h"

namespace paddle {

Expand Down
2 changes: 1 addition & 1 deletion paddle/math/TensorExpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ limitations under the License. */
#include <stdint.h>
#include <cstddef>
#include "hl_tensor_ops.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/Logging.h"
#include "paddle/utils/common.h"

namespace paddle {

Expand Down
2 changes: 1 addition & 1 deletion paddle/math/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ limitations under the License. */

#include "BaseMatrix.h"
#include "MemoryHandle.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/Thread.h"
#include "paddle/utils/common.h"

namespace paddle {

Expand Down
4 changes: 2 additions & 2 deletions paddle/math/tests/test_FPException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ limitations under the License. */
* so we can add some tricks to prevent exp calculate an excessive value.
*
*/
#include <fenv.h>

#include <gtest/gtest.h>
#include "paddle/math/Matrix.h"
#include "paddle/utils/Excepts.h"
#include "paddle/utils/Common.h"

using namespace paddle; // NOLINT

Expand Down
2 changes: 1 addition & 1 deletion paddle/parameter/ParallelParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ limitations under the License. */
#include "paddle/math/Vector.h"
#include "paddle/parameter/Parameter.h"
#include "paddle/parameter/ParameterUpdateFunctions.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/Flags.h"
#include "paddle/utils/Locks.h"
#include "paddle/utils/common.h"

#include "ParameterConfig.pb.h"

Expand Down
2 changes: 1 addition & 1 deletion paddle/parameter/Parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ limitations under the License. */
#include "ParameterUpdaterHook.h"
#include "paddle/math/Matrix.h"
#include "paddle/math/Vector.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/GlobalConstants.h"
#include "paddle/utils/Locks.h"
#include "paddle/utils/ThreadLocal.h"
#include "paddle/utils/Util.h"
#include "paddle/utils/common.h"

namespace paddle {

Expand Down
2 changes: 1 addition & 1 deletion paddle/parameter/ParameterUpdateFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License. */
#pragma once

#include "paddle/math/Vector.h"
#include "paddle/utils/common.h"
#include "paddle/utils/Common.h"

namespace paddle {

Expand Down
2 changes: 1 addition & 1 deletion paddle/pserver/BaseClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ limitations under the License. */
#include "ParameterService.pb.h"
#include "paddle/math/Matrix.h"
#include "paddle/pserver/ProtoServer.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/Queue.h"
#include "paddle/utils/common.h"

namespace paddle {

Expand Down
2 changes: 1 addition & 1 deletion paddle/pserver/ParameterClient2.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ limitations under the License. */
#include "paddle/math/Vector.h"
#include "paddle/parameter/Parameter.h"
#include "paddle/pserver/BaseClient.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/Flags.h"
#include "paddle/utils/Locks.h"
#include "paddle/utils/Queue.h"
#include "paddle/utils/Util.h"
#include "paddle/utils/common.h"

#include "ParameterService.pb.h"

Expand Down
2 changes: 1 addition & 1 deletion paddle/pserver/ParameterServer2.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ limitations under the License. */
#include "paddle/math/Vector.h"
#include "paddle/parameter/Parameter.h"
#include "paddle/parameter/ParameterOptimizer.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/Locks.h"
#include "paddle/utils/Stat.h"
#include "paddle/utils/ThreadLocal.h"
#include "paddle/utils/common.h"

#include "ParameterService.pb.h"

Expand Down
3 changes: 1 addition & 2 deletions paddle/trainer/Trainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ limitations under the License. */

#include "Trainer.h"

#include <fenv.h>
#include <stdio.h>

#include <iomanip>
Expand All @@ -24,7 +23,7 @@ limitations under the License. */

#include <google/protobuf/text_format.h>

#include "paddle/utils/Excepts.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/GlobalConstants.h"
#include "paddle/utils/PythonUtil.h"
#include "paddle/utils/Stat.h"
Expand Down
3 changes: 1 addition & 2 deletions paddle/trainer/TrainerMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ 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. */

#include <fenv.h>
#include "paddle/pserver/ParameterServer2.h"
#include "paddle/utils/Excepts.h"
#include "paddle/utils/Common.h"
#include "paddle/utils/PythonUtil.h"
#include "paddle/utils/StringUtil.h"

Expand Down
2 changes: 2 additions & 0 deletions paddle/utils/common.h → paddle/utils/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ limitations under the License. */

#pragma once

#include "Excepts.h"

/**
* Disable copy macro.
*/
Expand Down
2 changes: 1 addition & 1 deletion paddle/utils/CpuId.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ limitations under the License. */

#pragma once

#include "common.h"
#include "Common.h"

namespace paddle {

Expand Down
2 changes: 2 additions & 0 deletions paddle/utils/Excepts.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ limitations under the License. */
#ifndef EXCEPTS_H_
#define EXCEPTS_H_

#include <fenv.h>

#if defined(__APPLE__) || defined(__OSX__)

int fegetexcept(void);
Expand Down
2 changes: 1 addition & 1 deletion paddle/utils/Locks.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License. */
#include <condition_variable>
#include <mutex>

#include "common.h"
#include "Common.h"

namespace paddle {

Expand Down
2 changes: 1 addition & 1 deletion paddle/utils/Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ limitations under the License. */
#include <unordered_map>
#include <vector>

#include "Common.h"
#include "Logging.h"
#include "TrainerConfig.pb.h"
#include "common.h"

#include "Flags.h"
#include "hl_gpu.h"
Expand Down
2 changes: 1 addition & 1 deletion paddle/utils/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License. */
#pragma once
#include <stddef.h>
#include <iostream>
#include "common.h"
#include "Common.h"

namespace paddle {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ 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. */

#include "Excepts.h"
#include "paddle/utils/Excepts.h"

#if defined(__APPLE__) || defined(__OSX__)

#include <fenv.h>

int fegetexcept(void) {
static fenv_t fenv;
return fegetenv(&fenv) ? -1 : (fenv.__control & FE_ALL_EXCEPT);
Expand Down