Skip to content

Commit

Permalink
Fix else-after-throw clang tidy error (#1391)
Browse files Browse the repository at this point in the history
Updates code for `RMM_CUDA_TRY_ALLOC` macro in `detail/error.hpp` to eliminate a clang-tidy error.

Authors:
  - Mark Harris (https://github.com/harrism)

Approvers:
  - Rong Ou (https://github.com/rongou)
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #1391
  • Loading branch information
harrism authored Nov 30, 2023
1 parent da793c5 commit ee3817c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions include/rmm/detail/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,8 @@ class out_of_range : public std::out_of_range {
cudaGetLastError(); \
auto const msg = std::string{"CUDA error at: "} + __FILE__ + ":" + RMM_STRINGIFY(__LINE__) + \
": " + cudaGetErrorName(error) + " " + cudaGetErrorString(error); \
if (cudaErrorMemoryAllocation == error) { \
throw rmm::out_of_memory{msg}; \
} else { \
throw rmm::bad_alloc{msg}; \
} \
if (cudaErrorMemoryAllocation == error) { throw rmm::out_of_memory{msg}; } \
throw rmm::bad_alloc{msg}; \
} \
} while (0)

Expand Down

0 comments on commit ee3817c

Please sign in to comment.