Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
ac85c41f
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
185
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ac85c41f
编写于
3月 28, 2019
作者:
W
wangguibao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix pdcodegen
上级
d7040167
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
30 deletion
+32
-30
pdcodegen/src/pdcodegen.cpp
pdcodegen/src/pdcodegen.cpp
+32
-30
未找到文件。
pdcodegen/src/pdcodegen.cpp
浏览文件 @
ac85c41f
...
@@ -95,38 +95,40 @@ class PdsCodeGenerator : public CodeGenerator {
...
@@ -95,38 +95,40 @@ class PdsCodeGenerator : public CodeGenerator {
const
string
body
=
strip_proto
(
file
->
name
())
+
".pb.cc"
;
const
string
body
=
strip_proto
(
file
->
name
())
+
".pb.cc"
;
bool
include_inserted
=
false
;
bool
include_inserted
=
false
;
for
(
int
i
=
0
;
i
<
file
->
service_count
();
++
i
)
{
for
(
int
i
=
0
;
i
<
file
->
service_count
();
++
i
)
{
const
ServiceDescriptor
*
descriptor
=
file
->
service
(
i
);
const
ServiceDescriptor
*
descriptor
=
file
->
service
(
i
);
if
(
!
descriptor
)
{
if
(
!
descriptor
)
{
*
error
=
"get descriptor failed"
;
*
error
=
"get descriptor failed"
;
return
false
;
return
false
;
}
pds
::
PaddleServiceOption
options
=
descriptor
->
options
().
GetExtension
(
pds
::
options
);
bool
generate_impl
=
options
.
generate_impl
();
bool
generate_stub
=
options
.
generate_stub
();
if
(
!
generate_impl
&&
!
generate_stub
)
{
return
true
;
}
if
(
!
include_inserted
)
{
boost
::
scoped_ptr
<
google
::
protobuf
::
io
::
ZeroCopyOutputStream
>
output
(
context
->
OpenForInsert
(
header
,
"includes"
));
google
::
protobuf
::
io
::
Printer
printer
(
output
.
get
(),
'$'
);
if
(
generate_impl
)
{
printer
.
Print
(
"#include
\"
predictor/common/inner_common.h
\"\n
"
);
printer
.
Print
(
"#include
\"
predictor/framework/service.h
\"\n
"
);
printer
.
Print
(
"#include
\"
predictor/framework/manager.h
\"\n
"
);
printer
.
Print
(
"#include
\"
predictor/framework/service_manager.h
\"\n
"
);
}
}
if
(
generate_stub
)
{
pds
::
PaddleServiceOption
options
=
printer
.
Print
(
"#include <baidu/rpc/parallel_channel.h>
\n
"
);
descriptor
->
options
().
GetExtension
(
pds
::
options
);
printer
.
Print
(
"#include
\"
sdk-cpp/include/factory.h
\"\n
"
);
bool
generate_impl
=
options
.
generate_impl
();
printer
.
Print
(
"#include
\"
sdk-cpp/include/stub.h
\"\n
"
);
bool
generate_stub
=
options
.
generate_stub
();
printer
.
Print
(
"#include
\"
sdk-cpp/include/stub_impl.h
\"\n
"
);
if
(
!
generate_impl
&&
!
generate_stub
)
{
return
true
;
}
}
include_inserted
=
true
;
}
if
(
!
include_inserted
)
{
const
std
::
string
&
class_name
=
descriptor
->
name
();
boost
::
scoped_ptr
<
google
::
protobuf
::
io
::
ZeroCopyOutputStream
>
output
(
const
std
::
string
&
service_name
=
descriptor
->
name
();
context
->
OpenForInsert
(
header
,
"includes"
));
google
::
protobuf
::
io
::
Printer
printer
(
output
.
get
(),
'$'
);
if
(
generate_impl
)
{
printer
.
Print
(
"#include
\"
predictor/common/inner_common.h
\"\n
"
);
printer
.
Print
(
"#include
\"
predictor/framework/service.h
\"\n
"
);
printer
.
Print
(
"#include
\"
predictor/framework/manager.h
\"\n
"
);
printer
.
Print
(
"#include
\"
predictor/framework/service_manager.h
\"\n
"
);
}
if
(
generate_stub
)
{
printer
.
Print
(
"#include <baidu/rpc/parallel_channel.h>
\n
"
);
printer
.
Print
(
"#include
\"
sdk-cpp/include/factory.h
\"\n
"
);
printer
.
Print
(
"#include
\"
sdk-cpp/include/stub.h
\"\n
"
);
printer
.
Print
(
"#include
\"
sdk-cpp/include/stub_impl.h
\"\n
"
);
}
include_inserted
=
true
;
}
const
std
::
string
&
class_name
=
descriptor
->
name
();
const
std
::
string
&
service_name
=
descriptor
->
name
();
// xxx.ph.h
// xxx.ph.h
{
{
if
(
generate_impl
)
{
if
(
generate_impl
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录