oneMKL icon indicating copy to clipboard operation
oneMKL copied to clipboard

Every `CUDA_ERROR_FUNC` could allow a memory leak

Open hdelan opened this issue 2 years ago • 0 comments

If CUDA_ERROR_FUNC, CUSOLVER_ERROR_FUNC etc is called and the result != CUDA_SUCCESS, a cuda_error will be thrown and any allocated pointers will not be deallocated, causing a memory leak.

We should replace each *_ERROR_FUNC with ERROR_FUNC_WITH_POINTERS_TO_DEALLOCATE or something like that. This would also provide a list of pointers to deallocate in the event that the operation does not return CUDA_SUCCESS, preventing memory leaks.

Ping @Alexander-Kleymenov

hdelan avatar Feb 01 '23 17:02 hdelan