Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
0023c3bc
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0023c3bc
编写于
3月 19, 2018
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use atomic bool
上级
09935ab9
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
15 addition
and
5 deletion
+15
-5
paddle/fluid/framework/parallel_executor.cc
paddle/fluid/framework/parallel_executor.cc
+3
-3
paddle/fluid/framework/parallel_executor.h
paddle/fluid/framework/parallel_executor.h
+3
-2
paddle/fluid/platform/profiler_test.cc
paddle/fluid/platform/profiler_test.cc
+9
-0
未找到文件。
paddle/fluid/framework/parallel_executor.cc
浏览文件 @
0023c3bc
...
@@ -633,7 +633,7 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
...
@@ -633,7 +633,7 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
auto
fetched_data
=
std
::
make_shared
<
FetchedData
>
(
fetch_tensors
.
size
());
auto
fetched_data
=
std
::
make_shared
<
FetchedData
>
(
fetch_tensors
.
size
());
// Version --> VarHandle
// Version --> VarHandle
member_
->
exception_
.
reset
();
member_
->
exception_
.
reset
();
std
::
unordered_map
<
VarHandleBase
*
,
bool
>
pending_vars
;
std
::
unordered_map
<
VarHandleBase
*
,
std
::
atomic
<
bool
>
>
pending_vars
;
std
::
unordered_map
<
OpHandle
*
,
size_t
>
pending_ops
;
std
::
unordered_map
<
OpHandle
*
,
size_t
>
pending_ops
;
for
(
auto
&
place_pair
:
member_
->
vars_
)
{
for
(
auto
&
place_pair
:
member_
->
vars_
)
{
...
@@ -737,9 +737,9 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
...
@@ -737,9 +737,9 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
}
}
void
ParallelExecutor
::
RunOp
(
void
ParallelExecutor
::
RunOp
(
std
::
unordered_map
<
VarHandleBase
*
,
bool
>
&
pending_vars
,
std
::
unordered_map
<
VarHandleBase
*
,
std
::
atomic
<
bool
>
>
&
pending_vars
,
OpHandle
*
op
)
const
{
OpHandle
*
op
)
const
{
std
::
vector
<
bool
*>
ready_buffer
;
std
::
vector
<
std
::
atomic
<
bool
>
*>
ready_buffer
;
for
(
auto
*
var
:
op
->
outputs_
)
{
for
(
auto
*
var
:
op
->
outputs_
)
{
ready_buffer
.
emplace_back
(
&
pending_vars
[
var
]);
ready_buffer
.
emplace_back
(
&
pending_vars
[
var
]);
}
}
...
...
paddle/fluid/framework/parallel_executor.h
浏览文件 @
0023c3bc
...
@@ -60,7 +60,8 @@ class ParallelExecutor {
...
@@ -60,7 +60,8 @@ class ParallelExecutor {
void
BuildNCCLCommunicator
()
const
;
void
BuildNCCLCommunicator
()
const
;
void
RunOp
(
std
::
unordered_map
<
VarHandleBase
*
,
bool
>&
pending_vars
,
void
RunOp
(
std
::
unordered_map
<
VarHandleBase
*
,
std
::
atomic
<
bool
>>&
pending_vars
,
OpHandle
*
op
)
const
;
OpHandle
*
op
)
const
;
void
PolishGraphToSupportDataHarzaeds
()
const
;
void
PolishGraphToSupportDataHarzaeds
()
const
;
...
...
paddle/fluid/platform/profiler_test.cc
浏览文件 @
0023c3bc
...
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
...
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#include "paddle/fluid/platform/profiler.h"
#include "paddle/fluid/platform/profiler.h"
#include "cuda_runtime.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
TEST
(
Event
,
CpuElapsedTime
)
{
TEST
(
Event
,
CpuElapsedTime
)
{
...
@@ -157,3 +158,11 @@ TEST(RecordEvent, RecordEvent) {
...
@@ -157,3 +158,11 @@ TEST(RecordEvent, RecordEvent) {
// Will remove parsing-related code from test later
// Will remove parsing-related code from test later
DisableProfiler
(
EventSortingKey
::
kTotal
,
"/tmp/profiler"
);
DisableProfiler
(
EventSortingKey
::
kTotal
,
"/tmp/profiler"
);
}
}
TEST
(
TMP
,
stream_wait
)
{
cudaStream_t
stream
;
cudaStreamCreate
(
&
stream
);
cudaStreamSynchronize
(
stream
);
cudaStreamSynchronize
(
stream
);
cudaStreamSynchronize
(
stream
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录