Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
8db64303
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
403
Star
4705
Fork
582
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8db64303
编写于
8月 23, 2023
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(src/atlas): fixed no event resource when call aclrtRecordEvent function of atlas
GitOrigin-RevId: d688ba6b249678f13f723e16eafc260aeae1c79b
上级
c515ee1c
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
21 addition
and
2 deletion
+21
-2
src/core/impl/comp_node/atlas/comp_node.cpp
src/core/impl/comp_node/atlas/comp_node.cpp
+20
-1
src/opr/impl/atlas_runtime_op.cpp
src/opr/impl/atlas_runtime_op.cpp
+1
-1
未找到文件。
src/core/impl/comp_node/atlas/comp_node.cpp
浏览文件 @
8db64303
...
@@ -286,6 +286,7 @@ class AtlasCompNode::EventImpl final : public EventImplHelper {
...
@@ -286,6 +286,7 @@ class AtlasCompNode::EventImpl final : public EventImplHelper {
AtlasCompNodeImpl
*
const
m_comp_node_impl
;
AtlasCompNodeImpl
*
const
m_comp_node_impl
;
aclrtEvent
m_atlas_event
;
aclrtEvent
m_atlas_event
;
bool
m_init_finished
=
false
;
bool
m_init_finished
=
false
;
bool
m_used_for_sync
=
false
;
void
do_record
()
override
{
void
do_record
()
override
{
m_comp_node_impl
->
activate
();
m_comp_node_impl
->
activate
();
...
@@ -306,6 +307,10 @@ class AtlasCompNode::EventImpl final : public EventImplHelper {
...
@@ -306,6 +307,10 @@ class AtlasCompNode::EventImpl final : public EventImplHelper {
void
host_wait_cv
()
override
{
void
host_wait_cv
()
override
{
MGB_ATLAS_CHECK
(
aclrtSynchronizeEvent
(
m_atlas_event
));
MGB_ATLAS_CHECK
(
aclrtSynchronizeEvent
(
m_atlas_event
));
if
(
m_used_for_sync
)
{
MGB_ATLAS_CHECK
(
aclrtResetEvent
(
m_atlas_event
,
m_comp_node_impl
->
m_env
.
atlas_env
().
stream
));
}
}
}
double
do_elapsed_time_until
(
EventImplHelper
&
end
)
override
{
double
do_elapsed_time_until
(
EventImplHelper
&
end
)
override
{
...
@@ -322,8 +327,14 @@ public:
...
@@ -322,8 +327,14 @@ public:
EventImpl
(
AtlasCompNodeImpl
*
comp_node_impl
,
size_t
create_flags
)
EventImpl
(
AtlasCompNodeImpl
*
comp_node_impl
,
size_t
create_flags
)
:
EventImplHelper
(
comp_node_impl
,
create_flags
),
:
EventImplHelper
(
comp_node_impl
,
create_flags
),
m_comp_node_impl
{
comp_node_impl
}
{
m_comp_node_impl
{
comp_node_impl
}
{
m_used_for_sync
=
!
(
m_create_flags
&
NEED_TIMER
);
m_comp_node_impl
->
activate
();
m_comp_node_impl
->
activate
();
if
(
m_used_for_sync
)
{
MGB_ATLAS_CHECK
(
aclrtCreateEvent
(
&
m_atlas_event
));
MGB_ATLAS_CHECK
(
aclrtCreateEvent
(
&
m_atlas_event
));
}
else
{
MGB_ATLAS_CHECK
(
aclrtCreateEventWithFlag
(
&
m_atlas_event
,
ACL_EVENT_TIME_LINE
));
}
m_init_finished
=
true
;
m_init_finished
=
true
;
}
}
~
EventImpl
()
{
~
EventImpl
()
{
...
@@ -346,11 +357,19 @@ void AtlasCompNode::EventImpl::do_device_wait_by(Impl* cn_impl) {
...
@@ -346,11 +357,19 @@ void AtlasCompNode::EventImpl::do_device_wait_by(Impl* cn_impl) {
auto
stream
=
imp
->
m_env
.
atlas_env
().
stream
;
auto
stream
=
imp
->
m_env
.
atlas_env
().
stream
;
imp
->
activate
();
imp
->
activate
();
MGB_ATLAS_CHECK
(
aclrtStreamWaitEvent
(
stream
,
m_atlas_event
));
MGB_ATLAS_CHECK
(
aclrtStreamWaitEvent
(
stream
,
m_atlas_event
));
if
(
m_used_for_sync
)
{
MGB_ATLAS_CHECK
(
aclrtResetEvent
(
m_atlas_event
,
m_comp_node_impl
->
m_env
.
atlas_env
().
stream
));
}
return
;
return
;
}
}
if
(
cn_impl
->
env
().
property
().
type
==
DeviceType
::
CPU
)
{
if
(
cn_impl
->
env
().
property
().
type
==
DeviceType
::
CPU
)
{
auto
waiter
=
[
this
]()
{
auto
waiter
=
[
this
]()
{
MGB_ATLAS_CHECK
(
aclrtSynchronizeEvent
(
m_atlas_event
));
MGB_ATLAS_CHECK
(
aclrtSynchronizeEvent
(
m_atlas_event
));
if
(
m_used_for_sync
)
{
MGB_ATLAS_CHECK
(
aclrtResetEvent
(
m_atlas_event
,
m_comp_node_impl
->
m_env
.
atlas_env
().
stream
));
}
};
};
cn_impl
->
add_callback
(
std
::
move
(
waiter
));
cn_impl
->
add_callback
(
std
::
move
(
waiter
));
return
;
return
;
...
...
src/opr/impl/atlas_runtime_op.cpp
浏览文件 @
8db64303
...
@@ -192,7 +192,7 @@ AtlasRuntimeOpr::AtlasRuntimeOpr(
...
@@ -192,7 +192,7 @@ AtlasRuntimeOpr::AtlasRuntimeOpr(
MGB_ATLAS_CHECK
(
aclmdlSetConfigOpt
(
MGB_ATLAS_CHECK
(
aclmdlSetConfigOpt
(
config_handle
,
ACL_MDL_MEM_SIZET
,
&
mdl_mem_size
,
sizeof
(
size_t
)));
config_handle
,
ACL_MDL_MEM_SIZET
,
&
mdl_mem_size
,
sizeof
(
size_t
)));
size_t
mem_optimize_mode
=
1
;
size_t
mem_optimize_mode
=
true
;
MGB_ATLAS_CHECK
(
aclmdlSetConfigOpt
(
MGB_ATLAS_CHECK
(
aclmdlSetConfigOpt
(
config_handle
,
ACL_MDL_WORKSPACE_MEM_OPTIMIZE
,
&
mem_optimize_mode
,
config_handle
,
ACL_MDL_WORKSPACE_MEM_OPTIMIZE
,
&
mem_optimize_mode
,
sizeof
(
size_t
)));
sizeof
(
size_t
)));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录