Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
510ccfef
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
510ccfef
编写于
1月 19, 2017
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make Paddle exports the symbols
上级
30a6f9b3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
31 deletion
+40
-31
cmake/flags.cmake
cmake/flags.cmake
+1
-0
paddle/capi/PaddleCAPI.h
paddle/capi/PaddleCAPI.h
+39
-31
未找到文件。
cmake/flags.cmake
浏览文件 @
510ccfef
...
...
@@ -185,3 +185,4 @@ if(CUDA_ARCH)
endif
()
set
(
CUDA_NVCC_FLAGS
${
__arch_flags
}
${
CUDA_NVCC_FLAGS
}
)
paddle/capi/PaddleCAPI.h
浏览文件 @
510ccfef
...
...
@@ -17,6 +17,11 @@ limitations under the License. */
#include <stdbool.h>
#include <stdint.h>
#include "config.h"
// Since we only support linux and macos in compile, always use clang or
// gcc 4.8+. DLL_IMPORT/DLL_EXPORT is as simple as below.
#define PD_API __attribute__((visibility("default")))
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
@@ -44,28 +49,31 @@ typedef enum {
*/
typedef
void
*
PD_IVector
;
int
PDIVecCreateNone
(
PD_IVector
*
ivec
);
PD_API
int
PDIVecCreateNone
(
PD_IVector
*
ivec
);
int
PDIVecDestroy
(
PD_IVector
ivec
);
PD_API
int
PDIVecDestroy
(
PD_IVector
ivec
);
int
PDIVectorGet
(
PD_IVector
ivec
,
int
**
buffer
);
PD_API
int
PDIVectorGet
(
PD_IVector
ivec
,
int
**
buffer
);
/**
* Matrix functions. Return will be a PD_Error type.
*/
typedef
void
*
PD_Matrix
;
int
PDMatCreate
(
PD_Matrix
*
mat
,
uint64_t
height
,
uint64_t
width
,
bool
useGpu
);
PD_API
int
PDMatCreate
(
PD_Matrix
*
mat
,
uint64_t
height
,
uint64_t
width
,
bool
useGpu
);
int
PDMatDestroy
(
PD_Matrix
mat
);
PD_API
int
PDMatDestroy
(
PD_Matrix
mat
);
int
PDMatCopyToRow
(
PD_Matrix
mat
,
uint64_t
rowID
,
pd_real
*
rowArray
);
PD_API
int
PDMatCopyToRow
(
PD_Matrix
mat
,
uint64_t
rowID
,
pd_real
*
rowArray
);
int
PDMatGetRow
(
PD_Matrix
mat
,
uint64_t
rowID
,
pd_real
**
rawRowBuffer
);
PD_API
int
PDMatGetRow
(
PD_Matrix
mat
,
uint64_t
rowID
,
pd_real
**
rawRowBuffer
);
int
PDMatCreateNone
(
PD_Matrix
*
mat
);
PD_API
int
PDMatCreateNone
(
PD_Matrix
*
mat
);
int
PDMatGetShape
(
PD_Matrix
mat
,
uint64_t
*
height
,
uint64_t
*
width
);
PD_API
int
PDMatGetShape
(
PD_Matrix
mat
,
uint64_t
*
height
,
uint64_t
*
width
);
/**
* Arguments functions. Each argument means layer output. Arguments means a
...
...
@@ -73,48 +81,48 @@ int PDMatGetShape(PD_Matrix mat, uint64_t* height, uint64_t* width);
*/
typedef
void
*
PD_Arguments
;
int
PDArgsCreateNone
(
PD_Arguments
*
args
);
PD_API
int
PDArgsCreateNone
(
PD_Arguments
*
args
);
int
PDArgsDestroy
(
PD_Arguments
args
);
PD_API
int
PDArgsDestroy
(
PD_Arguments
args
);
int
PDArgsGetSize
(
PD_Arguments
args
,
uint64_t
*
size
);
PD_API
int
PDArgsGetSize
(
PD_Arguments
args
,
uint64_t
*
size
);
int
PDArgsResize
(
PD_Arguments
args
,
uint64_t
size
);
PD_API
int
PDArgsResize
(
PD_Arguments
args
,
uint64_t
size
);
int
PDArgsSetValue
(
PD_Arguments
args
,
uint64_t
ID
,
PD_Matrix
mat
);
PD_API
int
PDArgsSetValue
(
PD_Arguments
args
,
uint64_t
ID
,
PD_Matrix
mat
);
int
PDArgsGetValue
(
PD_Arguments
args
,
uint64_t
ID
,
PD_Matrix
mat
);
PD_API
int
PDArgsGetValue
(
PD_Arguments
args
,
uint64_t
ID
,
PD_Matrix
mat
);
int
PDArgsGetIds
(
PD_Arguments
args
,
uint64_t
ID
,
PD_IVector
ids
);
PD_API
int
PDArgsGetIds
(
PD_Arguments
args
,
uint64_t
ID
,
PD_IVector
ids
);
/**
* @brief GradientMachine means a neural network.
*/
typedef
void
*
PD_GradientMachine
;
int
PDGradientMachineCreateForPredict
(
PD_GradientMachine
*
machine
,
void
*
modelConfigProtobuf
,
int
size
);
PD_API
int
PDGradientMachineCreateForPredict
(
PD_GradientMachine
*
machine
,
void
*
modelConfigProtobuf
,
int
size
);
int
PDGradientMachineLoadParameterFromDisk
(
PD_GradientMachine
machine
,
const
char
*
path
);
PD_API
int
PDGradientMachineLoadParameterFromDisk
(
PD_GradientMachine
machine
,
const
char
*
path
);
int
PDGradientMachineForward
(
PD_GradientMachine
machine
,
PD_Arguments
inArgs
,
PD_Arguments
outArgs
,
bool
isTrain
);
PD_API
int
PDGradientMachineForward
(
PD_GradientMachine
machine
,
PD_Arguments
inArgs
,
PD_Arguments
outArgs
,
bool
isTrain
);
int
PDGradientMachineCreateSharedParam
(
PD_GradientMachine
origin
,
void
*
modelConfigProtobuf
,
int
size
,
PD_GradientMachine
*
slave
);
PD_API
int
PDGradientMachineCreateSharedParam
(
PD_GradientMachine
origin
,
void
*
modelConfigProtobuf
,
int
size
,
PD_GradientMachine
*
slave
);
int
PDGradientMachineDestroy
(
PD_GradientMachine
machine
);
PD_API
int
PDGradientMachineDestroy
(
PD_GradientMachine
machine
);
/**
* Initialize Paddle.
*/
int
PDInit
(
int
argc
,
char
**
argv
);
PD_API
int
PDInit
(
int
argc
,
char
**
argv
);
#ifdef __cplusplus
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录