提交 5b28b2bc authored 作者: João Victor Risso's avatar João Victor Risso

Add extra scope when creating the transformer descriptor in gradient's C implementation

上级 a03754a7
...@@ -4,15 +4,17 @@ cudnnSpatialTransformerDescriptor_t APPLY_SPECIFIC(sptf); ...@@ -4,15 +4,17 @@ cudnnSpatialTransformerDescriptor_t APPLY_SPECIFIC(sptf);
#section init_code_struct #section init_code_struct
cudnnStatus_t APPLY_SPECIFIC(err) = CUDNN_STATUS_SUCCESS;
APPLY_SPECIFIC(sptf) = NULL; APPLY_SPECIFIC(sptf) = NULL;
if ((APPLY_SPECIFIC(err) = cudnnCreateSpatialTransformerDescriptor(&APPLY_SPECIFIC(sptf))) != CUDNN_STATUS_SUCCESS)
{ {
PyErr_Format(PyExc_MemoryError, cudnnStatus_t err = CUDNN_STATUS_SUCCESS;
"GpuDnnTransformerGrid: could not allocate spatial transformer descriptor (sptf): %s", if ((err = cudnnCreateSpatialTransformerDescriptor(&APPLY_SPECIFIC(sptf))) != CUDNN_STATUS_SUCCESS)
cudnnGetErrorString(APPLY_SPECIFIC(err))); {
FAIL; PyErr_Format(PyExc_MemoryError,
"GpuDnnTransformerGrid: could not allocate spatial transformer descriptor (sptf): %s",
cudnnGetErrorString(err));
FAIL;
}
} }
#section cleanup_code_struct #section cleanup_code_struct
......
...@@ -4,15 +4,17 @@ cudnnSpatialTransformerDescriptor_t APPLY_SPECIFIC(sptf); ...@@ -4,15 +4,17 @@ cudnnSpatialTransformerDescriptor_t APPLY_SPECIFIC(sptf);
#section init_code_struct #section init_code_struct
cudnnStatus_t APPLY_SPECIFIC(err) = CUDNN_STATUS_SUCCESS;
APPLY_SPECIFIC(sptf) = NULL; APPLY_SPECIFIC(sptf) = NULL;
if ((APPLY_SPECIFIC(err) = cudnnCreateSpatialTransformerDescriptor(&APPLY_SPECIFIC(sptf))) != CUDNN_STATUS_SUCCESS)
{ {
PyErr_Format(PyExc_MemoryError, cudnnStatus_t err = CUDNN_STATUS_SUCCESS;
"GpuDnnTransformerGradT: could not allocate spatial transformer descriptor (sptf): %s", if ((err = cudnnCreateSpatialTransformerDescriptor(&APPLY_SPECIFIC(sptf))) != CUDNN_STATUS_SUCCESS)
cudnnGetErrorString(APPLY_SPECIFIC(err))); {
FAIL; PyErr_Format(PyExc_MemoryError,
"GpuDnnTransformerGradT: could not allocate spatial transformer descriptor (sptf): %s",
cudnnGetErrorString(err));
FAIL;
}
} }
#section cleanup_code_struct #section cleanup_code_struct
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论