message: cuda_check_maybe_redo: check final return value
diff: @@ -77,14 +77,17 @@ struct StringHasher {
  };
  #define cuda_check_maybe_redo(expr) \
  + /* scoped */ { \
  + cudaError_t rv; \
  for (int i = 0; i < 2; ++i) { \
  - cudaError_t rv = expr; \
  - if (rv == cudaErrorMemoryAllocation) { \
  + rv = expr; \
  + if (rv == cudaErrorMemoryAllocation && i == 0) { \
  cuda_malloc_trim(); \
  } else { \
  cuda_check(rv); \
  break; \
  } \
  + } \
  }
  