Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
c93ca648
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
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看板
提交
c93ca648
编写于
3月 28, 2019
作者:
W
wangguibao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix pdcodegen
上级
ac85c41f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
32 deletion
+30
-32
pdcodegen/src/pdcodegen.cpp
pdcodegen/src/pdcodegen.cpp
+30
-32
未找到文件。
pdcodegen/src/pdcodegen.cpp
浏览文件 @
c93ca648
...
@@ -95,40 +95,38 @@ class PdsCodeGenerator : public CodeGenerator {
...
@@ -95,40 +95,38 @@ 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
=
pds
::
PaddleServiceOption
options
=
descriptor
->
options
().
GetExtension
(
pds
::
options
);
descriptor
->
options
().
GetExtension
(
pds
::
options
);
bool
generate_impl
=
options
.
generate_impl
();
bool
generate_impl
=
options
.
generate_impl
();
bool
generate_stub
=
options
.
generate_stub
();
bool
generate_stub
=
options
.
generate_stub
();
if
(
!
generate_impl
&&
!
generate_stub
)
{
if
(
!
generate_impl
&&
!
generate_stub
)
{
return
true
;
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
)
{
if
(
!
include_inserted
)
{
printer
.
Print
(
"#include <baidu/rpc/parallel_channel.h>
\n
"
);
boost
::
scoped_ptr
<
google
::
protobuf
::
io
::
ZeroCopyOutputStream
>
output
(
printer
.
Print
(
"#include
\"
sdk-cpp/include/factory.h
\"\n
"
);
context
->
OpenForInsert
(
header
,
"includes"
));
printer
.
Print
(
"#include
\"
sdk-cpp/include/stub.h
\"\n
"
);
google
::
protobuf
::
io
::
Printer
printer
(
output
.
get
(),
'$'
);
printer
.
Print
(
"#include
\"
sdk-cpp/include/stub_impl.h
\"\n
"
);
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
;
}
}
include_inserted
=
true
;
const
std
::
string
&
class_name
=
descriptor
->
name
();
}
const
std
::
string
&
service_name
=
descriptor
->
name
();
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录