关于正确使用 有各种问题cudaDeviceReset(),但我无法找到以下问题的答案。
上的文档cudaDeviceReset()说它explicitly destroys and cleans up all resources associated with the current device in the current process。
假设我有一个包含许多数组的程序,所有数组都分配有cudaMalloc. 我可以在程序末尾使用cudaDeviceReset许多语句来快速释放设备上的所有内存吗?cudaFree这样做有什么缺点吗?