mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-20 19:12:24 +00:00
[TensorRT EP] Fix memory leak for cudnn/cublas (#18467)
Free memory for cudnn/cublas instances at TRT EP destruction. https://github.com/microsoft/onnxruntime/issues/18466
This commit is contained in:
parent
b291b20fa0
commit
3588fbac13
1 changed files with 5 additions and 0 deletions
|
|
@ -1194,6 +1194,11 @@ TensorrtExecutionProvider::~TensorrtExecutionProvider() {
|
|||
}
|
||||
}
|
||||
|
||||
if (external_stream_) {
|
||||
ORT_IGNORE_RETURN_VALUE(CUBLAS_CALL(cublasDestroy(external_cublas_handle_)));
|
||||
ORT_IGNORE_RETURN_VALUE(CUDNN_CALL(cudnnDestroy(external_cudnn_handle_)));
|
||||
}
|
||||
|
||||
if (!external_stream_ && stream_) {
|
||||
ORT_IGNORE_RETURN_VALUE(CUDA_CALL(cudaStreamDestroy(stream_)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue