Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
873368f8
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
873368f8
编写于
1月 10, 2017
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add style check to target
上级
657d2040
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
165 addition
and
9 deletion
+165
-9
paddle/capi/Arguments.cpp
paddle/capi/Arguments.cpp
+14
-0
paddle/capi/CMakeLists.txt
paddle/capi/CMakeLists.txt
+2
-0
paddle/capi/GradientMachine.cpp
paddle/capi/GradientMachine.cpp
+15
-2
paddle/capi/Main.cpp
paddle/capi/Main.cpp
+14
-0
paddle/capi/Matrix.cpp
paddle/capi/Matrix.cpp
+14
-0
paddle/capi/PaddleCAPI.h
paddle/capi/PaddleCAPI.h
+18
-3
paddle/capi/PaddleCAPIPrivate.h
paddle/capi/PaddleCAPIPrivate.h
+16
-2
paddle/capi/Vector.cpp
paddle/capi/Vector.cpp
+14
-0
paddle/capi/tests/test_Arguments.cpp
paddle/capi/tests/test_Arguments.cpp
+14
-0
paddle/capi/tests/test_GradientMachine.cpp
paddle/capi/tests/test_GradientMachine.cpp
+14
-0
paddle/capi/tests/test_Matrix.cpp
paddle/capi/tests/test_Matrix.cpp
+16
-2
paddle/capi/tests/test_Vector.cpp
paddle/capi/tests/test_Vector.cpp
+14
-0
未找到文件。
paddle/capi/Arguments.cpp
浏览文件 @
873368f8
/* 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"
...
...
paddle/capi/CMakeLists.txt
浏览文件 @
873368f8
...
...
@@ -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
...
...
paddle/capi/GradientMachine.cpp
浏览文件 @
873368f8
/* 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
);
...
...
paddle/capi/Main.cpp
浏览文件 @
873368f8
/* 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 <fenv.h>
#include <stdlib.h>
#include <string.h>
...
...
paddle/capi/Matrix.cpp
浏览文件 @
873368f8
/* 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"
...
...
paddle/capi/PaddleCAPI.h
浏览文件 @
873368f8
#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 <stdbool.h>
#include <stdint.h>
#include "config.h"
...
...
@@ -79,4 +93,5 @@ int PDInit(int argc, char** argv);
#ifdef __cplusplus
}
#endif
#endif
#endif // PADDLECAPI_H_
paddle/capi/PaddleCAPIPrivate.h
浏览文件 @
873368f8
/* 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 <typename T>
inline
T
*
cast
(
void
*
ptr
)
{
return
reinterpret_cast
<
T
*>
(
ptr
);
}
}
}
}
// namespace capi
}
// namespace paddle
paddle/capi/Vector.cpp
浏览文件 @
873368f8
/* 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"
...
...
paddle/capi/tests/test_Arguments.cpp
浏览文件 @
873368f8
/* 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"
...
...
paddle/capi/tests/test_GradientMachine.cpp
浏览文件 @
873368f8
/* 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 <gtest/gtest.h>
#include <paddle/gserver/gradientmachines/GradientMachine.h>
#include <paddle/trainer/TrainerConfigHelper.h>
...
...
paddle/capi/tests/test_Matrix.cpp
浏览文件 @
873368f8
/* 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
(
128
UL
,
height
);
ASSERT_EQ
(
32
UL
,
width
);
ASSERT_EQ
(
kPD_NO_ERROR
,
PDMatDestroy
(
mat
));
}
...
...
paddle/capi/tests/test_Vector.cpp
浏览文件 @
873368f8
/* 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"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录