提交 d2d012e2 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Make sure to sync a GpuArray before passing it on as a CudaNdarray.

上级 95725506
...@@ -449,6 +449,10 @@ class CudaFromGpu(Op): ...@@ -449,6 +449,10 @@ class CudaFromGpu(Op):
%(fail)s %(fail)s
} }
if (GpuArray_sync(%(inp)s->ga.nd) != GA_NO_ERROR) {
PyErr_SetString(PyExc_RuntimeError, "Could not sync GpuArray");
%(fail)s
}
Py_XDECREF(%(out)s); Py_XDECREF(%(out)s);
%(out)s = (CudaNdarray *)CudaNdarray_new_nd(%(inp)s->ga.nd); %(out)s = (CudaNdarray *)CudaNdarray_new_nd(%(inp)s->ga.nd);
if (!%(out)s) { if (!%(out)s) {
...@@ -468,7 +472,7 @@ class CudaFromGpu(Op): ...@@ -468,7 +472,7 @@ class CudaFromGpu(Op):
'fail': sub['fail']} 'fail': sub['fail']}
def c_code_cache_version(self): def c_code_cache_version(self):
return (1,) return (2,)
cuda_from_gpu = CudaFromGpu() cuda_from_gpu = CudaFromGpu()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论