diff --git a/thrust/system/cuda/detail/core/util.h b/thrust/system/cuda/detail/core/util.h index a2c87772e..ea4ed6400 100644 --- a/thrust/system/cuda/detail/core/util.h +++ b/thrust/system/cuda/detail/core/util.h @@ -652,7 +652,10 @@ namespace core { } #define CUDA_CUB_RET_IF_FAIL(e) \ - if (cub::Debug((e), __FILE__, __LINE__)) return e; + { \ + auto const error = (e); \ + if (cub::Debug(error, __FILE__, __LINE__)) return error; \ + } // uninitialized // -------