Closed CostantinoGrana closed 2 years ago
The function cuDNN_environment_initialization
in _gpuconv.cu allocates several arrays which (I guess) should be deleted:
cudnnConvolutionFwdAlgoPerf_t * perfResults = new cudnnConvolutionFwdAlgoPerf_t [requestedAlgoCount];
...
cudnnConvolutionBwdFilterAlgoPerf_t * perfResultsbwf = new cudnnConvolutionBwdFilterAlgoPerf_t [requestedAlgoCount];
...
cudnnConvolutionBwdDataAlgoPerf_t * perfResults_d = new cudnnConvolutionBwdDataAlgoPerf_t [requestedAlgoCount];
We have checked and memory is ok.
These lines:
gpuD=new Tensor(vector
Create a tensor object that will share the memory created in other place but I need to encapsulate that memory also in a Tensor object (struct). So I create the tensor object I will need (main attributes) but delete the memory created in this new Tensor
Snets are freed
regarding CudNN not sure, I didn't write that part (yes unbelievable :) )
Thanks
So, the memory to which gpuI
points is not freed, but it's only a small container which doesn't point to any memory, right?
In the Net
destructor happens the same, because the content of each snet[i]
is deleted, but the snet[i]
is not. Why not deleting snets[i]
?
First
In
ConvolDescriptor::build(Tensor *A)
I see this piece of code, which is pretty hard for me to understand:because I couldn't get the meaning of the
gpu_delete_tensor()
function. What instead I'm pretty sure is missing is the correspondingdelete
for the Tensor objects thus allocated with new. The destructor seems not to delete them.Second
I believe that the destructor of
Net
is missing thedelete
of the single nets in thesnets
vector. Maybe this can be fixed with adelete snets[i];
at line 183.