Skip to content

Commit

Permalink
Correct init order of status.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhemstad committed Sep 25, 2019
1 parent 9f08dbd commit 5346f04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/rmm/device_scalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ class device_scalar {
*---------------------------------------------------------------------------**/
T value() const {
T host_value{};
status = cudaMemcpyAsync(&host_value, buff.data(), sizeof(T),
auto status = cudaMemcpyAsync(&host_value, buff.data(), sizeof(T),
cudaMemcpyDefault, buff.stream());
if (cudaSuccess != status) {
throw std::runtime_error{"Device memcpy failed."};
}
auto status = cudaStreamSynchronize(buff.stream());
status = cudaStreamSynchronize(buff.stream());
if (cudaSuccess != status) {
throw std::runtime_error{"Stream sync failed."};
}
Expand Down

0 comments on commit 5346f04

Please sign in to comment.