提交 42fcb226 authored 作者: Nicolas Ballas's avatar Nicolas Ballas

Add PyDecref(cols) when an error occurs

上级 09b1f19c
...@@ -294,6 +294,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom, ...@@ -294,6 +294,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorrMM() documentation.\n", "GpuCorrMM() documentation.\n",
cudaGetErrorString(err)); cudaGetErrorString(err));
Py_DECREF(col);
return NULL; return NULL;
} }
// Second, gemm // Second, gemm
...@@ -311,6 +312,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom, ...@@ -311,6 +312,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorrMM() documentation.\n", "GpuCorrMM() documentation.\n",
cublasGetErrorString(status)); cublasGetErrorString(status));
Py_DECREF(col);
return NULL; return NULL;
} }
} }
...@@ -359,6 +361,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom, ...@@ -359,6 +361,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorrMM() documentation.\n", "GpuCorrMM() documentation.\n",
cudaGetErrorString(err)); cudaGetErrorString(err));
Py_DECREF(col);
return NULL; return NULL;
} }
// Second, gemm // Second, gemm
...@@ -379,6 +382,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom, ...@@ -379,6 +382,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorrMM() documentation.\n", "GpuCorrMM() documentation.\n",
cublasGetErrorString(status)); cublasGetErrorString(status));
Py_DECREF(col);
return NULL; return NULL;
} }
} }
...@@ -429,6 +433,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom, ...@@ -429,6 +433,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorrMM() documentation.\n", "GpuCorrMM() documentation.\n",
cublasGetErrorString(status)); cublasGetErrorString(status));
Py_DECREF(col);
return NULL; return NULL;
} }
// col2im back to the data // col2im back to the data
...@@ -441,6 +446,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom, ...@@ -441,6 +446,7 @@ CudaNdarray* corrMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorrMM() documentation.\n", "GpuCorrMM() documentation.\n",
cudaGetErrorString(err)); cudaGetErrorString(err));
Py_DECREF(col);
return NULL; return NULL;
} }
} }
......
...@@ -356,6 +356,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom, ...@@ -356,6 +356,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorr3dMM() documentation.\n", "GpuCorr3dMM() documentation.\n",
cudaGetErrorString(err)); cudaGetErrorString(err));
Py_DECREF(col);
return 0; return 0;
} }
// Second, gemm // Second, gemm
...@@ -374,6 +375,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom, ...@@ -374,6 +375,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorr3dMM() documentation.\n", "GpuCorr3dMM() documentation.\n",
cublasGetErrorString(status)); cublasGetErrorString(status));
Py_DECREF(col);
return 0; return 0;
} }
} }
...@@ -401,6 +403,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom, ...@@ -401,6 +403,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorr3dMM() documentation.\n", "GpuCorr3dMM() documentation.\n",
cudaGetErrorString(err)); cudaGetErrorString(err));
Py_DECREF(col);
return 0; return 0;
} }
// Second, gemm // Second, gemm
...@@ -422,6 +425,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom, ...@@ -422,6 +425,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorr3dMM() documentation.\n", "GpuCorr3dMM() documentation.\n",
cublasGetErrorString(status)); cublasGetErrorString(status));
Py_DECREF(col);
return 0; return 0;
} }
} }
...@@ -450,6 +454,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom, ...@@ -450,6 +454,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorr3dMM() documentation.\n", "GpuCorr3dMM() documentation.\n",
cublasGetErrorString(status)); cublasGetErrorString(status));
Py_DECREF(col);
return 0; return 0;
} }
// col2im3d back to the data // col2im3d back to the data
...@@ -466,6 +471,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom, ...@@ -466,6 +471,7 @@ CudaNdarray* corr3dMM(CudaNdarray *const bottom,
"This could be a known bug in CUDA, please see the " "This could be a known bug in CUDA, please see the "
"GpuCorr3dMM() documentation.\n", "GpuCorr3dMM() documentation.\n",
cudaGetErrorString(err)); cudaGetErrorString(err));
Py_DECREF(col);
return 0; return 0;
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论