提交 1616cc1c authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Return an exception status when there is an error in cublas_init() or cublas_shutdown().

上级 7b64c272
...@@ -3092,7 +3092,8 @@ CudaNdarray_gpu_init(PyObject* _unused, PyObject* args) ...@@ -3092,7 +3092,8 @@ CudaNdarray_gpu_init(PyObject* _unused, PyObject* args)
// Initialize cublas // Initialize cublas
if (handle != NULL) if (handle != NULL)
cublas_shutdown(); if (cublas_shutdown() == -1)
return NULL;
if(card_number_provided) { if(card_number_provided) {
err = cudaSetDevice(card_nb); err = cudaSetDevice(card_nb);
...@@ -3104,7 +3105,8 @@ CudaNdarray_gpu_init(PyObject* _unused, PyObject* args) ...@@ -3104,7 +3105,8 @@ CudaNdarray_gpu_init(PyObject* _unused, PyObject* args)
} }
} }
cublas_init(); if (cublas_init() == -1)
return NULL;
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论