Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Proper bulking of ops not using FCompute #15272

Merged
merged 2 commits into from
Jun 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/imperative/imperative_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ inline void PushFComputeEx(const FComputeEx& fn,
InvalidateOutputs(outputs, req);
#endif
fn(attrs, opctx, inputs, req, outputs);
if (ctx.dev_mask() == gpu::kDevMask && exec_type == ExecType::kSync) {
if (ctx.dev_mask() == gpu::kDevMask && exec_type == ExecType::kSync && !rctx.is_bulk) {
rctx.get_stream<gpu>()->Wait();
}
};
Expand Down Expand Up @@ -512,7 +512,7 @@ inline void PushOperator(const OpStatePtr& state,
#endif
fcompute_ex(state, opctx, inputs, req, outputs);
if (ctx.dev_mask() == gpu::kDevMask && exec_type == ExecType::kSync
&& rctx.get_stream<gpu>()) {
&& rctx.get_stream<gpu>() && !rctx.is_bulk) {
rctx.get_stream<gpu>()->Wait();
}
};
Expand Down Expand Up @@ -562,7 +562,7 @@ inline void PushOperator(const OpStatePtr& state,
// post-fcompute fallback, cast to original storage type, if necessary
CastNonDefaultStorage(post_temp_src, post_temp_dst, opctx, is_gpu);
if (is_gpu && exec_type == ExecType::kSync
&& rctx.get_stream<gpu>()) {
&& rctx.get_stream<gpu>() && !rctx.is_bulk) {
rctx.get_stream<gpu>()->Wait();
}
};
Expand Down