Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/caffe/layers/cudnn_conv_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void CuDNNConvolutionLayer<Dtype>::Reshape(
workspaceSizeInBytes = total_max_workspace;

// free the existing workspace and allocate a new (larger) one
cudaFree(this->workspaceData);
CUDA_CHECK(cudaFree(this->workspaceData));

cudaError_t err = cudaMalloc(&(this->workspaceData), workspaceSizeInBytes);
if (err != cudaSuccess) {
Expand Down Expand Up @@ -251,7 +251,7 @@ CuDNNConvolutionLayer<Dtype>::~CuDNNConvolutionLayer() {
cudnnDestroy(handle_[g]);
}

cudaFree(workspaceData);
CUDA_CHECK(cudaFree(workspaceData));
delete [] workspace;
delete [] stream_;
delete [] handle_;
Expand Down
4 changes: 2 additions & 2 deletions src/caffe/layers/cudnn_deconv_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ void CuDNNDeconvolutionLayer<Dtype>::Reshape(
workspaceSizeInBytes = total_max_workspace;

// free the existing workspace and allocate a new (larger) one
cudaFree(this->workspaceData);
CUDA_CHECK(cudaFree(this->workspaceData));

cudaError_t err = cudaMalloc(&(this->workspaceData), workspaceSizeInBytes);
if (err != cudaSuccess) {
Expand Down Expand Up @@ -309,7 +309,7 @@ CuDNNDeconvolutionLayer<Dtype>::~CuDNNDeconvolutionLayer() {
cudnnDestroy(handle_[g]);
}

cudaFree(workspaceData);
CUDA_CHECK(cudaFree(workspaceData));
delete [] workspace;
delete [] stream_;
delete [] handle_;
Expand Down
8 changes: 4 additions & 4 deletions src/caffe/layers/cudnn_lcn_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ void CuDNNLCNLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom,
if (totalSizeInBytes > tempDataSize) {
tempDataSize = totalSizeInBytes;

cudaFree(tempData1);
cudaFree(tempData2);
CUDA_CHECK(cudaFree(tempData1));
CUDA_CHECK(cudaFree(tempData2));

// allocate new buffers
CUDA_CHECK(cudaMalloc(&tempData1, totalSizeInBytes));
Expand All @@ -63,8 +63,8 @@ CuDNNLCNLayer<Dtype>::~CuDNNLCNLayer() {
cudnnDestroy(handle_);

// free temp buffers
cudaFree(tempData1);
cudaFree(tempData2);
CUDA_CHECK(cudaFree(tempData1));
CUDA_CHECK(cudaFree(tempData2));
}

INSTANTIATE_CLASS(CuDNNLCNLayer);
Expand Down