提交 b4818d54 authored 作者: Frederic's avatar Frederic

More information in the error message.

上级 055c4104
...@@ -3028,11 +3028,14 @@ CudaNdarray_ptr_int_size(PyObject* _unused, PyObject* args) ...@@ -3028,11 +3028,14 @@ CudaNdarray_ptr_int_size(PyObject* _unused, PyObject* args)
return NULL; return NULL;
} }
get_gpu_ptr_size<<<1,1>>>(gpu_data); get_gpu_ptr_size<<<1,1>>>(gpu_data);
if (cudaSuccess != cudaGetLastError()){
cudaError_t cudaErr = cudaGetLastError();
if (cudaSuccess != cudaErr){
device_free(gpu_data); device_free(gpu_data);
return PyErr_Format(PyExc_RuntimeError, return PyErr_Format(PyExc_RuntimeError,
"CudaNdarray_ptr_int_size: error when calling the gpu code."); "CudaNdarray_ptr_int_size: error when calling the gpu code. (%s)",
cudaGetErrorString(cudaErr));
} }
// Transfer the result to cpu // Transfer the result to cpu
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论