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

better error msg and comments for gpusoftmax

上级 3e2b3f10
...@@ -405,7 +405,11 @@ class GpuSoftmax (GpuOp): ...@@ -405,7 +405,11 @@ class GpuSoftmax (GpuOp):
cudaError_t err = cudaGetLastError(); cudaError_t err = cudaGetLastError();
if( cudaSuccess != err) if( cudaSuccess != err)
{ {
PyErr_Format(PyExc_RuntimeError, "Cuda error: %%s: %%s.\\n", "kSoftmax_%(nodename)s", cudaGetErrorString(err)); PyErr_Format(PyExc_RuntimeError,
"Cuda error: %%s: %%s.\\n Used %%d blocks,"
" %%d threads %%d bytes of shared memory",
"kSoftmax_%(nodename)s", cudaGetErrorString(err),
n_blocks, n_threads, n_shared_bytes);
%(fail)s; %(fail)s;
} }
} }
......
...@@ -227,8 +227,8 @@ def test_softmax(): ...@@ -227,8 +227,8 @@ def test_softmax():
cuda.nnet.GpuSoftmax) cuda.nnet.GpuSoftmax)
def cmp(n, m, catch=False): def cmp(n, m, catch=False):
"""Some old card won't accet the configuration arguments of """Some old card won't accept the configuration arguments of
this implementation.""" this implementation. For those cases set catch=True to skip those errors."""
try: try:
#print "test_softmax",n,m #print "test_softmax",n,m
data = numpy.arange(n * m, dtype='float32').reshape(n, m) data = numpy.arange(n * m, dtype='float32').reshape(n, m)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论