NVIDIA / NVIDIA/cccl

[FEA]: pull up thrust::system::detail::bad_alloc

Open
#2,092 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

### Is this a duplicate?

- [X] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cccl/issues) for this request and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)

### Area

Thrust

### Is your feature request related to a problem? Please describe.

I get an error:
```cpp
terminate called after throwing an instance of 'thrust::THRUST_200400_860_NS::system::detail::bad_alloc'
what(): std::bad_alloc: cudaErrorMemoryAllocation: out of memory
```
Currently to catch the exception one have to resort to `detail` namespace in `catch` clause, which is fragile.

### Describe the solution you'd like

Provide `` with type alias in `thrust` namespace.

### Describe alternatives you've considered

To alias `std::bad_alloc` (even better).

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.