diff --git a/src/stream_related.cpp b/src/stream_related.cpp index a863685..7fcac3c 100644 --- a/src/stream_related.cpp +++ b/src/stream_related.cpp @@ -3,8 +3,7 @@ namespace safe_cuda { std::variant, cudaError_t> create_stream() noexcept { cudaStream_t stream = nullptr; - const cudaError_t error = cudaStreamCreate(&stream); - if (error != cudaSuccess) { + if (const cudaError_t error = cudaStreamCreate(&stream); error != cudaSuccess) { return error; } return std::unique_ptr{ stream, cudaStreamDestroy };