Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
b7d9d5e0
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看板
提交
b7d9d5e0
编写于
8月 21, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
8月 21, 2020
浏览文件
操作
浏览文件
下载
差异文件
!4928 revert gpu buffer
Merge pull request !4928 from qianlong21st/revert_gpu_queue
上级
6f7678f6
113619f1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
2 addition
and
51 deletion
+2
-51
mindspore/ccsrc/runtime/device/gpu/blocking_queue.cc
mindspore/ccsrc/runtime/device/gpu/blocking_queue.cc
+0
-2
mindspore/ccsrc/runtime/device/gpu/blocking_queue.h
mindspore/ccsrc/runtime/device/gpu/blocking_queue.h
+2
-7
mindspore/ccsrc/runtime/device/gpu/gpu_buffer_mgr.cc
mindspore/ccsrc/runtime/device/gpu/gpu_buffer_mgr.cc
+0
-34
mindspore/ccsrc/runtime/device/gpu/gpu_buffer_mgr.h
mindspore/ccsrc/runtime/device/gpu/gpu_buffer_mgr.h
+0
-8
未找到文件。
mindspore/ccsrc/runtime/device/gpu/blocking_queue.cc
浏览文件 @
b7d9d5e0
...
...
@@ -52,7 +52,6 @@ BlockQueueStatus_T GpuQueue::Push(const std::vector<DataItemGpu> &data) {
CHECK_CUDA_RET_WITH_ERROR
(
cudaEventCreate
(
&
(
*
(
node_info_
[
tail_
].
event_
))),
"Cuda Create Event Failed"
);
node_info_
[
tail_
].
data_
=
data
;
tail_
=
(
tail_
+
1
)
%
(
capacity_
);
++
size_
;
return
SUCCESS
;
}
...
...
@@ -70,7 +69,6 @@ BlockQueueStatus_T GpuQueue::Front(void **addr, size_t *len) const {
BlockQueueStatus_T
GpuQueue
::
Pop
()
{
head_
=
(
head_
+
1
)
%
(
capacity_
);
--
size_
;
return
SUCCESS
;
}
...
...
mindspore/ccsrc/runtime/device/gpu/blocking_queue.h
浏览文件 @
b7d9d5e0
...
...
@@ -44,15 +44,13 @@ class GpuQueue {
void
RegisterRelease
(
const
std
::
function
<
void
(
void
*
)
>
&
func
)
{
host_release_
=
func
;
}
inline
bool
IsEmpty
()
const
{
return
size_
==
0
;
}
inline
bool
IsFull
()
const
{
return
size_
==
capacity_
;
}
inline
bool
IsEmpty
()
const
{
return
head_
==
tail_
;
}
inline
bool
IsFull
()
const
{
return
head_
==
((
tail_
+
1
)
%
(
capacity_
))
;
}
BlockQueueStatus_T
Push
(
const
std
::
vector
<
DataItemGpu
>
&
data
);
BlockQueueStatus_T
Front
(
void
**
ptr
,
size_t
*
len
)
const
;
BlockQueueStatus_T
Pop
();
bool
Destroy
();
size_t
Size
()
{
return
size_
;
}
size_t
Capacity
()
{
return
capacity_
;
}
private:
struct
NodeInfo
{
...
...
@@ -65,7 +63,6 @@ class GpuQueue {
size_t
tail_
;
std
::
vector
<
size_t
>
shape_
;
size_t
len_
;
size_t
size_
;
size_t
capacity_
;
cudaStream_t
stream_
;
std
::
unique_ptr
<
NodeInfo
[]
>
node_info_
;
...
...
@@ -86,8 +83,6 @@ class BlockingQueue {
BlockQueueStatus_T
Front
(
void
**
ptr
,
size_t
*
len
);
BlockQueueStatus_T
Pop
();
bool
Destroy
();
size_t
Size
()
{
return
queue_
->
Size
();
}
size_t
Capacity
()
{
return
queue_
->
Capacity
();
}
private:
std
::
mutex
mutex_
;
...
...
mindspore/ccsrc/runtime/device/gpu/gpu_buffer_mgr.cc
浏览文件 @
b7d9d5e0
...
...
@@ -187,39 +187,5 @@ bool GpuBufferMgr::CloseNotify() {
}
void
GpuBufferMgr
::
CloseConfirm
()
{
sema
.
Signal
();
}
size_t
GpuBufferMgr
::
Size
(
unsigned
int
handle
)
{
if
(
handle
==
HandleMgr
::
INVALID_HANDLE
)
{
MS_LOG
(
ERROR
)
<<
"handle is invalid"
;
return
0
;
}
return
handle_queue_map_
.
at
(
handle
)
->
Size
();
}
size_t
GpuBufferMgr
::
Size
(
unsigned
int
device_id
,
const
std
::
string
&
channel_name
)
{
std
::
string
name
=
std
::
to_string
(
device_id
)
+
std
::
string
(
"_"
)
+
channel_name
;
if
(
!
name_queue_map_
.
count
(
name
))
{
MS_LOG
(
ERROR
)
<<
"Queue not exist "
<<
name
;
return
0
;
}
return
name_queue_map_
.
at
(
name
)
->
Size
();
}
size_t
GpuBufferMgr
::
Capacity
(
unsigned
int
handle
)
{
if
(
handle
==
HandleMgr
::
INVALID_HANDLE
)
{
MS_LOG
(
ERROR
)
<<
"handle is invalid"
;
return
0
;
}
return
handle_queue_map_
.
at
(
handle
)
->
Capacity
();
}
size_t
GpuBufferMgr
::
Capacity
(
unsigned
int
device_id
,
const
std
::
string
&
channel_name
)
{
std
::
string
name
=
std
::
to_string
(
device_id
)
+
std
::
string
(
"_"
)
+
channel_name
;
if
(
!
name_queue_map_
.
count
(
name
))
{
MS_LOG
(
ERROR
)
<<
"Queue not exist "
<<
name
;
return
0
;
}
return
name_queue_map_
.
at
(
name
)
->
Capacity
();
}
}
// namespace device
}
// namespace mindspore
mindspore/ccsrc/runtime/device/gpu/gpu_buffer_mgr.h
浏览文件 @
b7d9d5e0
...
...
@@ -111,14 +111,6 @@ class GpuBufferMgr {
// call for dataset send thread
EXPORT
void
CloseConfirm
();
EXPORT
size_t
Size
(
unsigned
int
handle
);
EXPORT
size_t
Size
(
unsigned
int
device_id
,
const
std
::
string
&
channel_name
);
EXPORT
size_t
Capacity
(
unsigned
int
handle
);
EXPORT
size_t
Capacity
(
unsigned
int
device_id
,
const
std
::
string
&
channel_name
);
private:
void
set_device
()
const
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录