Skip to content

Commit

Permalink
fix: #45 UB in copy async
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavnokoman committed Jan 17, 2020
1 parent 39e9076 commit f4208dc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/include/vuh/arr/copy_async.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,8 @@ namespace vuh {
return Delayed<Copy>{array.device(), Copy::wrap(detail::Noop{})};
} else { // copy first to staging buffer and then async copy from staging buffer to device
auto stage = detail::CopyStageFromHost<T>(array.device(), src_begin, src_end);
return Delayed<Copy>{
stage.copy_async(device_begin(stage.array), device_end(stage.array), dst_begin)
, Copy::wrap(std::move(stage))
};
auto cpy = stage.copy_async(device_begin(stage.array), device_end(stage.array), dst_begin);
return Delayed<Copy>{std::move(cpy), Copy::wrap(std::move(stage))};
}
}

Expand Down

0 comments on commit f4208dc

Please sign in to comment.