diff --git a/paddle/capi/Arguments.cpp b/paddle/capi/Arguments.cpp index b983d72bb4271f4fac2e0b8818df28a99a16a2be..60bdea15ae76d3d977c15ef87172e3aacaf793f5 100644 --- a/paddle/capi/Arguments.cpp +++ b/paddle/capi/Arguments.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +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. */ + #include "PaddleCAPI.h" #include "PaddleCAPIPrivate.h" diff --git a/paddle/capi/CMakeLists.txt b/paddle/capi/CMakeLists.txt index 93b6b41254d2e0c3ac4032621c2839ca34a0d4a0..6eb1e9949a4663910562814a4bc3365a25888b00 100644 --- a/paddle/capi/CMakeLists.txt +++ b/paddle/capi/CMakeLists.txt @@ -15,6 +15,8 @@ file(GLOB CAPI_SOURCES *.cpp) add_library(paddle_capi STATIC ${CAPI_SOURCES}) target_include_directories(paddle_capi PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) +add_style_check_target(paddle_capi ${CAPI_SOURCES} ${CAPI_HEADER} + ${CAPI_PRIVATE_HEADER}) add_dependencies(paddle_capi gen_proto_cpp) set(PADDLE_CAPI_INC_PATH diff --git a/paddle/capi/GradientMachine.cpp b/paddle/capi/GradientMachine.cpp index ef584ed8d0d0da94cd49b39ce5c6152c9a7e3839..8299e6442f667440a0c68afc12a619e043c9efc8 100644 --- a/paddle/capi/GradientMachine.cpp +++ b/paddle/capi/GradientMachine.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +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. */ + #include "PaddleCAPI.h" #include "PaddleCAPIPrivate.h" #include "paddle/gserver/gradientmachines/NeuralNetwork.h" @@ -21,7 +35,7 @@ NeuralNetwork* newCustomNerualNetwork(const std::string& name, NeuralNetwork* network) { return new MyNeuralNetwork(name, network); } -} +} // namespace paddle extern "C" { int PDGradientMachineCreateForPredict(PD_GradiemtMachine* machine, @@ -91,7 +105,6 @@ int PDGradientMachineCreateSharedParam(PD_GradiemtMachine origin, auto p = o->machine->getParameters()[paramId]; param->enableSharedType(paddle::PARAMETER_VALUE, p->getBuf(paddle::PARAMETER_VALUE)); - }, {paddle::PARAMETER_VALUE}, false); diff --git a/paddle/capi/Main.cpp b/paddle/capi/Main.cpp index 8cd0104be2e07f7b3093ec36a584019f33f55010..e310eb540475def6eabd7564b47b0eab55c0ee66 100644 --- a/paddle/capi/Main.cpp +++ b/paddle/capi/Main.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +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. */ + #include #include #include diff --git a/paddle/capi/Matrix.cpp b/paddle/capi/Matrix.cpp index dc1b4f3379d2b078bc365dd56bbaec96efa4856e..db32c945412ecb5f25c20f7539f03550d46be3ed 100644 --- a/paddle/capi/Matrix.cpp +++ b/paddle/capi/Matrix.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +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. */ + #include "PaddleCAPI.h" #include "PaddleCAPIPrivate.h" #include "hl_cuda.h" diff --git a/paddle/capi/PaddleCAPI.h b/paddle/capi/PaddleCAPI.h index b848603e8a345c6adb0d9c3482b7a7fa1aa585a4..8cd78429f34cde1492d4dd7a305c1ee31a07d988 100644 --- a/paddle/capi/PaddleCAPI.h +++ b/paddle/capi/PaddleCAPI.h @@ -1,5 +1,19 @@ -#ifndef __PADDLE_PADDLE_CAPI_PADDLECAPI_H_INCLUDED__ -#define __PADDLE_PADDLE_CAPI_PADDLECAPI_H_INCLUDED__ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +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. */ + +#ifndef PADDLECAPI_H_ +#define PADDLECAPI_H_ #include #include #include "config.h" @@ -79,4 +93,5 @@ int PDInit(int argc, char** argv); #ifdef __cplusplus } #endif -#endif + +#endif // PADDLECAPI_H_ diff --git a/paddle/capi/PaddleCAPIPrivate.h b/paddle/capi/PaddleCAPIPrivate.h index 1aae3cedf384bc788195504f51d92d23802fb61b..bb8baea4e1cd709293947092265819248618e5ce 100644 --- a/paddle/capi/PaddleCAPIPrivate.h +++ b/paddle/capi/PaddleCAPIPrivate.h @@ -1,3 +1,17 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +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. */ + #include "PaddleCAPI.h" #include "paddle/gserver/gradientmachines/GradientMachine.h" #include "paddle/math/Matrix.h" @@ -48,5 +62,5 @@ template inline T* cast(void* ptr) { return reinterpret_cast(ptr); } -} -} +} // namespace capi +} // namespace paddle diff --git a/paddle/capi/Vector.cpp b/paddle/capi/Vector.cpp index 2ac795668ffc9a9d4a461acbba0c4f3c2a2fdb4d..5b4fe0666cbbade3483f9951c8ea08e2931fca6a 100644 --- a/paddle/capi/Vector.cpp +++ b/paddle/capi/Vector.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +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. */ + #include "PaddleCAPI.h" #include "PaddleCAPIPrivate.h" diff --git a/paddle/capi/tests/test_Arguments.cpp b/paddle/capi/tests/test_Arguments.cpp index fe9762deed9b3099e1e4fbf5cfea42420968e155..4a18ffbf47413477ef4bc94af70a1a34e7471bf4 100644 --- a/paddle/capi/tests/test_Arguments.cpp +++ b/paddle/capi/tests/test_Arguments.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +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. */ + #include "PaddleCAPI.h" #include "gtest/gtest.h" #include "paddle/utils/ThreadLocal.h" diff --git a/paddle/capi/tests/test_GradientMachine.cpp b/paddle/capi/tests/test_GradientMachine.cpp index 63fb47bd27be222cf5c4f11841000e6b315d1328..fcade7fb5c9103053a8e4f4a1ec4fd05dc8fc4ce 100644 --- a/paddle/capi/tests/test_GradientMachine.cpp +++ b/paddle/capi/tests/test_GradientMachine.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +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. */ + #include #include #include diff --git a/paddle/capi/tests/test_Matrix.cpp b/paddle/capi/tests/test_Matrix.cpp index 97913f7229f3edc25deb3df303db2ca5f1fa4e18..4192dd6bfb533875a6b946b5170ec2fbf1fbb7e4 100644 --- a/paddle/capi/tests/test_Matrix.cpp +++ b/paddle/capi/tests/test_Matrix.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +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. */ + #include "PaddleCAPI.h" #include "gtest/gtest.h" @@ -21,8 +35,8 @@ TEST(CAPIMatrix, create) { uint64_t height, width; ASSERT_EQ(kPD_NO_ERROR, PDMatGetShape(mat, &height, &width)); - ASSERT_EQ(128, height); - ASSERT_EQ(32, width); + ASSERT_EQ(128UL, height); + ASSERT_EQ(32UL, width); ASSERT_EQ(kPD_NO_ERROR, PDMatDestroy(mat)); } diff --git a/paddle/capi/tests/test_Vector.cpp b/paddle/capi/tests/test_Vector.cpp index 907a63bc9e03d0a3aab0e5510f7b833365c14068..122f7df176d4ca88709acac78fa663fee5be7272 100644 --- a/paddle/capi/tests/test_Vector.cpp +++ b/paddle/capi/tests/test_Vector.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + +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. */ + #include "PaddleCAPI.h" #include "gtest/gtest.h"