From cd242939b246b6c81cc1327b5360db0e505c6519 Mon Sep 17 00:00:00 2001 From: Julio Machado Silva Date: Tue, 18 Jun 2024 16:29:57 -0600 Subject: [PATCH] Minimal changes --- clients/common/containers/d_vector.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clients/common/containers/d_vector.hpp b/clients/common/containers/d_vector.hpp index 1598685c7..50f84ccd2 100644 --- a/clients/common/containers/d_vector.hpp +++ b/clients/common/containers/d_vector.hpp @@ -61,19 +61,19 @@ class d_vector T* device_vector_setup() { - T* d = nullptr; + T* d; if((hipMalloc)(&d, bytes) != hipSuccess) { fmt::print(stderr, "Error allocating {} bytes ({} GB)\n", bytes, bytes >> 30); d = nullptr; } - /* CHECK_HIP_ERROR((hipMemset)(d, 0, bytes)); // Why this doesn't work? */ - if(d != nullptr) + else { - auto error = (hipMemset)(d, 0, bytes); - if(error != hipSuccess) + auto status = (hipMemset)(d, 0, bytes); + /* CHECK_HIP_ERROR(status); // Why this doesn't work? */ + if(status != hipSuccess) { - fmt::print(stderr, "error: {} ({}) at {}:{}\n", hipGetErrorString(error), error, + fmt::print(stderr, "error: {} ({}) at {}:{}\n", hipGetErrorString(status), status, __FILE__, __LINE__); rocblas_abort(); }