NVIDIA / NVIDIA/cccl

Add `cuda::std::abort` for uniform, heterogeneous program termination

Open
#1,007 0 comments 2 reactions 1 assignee Claimed by @miscco View on GitHub
libcu++
Dominant language
C++
Stars
2.5k
Forks
487
Avg merge
2d 7h
Merged PRs (30d)
296

Description

As an author of CUDA C++ code, I often need to handle erroneous code paths. Oftentimes I'm not concerned with "proper" error handling and I just want crash the program without regard for anything else.

A variety of ways exist to do this in host code, but my options are more limited in device code.

The usual best practice in device code is [`__trap()` ](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#miscellaneous-instructions-trap). Note: this will corrupt the CUDA context and require restarting the process.

It would be nice to have an implementation of `cuda::std::abort` that handles calling `__trap()` when in device code and aborting in the usual way in host code.

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.