提交 d49c6274 编写于 作者: Y Yu Yang

GNU Style API

上级 58e5b878
...@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "PaddleCAPIPrivate.h"
#include "arguments.h" #include "arguments.h"
#include "capi_private.h"
using paddle::capi::cast; using paddle::capi::cast;
......
...@@ -13,7 +13,7 @@ configure_file(config.h.in config.h @ONLY) ...@@ -13,7 +13,7 @@ configure_file(config.h.in config.h @ONLY)
# PaddleCAPI.h is the only header we exposed. It currently only used for model # PaddleCAPI.h is the only header we exposed. It currently only used for model
# inference. # inference.
file(GLOB CAPI_HEADERS *.h) file(GLOB CAPI_HEADERS *.h)
set(CAPI_PRIVATE_HEADER PaddleCAPIPrivate.h) set(CAPI_PRIVATE_HEADER capi_private.h)
list(REMOVE_ITEM CAPI_HEADERS ${CAPI_PRIVATE_HEADER}) list(REMOVE_ITEM CAPI_HEADERS ${CAPI_PRIVATE_HEADER})
file(GLOB CAPI_SOURCES *.cpp) file(GLOB CAPI_SOURCES *.cpp)
...@@ -59,7 +59,7 @@ link_paddle_exe(paddle_capi_shared) ...@@ -59,7 +59,7 @@ link_paddle_exe(paddle_capi_shared)
# install library & headers. # install library & headers.
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${capi_whole_library} DESTINATION lib) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${capi_whole_library} DESTINATION lib)
install(FILES ${CAPI_HEADER} DESTINATION include/paddle) install(FILES ${CAPI_HEADERS} DESTINATION include/paddle)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION include/paddle) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION include/paddle)
install(TARGETS paddle_capi_shared DESTINATION lib) install(TARGETS paddle_capi_shared DESTINATION lib)
......
...@@ -16,8 +16,8 @@ limitations under the License. */ ...@@ -16,8 +16,8 @@ limitations under the License. */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <vector> #include <vector>
#include "PaddleCAPI.h" #include "capi_private.h"
#include "PaddleCAPIPrivate.h" #include "main.h"
#include "paddle/trainer/TrainerConfigHelper.h" #include "paddle/trainer/TrainerConfigHelper.h"
#include "paddle/utils/Excepts.h" #include "paddle/utils/Excepts.h"
#include "paddle/utils/PythonUtil.h" #include "paddle/utils/PythonUtil.h"
......
...@@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "PaddleCAPI.h" #include "capi_private.h"
#include "PaddleCAPIPrivate.h"
#include "hl_cuda.h" #include "hl_cuda.h"
#include "matrix.h"
#define cast(v) paddle::capi::cast<paddle::capi::CMatrix>(v) #define cast(v) paddle::capi::cast<paddle::capi::CMatrix>(v)
extern "C" { extern "C" {
......
...@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "PaddleCAPI.h" #include "capi_private.h"
#include "PaddleCAPIPrivate.h" #include "vector.h"
using paddle::capi::cast; using paddle::capi::cast;
......
...@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#ifndef PADDLECAPI_H_ #ifndef __PADDLE_CAPI_H__
#define PADDLECAPI_H_ #define __PADDLE_CAPI_H__
/** /**
* Paddle C API. It will replace SWIG as Multiple Language API for model * Paddle C API. It will replace SWIG as Multiple Language API for model
......
...@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "PaddleCAPI.h" #include "capi.h"
#include "paddle/gserver/gradientmachines/GradientMachine.h" #include "paddle/gserver/gradientmachines/GradientMachine.h"
#include "paddle/math/Matrix.h" #include "paddle/math/Matrix.h"
#include "paddle/math/Vector.h" #include "paddle/math/Vector.h"
......
...@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "PaddleCAPI.h" #include "gradient_machine.h"
#include "PaddleCAPIPrivate.h" #include "capi_private.h"
#include "paddle/gserver/gradientmachines/NeuralNetwork.h" #include "paddle/gserver/gradientmachines/NeuralNetwork.h"
#define cast(v) paddle::capi::cast<paddle::capi::CGradientMachine>(v) #define cast(v) paddle::capi::cast<paddle::capi::CGradientMachine>(v)
......
...@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and ...@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include <functional> #include <functional>
#include "PaddleCAPI.h" #include "capi.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "paddle/utils/ThreadLocal.h" #include "paddle/utils/ThreadLocal.h"
......
...@@ -18,7 +18,7 @@ limitations under the License. */ ...@@ -18,7 +18,7 @@ limitations under the License. */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <type_traits> #include <type_traits>
#include "PaddleCAPI.h" #include "capi.h"
#include "paddle/utils/ThreadLocal.h" #include "paddle/utils/ThreadLocal.h"
static std::vector<pd_real> randomBuffer(size_t bufSize) { static std::vector<pd_real> randomBuffer(size_t bufSize) {
......
...@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "PaddleCAPI.h" #include "capi.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
TEST(CAPIMatrix, create) { TEST(CAPIMatrix, create) {
......
...@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "PaddleCAPI.h" #include "capi.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
TEST(CAPIVector, create) { TEST(CAPIVector, create) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册