There are various questions regarding the proper use of cudaDeviceReset() , but I could not find the answer to the following question.
The cudaDeviceReset() document says that it is explicitly destroys and cleans up all resources associated with the current device in the current process .
Suppose I have a program with many arrays, all allocated using cudaMalloc . Can I use cudaDeviceReset instead of many cudaFree at the end of my program to quickly free all memory on the device? Are there any flaws in this?
source share