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

Print the input shape of GpuCAReduce when there is an error.

上级 d61c929b
......@@ -782,6 +782,10 @@ class GpuCAReduce(GpuOp):
print >> sio, """
,CudaNdarray_HOST_STRIDES(%(z)s)[%(i)s]
""" % locals()
shapes_format = "shape=(%s)" % ",".join(["%d"] * node.inputs[0].ndim)
shapes_data = ",".join(["CudaNdarray_HOST_DIMS(%(x)s)[%(i)s]" % locals()
for i in range(node.inputs[0].ndim)])
print >> sio, """
);
CNDA_THREAD_SYNC;
......@@ -790,14 +794,16 @@ class GpuCAReduce(GpuOp):
{
PyErr_Format(PyExc_RuntimeError,
"Cuda error: %%s: %%s."
" (grid: %%i x %%i; block: %%i x %%i x %%i)\\n",
" (grid: %%i x %%i; block: %%i x %%i x %%i)"
" %(shapes_format)s \\n",
"kernel_reduce_%(pattern)s_%(name)s",
cudaGetErrorString(sts),
n_blocks.x,
n_blocks.y,
n_threads.x,
n_threads.y,
n_threads.z);
n_threads.z,
%(shapes_data)s);
%(fail)s;
}
""" % locals()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论