Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
453aab61
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
453aab61
编写于
6月 18, 2020
作者:
D
dengwentao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code check
上级
373832d0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
2 deletion
+20
-2
mindspore/ccsrc/kernel/rts/recv.cc
mindspore/ccsrc/kernel/rts/recv.cc
+3
-0
mindspore/ccsrc/kernel/rts/send.cc
mindspore/ccsrc/kernel/rts/send.cc
+3
-0
mindspore/ccsrc/kernel/rts/stream_active.cc
mindspore/ccsrc/kernel/rts/stream_active.cc
+3
-0
mindspore/ccsrc/kernel/rts/stream_switch.cc
mindspore/ccsrc/kernel/rts/stream_switch.cc
+11
-2
未找到文件。
mindspore/ccsrc/kernel/rts/recv.cc
浏览文件 @
453aab61
...
...
@@ -37,6 +37,9 @@ bool RecvKernel::Init(const AnfNodePtr &anf_node) {
MS_EXCEPTION_IF_NULL
(
anf_node
);
auto
primitive
=
AnfAlgo
::
GetCNodePrimitive
(
anf_node
);
MS_EXCEPTION_IF_NULL
(
primitive
);
if
(
!
AnfAlgo
::
HasNodeAttr
(
kAttrEventId
,
anf_node
->
cast
<
CNodePtr
>
()))
{
MS_LOG
(
EXCEPTION
)
<<
"RecvKernel has no attr kAttrEventId"
;
}
event_id_
=
GetValue
<
uint32_t
>
(
primitive
->
GetAttr
(
kAttrEventId
));
MS_LOG
(
INFO
)
<<
"recv op event_id_:"
<<
event_id_
;
return
true
;
...
...
mindspore/ccsrc/kernel/rts/send.cc
浏览文件 @
453aab61
...
...
@@ -34,6 +34,9 @@ bool SendKernel::Init(const AnfNodePtr &anf_node) {
MS_EXCEPTION_IF_NULL
(
anf_node
);
auto
primitive
=
AnfAlgo
::
GetCNodePrimitive
(
anf_node
);
MS_EXCEPTION_IF_NULL
(
primitive
);
if
(
!
AnfAlgo
::
HasNodeAttr
(
kAttrEventId
,
anf_node
->
cast
<
CNodePtr
>
()))
{
MS_LOG
(
EXCEPTION
)
<<
"SendKernel has no attr kAttrEventId"
;
}
event_id_
=
GetValue
<
uint32_t
>
(
primitive
->
GetAttr
(
kAttrEventId
));
MS_LOG
(
INFO
)
<<
"send op event id:"
<<
event_id_
;
return
true
;
...
...
mindspore/ccsrc/kernel/rts/stream_active.cc
浏览文件 @
453aab61
...
...
@@ -36,6 +36,9 @@ bool StreamActiveKernel::Init(const AnfNodePtr &anf_node) {
MS_LOG
(
INFO
)
<<
"stream active op init start"
;
auto
primitive
=
AnfAlgo
::
GetCNodePrimitive
(
anf_node
);
MS_EXCEPTION_IF_NULL
(
primitive
);
if
(
!
AnfAlgo
::
HasNodeAttr
(
kAttrActiveStreamList
,
anf_node
->
cast
<
CNodePtr
>
()))
{
MS_LOG
(
EXCEPTION
)
<<
"StreamActiveKernel has no attr kAttrActiveStreamList"
;
}
active_streams_index_
=
GetValue
<
std
::
vector
<
uint32_t
>>
(
primitive
->
GetAttr
(
kAttrActiveStreamList
));
return
true
;
}
...
...
mindspore/ccsrc/kernel/rts/stream_switch.cc
浏览文件 @
453aab61
...
...
@@ -42,8 +42,17 @@ bool StreamSwitchKernel::Init(const AnfNodePtr &anf_node) {
MS_LOG
(
INFO
)
<<
"stream switch op init start"
;
auto
primitive
=
AnfAlgo
::
GetCNodePrimitive
(
anf_node
);
MS_EXCEPTION_IF_NULL
(
primitive
);
if
(
!
AnfAlgo
::
HasNodeAttr
(
kAttrSwitchCondition
,
anf_node
->
cast
<
CNodePtr
>
()))
{
MS_LOG
(
EXCEPTION
)
<<
"StreamSwitchKernel has no attr kAttrSwitchCondition"
;
}
cond_
=
tagRtCondition
(
GetValue
<
int
>
(
primitive
->
GetAttr
(
kAttrSwitchCondition
)));
if
(
!
AnfAlgo
::
HasNodeAttr
(
kAttrTrueBranchStream
,
anf_node
->
cast
<
CNodePtr
>
()))
{
MS_LOG
(
EXCEPTION
)
<<
"StreamSwitchKernel has no attr kAttrTrueBranchStream"
;
}
true_stream_index_
=
GetValue
<
uint32_t
>
(
primitive
->
GetAttr
(
kAttrTrueBranchStream
));
if
(
!
AnfAlgo
::
HasNodeAttr
(
kAttrDataType
,
anf_node
->
cast
<
CNodePtr
>
()))
{
MS_LOG
(
EXCEPTION
)
<<
"StreamSwitchKernel has no attr kAttrDataType"
;
}
data_type_
=
tagRtSwitchDataType
(
GetValue
<
int
>
(
primitive
->
GetAttr
(
kAttrDataType
)));
MS_LOG
(
INFO
)
<<
"cond_:"
<<
static_cast
<
int
>
(
cond_
)
<<
", true_stream_index_:"
<<
true_stream_index_
<<
", data_type_:"
<<
static_cast
<
int
>
(
data_type_
);
...
...
@@ -54,7 +63,7 @@ bool StreamSwitchKernel::Launch(const std::vector<AddressPtr> &inputs, const std
const
std
::
vector
<
AddressPtr
>
&
outputs
,
void
*
stream_ptr
)
{
MS_LOG
(
INFO
)
<<
"stream switch op launch start"
;
if
(
inputs
.
size
()
!=
2
)
{
MS_LOG
(
E
RROR
)
<<
"Stream switch inputs size is "
<<
inputs
.
size
()
<<
", only support 2"
;
MS_LOG
(
E
XCEPTION
)
<<
"Stream switch inputs size is "
<<
inputs
.
size
()
<<
", only support 2"
;
}
void
*
loop_cnt
=
inputs
[
0
]
->
addr
;
...
...
@@ -73,7 +82,7 @@ std::vector<TaskInfoPtr> StreamSwitchKernel::GenTask(const std::vector<AddressPt
uint32_t
stream_id
)
{
MS_LOG
(
INFO
)
<<
"StreamSwitchKernel GenTask start"
;
if
(
inputs
.
size
()
!=
2
)
{
MS_LOG
(
E
RROR
)
<<
"stream switch inputs size is "
<<
inputs
.
size
()
<<
", is not two"
;
MS_LOG
(
E
XCEPTION
)
<<
"stream switch inputs size is "
<<
inputs
.
size
()
<<
", is not two"
;
}
stream_id_
=
stream_id
;
MS_EXCEPTION_IF_NULL
(
inputs
[
0
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录