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

Commit

Permalink
Proper bulking of ops not using FCompute (#15272)
Browse files Browse the repository at this point in the history
* Less syncs

* Trigger CI
  • Loading branch information
ptrendx authored and DickJC123 committed Jun 20, 2019
1 parent 2de0db0 commit c45d23b
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit c45d23b

Please sign in to comment.