Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
0ebf739f
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0ebf739f
编写于
3月 29, 2023
作者:
Z
zhangbo9674
提交者:
GitHub
3月 29, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Fix_Linux_[-Wterminate]warning (#52186)"
This reverts commit
225f1af2
.
上级
225f1af2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
33 deletion
+18
-33
paddle/fluid/memory/allocation/cuda_device_context_allocator.h
...e/fluid/memory/allocation/cuda_device_context_allocator.h
+8
-15
paddle/fluid/memory/allocation/mmap_allocator.cc
paddle/fluid/memory/allocation/mmap_allocator.cc
+10
-17
paddle/fluid/memory/allocation/mmap_allocator_test.cc
paddle/fluid/memory/allocation/mmap_allocator_test.cc
+0
-1
未找到文件。
paddle/fluid/memory/allocation/cuda_device_context_allocator.h
浏览文件 @
0ebf739f
...
...
@@ -44,13 +44,10 @@ class GPUContextAllocation : public Allocation {
underlying_allocation_
(
std
::
move
(
allocation
))
{}
~
GPUContextAllocation
()
{
try
{
PADDLE_ENFORCE_NOT_NULL
(
dev_ctx_
,
platform
::
errors
::
PreconditionNotMet
(
"Device context is not set for GPUContextAllocation"
));
}
catch
(
std
::
exception
&
e
)
{
}
PADDLE_ENFORCE_NOT_NULL
(
dev_ctx_
,
platform
::
errors
::
PreconditionNotMet
(
"Device context is not set for GPUContextAllocation"
));
auto
*
p_allocation
=
underlying_allocation_
.
release
();
VLOG
(
4
)
<<
"Adding callback to delete GPUContextAllocation at "
<<
p_allocation
;
...
...
@@ -89,17 +86,13 @@ class GPUContextAllocator : public Allocator {
}
~
GPUContextAllocator
()
{
try
{
if
(
event_
)
{
platform
::
CUDADeviceGuard
guard
(
place_
.
device
);
if
(
event_
)
{
platform
::
CUDADeviceGuard
guard
(
place_
.
device
);
#ifdef PADDLE_WITH_HIP
PADDLE_ENFORCE_GPU_SUCCESS
(
hipEventDestroy
(
event_
));
PADDLE_ENFORCE_GPU_SUCCESS
(
hipEventDestroy
(
event_
));
#else
PADDLE_ENFORCE_GPU_SUCCESS
(
cudaEventDestroy
(
event_
));
PADDLE_ENFORCE_GPU_SUCCESS
(
cudaEventDestroy
(
event_
));
#endif
}
}
catch
(
std
::
exception
&
e
)
{
}
}
...
...
paddle/fluid/memory/allocation/mmap_allocator.cc
浏览文件 @
0ebf739f
...
...
@@ -216,26 +216,19 @@ void RefcountedMemoryMapAllocation::close() {
}
MemoryMapWriterAllocation
::~
MemoryMapWriterAllocation
()
{
try
{
PADDLE_ENFORCE_NE
(
munmap
(
this
->
ptr
(),
this
->
size
()),
-
1
,
platform
::
errors
::
Unavailable
(
"could not unmap the shared memory file %s"
,
this
->
ipc_name
()));
}
catch
(
std
::
exception
&
e
)
{
}
PADDLE_ENFORCE_NE
(
munmap
(
this
->
ptr
(),
this
->
size
()),
-
1
,
platform
::
errors
::
Unavailable
(
"could not unmap the shared memory file %s"
,
this
->
ipc_name
()));
}
MemoryMapReaderAllocation
::~
MemoryMapReaderAllocation
()
{
try
{
PADDLE_ENFORCE_NE
(
munmap
(
this
->
ptr
(),
this
->
size
()),
-
1
,
platform
::
errors
::
Unavailable
(
"could not unmap the shared memory file %s"
,
this
->
ipc_name
()));
}
catch
(
std
::
exception
&
e
)
{
}
PADDLE_ENFORCE_NE
(
munmap
(
this
->
ptr
(),
this
->
size
()),
-
1
,
platform
::
errors
::
Unavailable
(
"could not unmap the shared memory file %s"
,
this
->
ipc_name
()));
/* Here we do not pay attention to the result of shm_unlink,
because the memory mapped file may have been cleared due to the
MemoryMapFdSet::Clear() */
...
...
paddle/fluid/memory/allocation/mmap_allocator_test.cc
浏览文件 @
0ebf739f
...
...
@@ -24,7 +24,6 @@ namespace allocation {
TEST
(
MemoryMapAllocation
,
test_allocation_base
)
{
size_t
data_size
=
4UL
*
1024
;
// 1. allocate writer holader
auto
mmap_writer_holder
=
AllocateMemoryMapWriterAllocation
(
data_size
);
std
::
string
ipc_name
=
mmap_writer_holder
->
ipc_name
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录