-
Notifications
You must be signed in to change notification settings - Fork 299
Open
Labels
bugSomething isn't working right.Something isn't working right.
Description
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Something else
Component
libcu++
Describe the bug
I noticed that cuda::__cccl_allocation_stream holds a static-lifetime cuda::stream
inline ::cuda::stream_ref __cccl_allocation_stream()
{
static ::cuda::stream __stream{device_ref{0}};
return __stream;
}
The dtor (and hence cuStreamDestroy) will run below main. But, quoth the documentation
The CUDA interfaces use global state that is initialized during host program initiation and destroyed during host program termination. The CUDA runtime and driver cannot detect if this state is invalid, so using any of these interfaces (implicitly or explicitly) during program initiation or termination after main) will result in undefined behavior.
oops.
How to Reproduce
n/a
Expected behavior
No UB.
Reproduction link
No response
Operating System
No response
nvidia-smi output
No response
NVCC version
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't working right.Something isn't working right.
Type
Projects
Status
Todo