pub unsafe extern "C" fn cudaDeviceReset() -> cudaError_t
Expand description
\brief Destroy all allocations and reset all state on the current device in the current process.
Explicitly destroys and cleans up all resources associated with the current device in the current process. It is the caller’s responsibility to ensure that the resources are not accessed or passed in subsequent API calls and doing so will result in undefined behavior. These resources include CUDA types ::cudaStream_t, ::cudaEvent_t, ::cudaArray_t, ::cudaMipmappedArray_t, ::cudaPitchedPtr, ::cudaTextureObject_t, ::cudaSurfaceObject_t, ::textureReference, ::surfaceReference, ::cudaExternalMemory_t, ::cudaExternalSemaphore_t and ::cudaGraphicsResource_t. These resources also include memory allocations by ::cudaMalloc, ::cudaMallocHost, ::cudaMallocManaged and ::cudaMallocPitch. Any subsequent API call to this device will reinitialize the device.
Note that this function will reset the device immediately. It is the caller’s responsibility to ensure that the device is not being accessed by any other host threads from the process when this function is called.
\note ::cudaDeviceReset() will not destroy memory allocations by ::cudaMallocAsync() and ::cudaMallocFromPoolAsync(). These memory allocations need to be destroyed explicitly. \note If a non-primary ::CUcontext is current to the thread, ::cudaDeviceReset() will destroy only the internal CUDA RT state for that ::CUcontext.
\return ::cudaSuccess \notefnerr \note_init_rt \note_callback
\sa ::cudaDeviceSynchronize