Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
ec92f3fe
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ec92f3fe
编写于
9月 16, 2022
作者:
T
TolyaTalamanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Apply comments
* Rename intersectMapWith -> mergeMapWith * Remove macro * Add r-value ref
上级
eb888316
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
16 deletion
+11
-16
modules/gapi/samples/pipeline_modeling_tool.cpp
modules/gapi/samples/pipeline_modeling_tool.cpp
+9
-5
modules/gapi/samples/pipeline_modeling_tool/utils.hpp
modules/gapi/samples/pipeline_modeling_tool/utils.hpp
+2
-11
未找到文件。
modules/gapi/samples/pipeline_modeling_tool.cpp
浏览文件 @
ec92f3fe
...
@@ -193,7 +193,7 @@ CallParams read<CallParams>(const cv::FileNode& fn) {
...
@@ -193,7 +193,7 @@ CallParams read<CallParams>(const cv::FileNode& fn) {
template
<
typename
V
>
template
<
typename
V
>
std
::
map
<
std
::
string
,
V
>
readMap
(
const
cv
::
FileNode
&
fn
)
{
std
::
map
<
std
::
string
,
V
>
readMap
(
const
cv
::
FileNode
&
fn
)
{
std
::
map
<
std
::
string
,
V
>
map
;
std
::
map
<
std
::
string
,
V
>
map
;
for
(
auto
item
:
fn
)
{
for
(
auto
&&
item
:
fn
)
{
map
.
emplace
(
item
.
name
(),
read
<
V
>
(
item
));
map
.
emplace
(
item
.
name
(),
read
<
V
>
(
item
));
}
}
return
map
;
return
map
;
...
@@ -380,10 +380,14 @@ int main(int argc, char* argv[]) {
...
@@ -380,10 +380,14 @@ int main(int argc, char* argv[]) {
builder
.
addDummy
(
call_params
,
read
<
DummyParams
>
(
node_fn
));
builder
.
addDummy
(
call_params
,
read
<
DummyParams
>
(
node_fn
));
}
else
if
(
node_type
==
"Infer"
)
{
}
else
if
(
node_type
==
"Infer"
)
{
auto
infer_params
=
read
<
InferParams
>
(
node_fn
);
auto
infer_params
=
read
<
InferParams
>
(
node_fn
);
RETHROW_WITH_MSG_IF_FAILED
(
try
{
utils
::
intersectMapWith
(
infer_params
.
config
,
gconfig
),
utils
::
mergeMapWith
(
infer_params
.
config
,
gconfig
);
"Failed to combine global and local configs for Infer node: "
}
catch
(
std
::
exception
&
e
)
{
+
call_params
.
name
);
std
::
stringstream
ss
;
ss
<<
"Failed to merge global and local config for Infer node: "
<<
call_params
.
name
<<
std
::
endl
<<
e
.
what
();
throw
std
::
logic_error
(
ss
.
str
());
}
builder
.
addInfer
(
call_params
,
infer_params
);
builder
.
addInfer
(
call_params
,
infer_params
);
}
else
{
}
else
{
throw
std
::
logic_error
(
"Unsupported node type: "
+
node_type
);
throw
std
::
logic_error
(
"Unsupported node type: "
+
node_type
);
...
...
modules/gapi/samples/pipeline_modeling_tool/utils.hpp
浏览文件 @
ec92f3fe
...
@@ -93,21 +93,12 @@ typename duration_t::rep timestamp() {
...
@@ -93,21 +93,12 @@ typename duration_t::rep timestamp() {
return
duration_cast
<
duration_t
>
(
now
.
time_since_epoch
()).
count
();
return
duration_cast
<
duration_t
>
(
now
.
time_since_epoch
()).
count
();
}
}
#define RETHROW_WITH_MSG_IF_FAILED(expr, msg) \
try { \
expr; \
} catch (const std::exception& e) { \
std::stringstream ss; \
ss << msg << "\n caused by: " << e.what(); \
throw std::logic_error(ss.str()); \
} \
template
<
typename
K
,
typename
V
>
template
<
typename
K
,
typename
V
>
void
intersect
MapWith
(
std
::
map
<
K
,
V
>&
target
,
const
std
::
map
<
K
,
V
>&
second
)
{
void
merge
MapWith
(
std
::
map
<
K
,
V
>&
target
,
const
std
::
map
<
K
,
V
>&
second
)
{
for
(
auto
&&
item
:
second
)
{
for
(
auto
&&
item
:
second
)
{
auto
it
=
target
.
find
(
item
.
first
);
auto
it
=
target
.
find
(
item
.
first
);
if
(
it
!=
target
.
end
())
{
if
(
it
!=
target
.
end
())
{
throw
std
::
logic_error
(
"
Met already existing key: "
+
item
.
first
);
throw
std
::
logic_error
(
"
Error: key: "
+
it
->
first
+
" is already in target map"
);
}
}
target
.
insert
(
item
);
target
.
insert
(
item
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录