提交 64d80b0e authored 作者: Frederic's avatar Frederic

Don't delete the old cublas handle, it cause crashes.

上级 ed6ba0e1
...@@ -3550,18 +3550,19 @@ static int ...@@ -3550,18 +3550,19 @@ static int
cublas_init() cublas_init()
{ {
cublasStatus_t err; cublasStatus_t err;
if (handle != NULL) //The following is causing problems so I comment it.
{ // if (handle != NULL)
err = cublasDestroy(handle); // {
if (CUBLAS_STATUS_SUCCESS != err) // err = cublasDestroy(handle);
{ // if (CUBLAS_STATUS_SUCCESS != err)
PyErr_SetString(PyExc_RuntimeError, // {
"cublas_init tried to destroy the old cublas" // PyErr_SetString(PyExc_RuntimeError,
" context, cublasDestroy() returned an error."); // "cublas_init tried to destroy the old cublas"
return -1; // " context, cublasDestroy() returned an error.");
} // return -1;
handle = NULL; // }
} // handle = NULL;
// }
err = cublasCreate(&handle); err = cublasCreate(&handle);
if (CUBLAS_STATUS_SUCCESS != err) if (CUBLAS_STATUS_SUCCESS != err)
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论