Skip to content

Commit 873368f

Browse files
committed
Add style check to target
1 parent 657d204 commit 873368f

12 files changed

+165
-9
lines changed

paddle/capi/Arguments.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
#include "PaddleCAPI.h"
216
#include "PaddleCAPIPrivate.h"
317

paddle/capi/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ file(GLOB CAPI_SOURCES *.cpp)
1515
add_library(paddle_capi STATIC ${CAPI_SOURCES})
1616

1717
target_include_directories(paddle_capi PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
18+
add_style_check_target(paddle_capi ${CAPI_SOURCES} ${CAPI_HEADER}
19+
${CAPI_PRIVATE_HEADER})
1820
add_dependencies(paddle_capi gen_proto_cpp)
1921

2022
set(PADDLE_CAPI_INC_PATH

paddle/capi/GradientMachine.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
#include "PaddleCAPI.h"
216
#include "PaddleCAPIPrivate.h"
317
#include "paddle/gserver/gradientmachines/NeuralNetwork.h"
@@ -21,7 +35,7 @@ NeuralNetwork* newCustomNerualNetwork(const std::string& name,
2135
NeuralNetwork* network) {
2236
return new MyNeuralNetwork(name, network);
2337
}
24-
}
38+
} // namespace paddle
2539

2640
extern "C" {
2741
int PDGradientMachineCreateForPredict(PD_GradiemtMachine* machine,
@@ -91,7 +105,6 @@ int PDGradientMachineCreateSharedParam(PD_GradiemtMachine origin,
91105
auto p = o->machine->getParameters()[paramId];
92106
param->enableSharedType(paddle::PARAMETER_VALUE,
93107
p->getBuf(paddle::PARAMETER_VALUE));
94-
95108
},
96109
{paddle::PARAMETER_VALUE},
97110
false);

paddle/capi/Main.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
#include <fenv.h>
216
#include <stdlib.h>
317
#include <string.h>

paddle/capi/Matrix.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
#include "PaddleCAPI.h"
216
#include "PaddleCAPIPrivate.h"
317
#include "hl_cuda.h"

paddle/capi/PaddleCAPI.h

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1-
#ifndef __PADDLE_PADDLE_CAPI_PADDLECAPI_H_INCLUDED__
2-
#define __PADDLE_PADDLE_CAPI_PADDLECAPI_H_INCLUDED__
1+
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
15+
#ifndef PADDLECAPI_H_
16+
#define PADDLECAPI_H_
317
#include <stdbool.h>
418
#include <stdint.h>
519
#include "config.h"
@@ -79,4 +93,5 @@ int PDInit(int argc, char** argv);
7993
#ifdef __cplusplus
8094
}
8195
#endif
82-
#endif
96+
97+
#endif // PADDLECAPI_H_

paddle/capi/PaddleCAPIPrivate.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
#include "PaddleCAPI.h"
216
#include "paddle/gserver/gradientmachines/GradientMachine.h"
317
#include "paddle/math/Matrix.h"
@@ -48,5 +62,5 @@ template <typename T>
4862
inline T* cast(void* ptr) {
4963
return reinterpret_cast<T*>(ptr);
5064
}
51-
}
52-
}
65+
} // namespace capi
66+
} // namespace paddle

paddle/capi/Vector.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
#include "PaddleCAPI.h"
216
#include "PaddleCAPIPrivate.h"
317

paddle/capi/tests/test_Arguments.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
#include "PaddleCAPI.h"
216
#include "gtest/gtest.h"
317
#include "paddle/utils/ThreadLocal.h"

paddle/capi/tests/test_GradientMachine.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
#include <gtest/gtest.h>
216
#include <paddle/gserver/gradientmachines/GradientMachine.h>
317
#include <paddle/trainer/TrainerConfigHelper.h>

0 commit comments

Comments
 (0)