does cudaThreadExit() clean up the memory allocated by cudaMalloc()

Hi guys, the reference manual only lists that cudaThreadExit() “explicitly cleans up all runtime-related resources associated with the calling host thread”, so i am wondering whether cudaThreadExit() implicitly cleans up the memory allocated by cudaMalloc()?

Hi guys, the reference manual only lists that cudaThreadExit() “explicitly cleans up all runtime-related resources associated with the calling host thread”, so i am wondering whether cudaThreadExit() implicitly cleans up the memory allocated by cudaMalloc()?

I would expect it to free up all memory on the GPU - after all, the GPU memory is managed by the host, so if the driver context goes bye-bye, then all record that the GPU memory is in use goes as well. However, relying on the driver to tidy up your messes might not be considered best practice.

I would expect it to free up all memory on the GPU - after all, the GPU memory is managed by the host, so if the driver context goes bye-bye, then all record that the GPU memory is in use goes as well. However, relying on the driver to tidy up your messes might not be considered best practice.

Thanks for replying.

Thanks for replying.