Evaluate CUDA_CUB_RET_IF_FAIL macro argument only once
MODIFY
thrust/system/cuda/detail/core/util.h
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;
+ do { \
+ auto const error = (e); \
+ if (cub::Debug(error, __FILE__, __LINE__)) return error; \
+ } while(0);
// uninitialized
// -------

Evaluate CUDA_CUB_RET_IF_FAIL macro argument only once