Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4d04a47e
提交
4d04a47e
authored
9月 26, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add precheck and more detailed error message.
上级
3bea10b7
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
43 行增加
和
2 行删除
+43
-2
cuda_ndarray.cu
theano/sandbox/cuda/cuda_ndarray.cu
+24
-2
cuda_ndarray.cuh
theano/sandbox/cuda/cuda_ndarray.cuh
+19
-0
没有找到文件。
theano/sandbox/cuda/cuda_ndarray.cu
浏览文件 @
4d04a47e
...
...
@@ -3855,6 +3855,22 @@ int CudaNdarray_gemm(float alpha, const CudaNdarray * A, const CudaNdarray * B,
return
-
1
;
}
#if PRECHECK_ERROR
cublasStatus
prevErr
=
cublasGetError
();
if
(
CUBLAS_STATUS_SUCCESS
!=
prevErr
)
{
//I don't know why, but I need to remove the cuda error too.
//Otherwise, the clean up before raising the Python error cause error too!
//So we don't see this python error.
fprintf
(
stderr
,
"CudaNdarray_sgemm: Prev cublas error %s"
,
cublasGetErrorString
(
prevErr
));
PyErr_Format
(
PyExc_RuntimeError
,
"CudaNdarray_sgemm: Prev cublas error %s"
,
cublasGetErrorString
(
prevErr
));
return
-
1
;
}
#endif
// We must allow dimensions to be zeros.
if
((
CudaNdarray_HOST_DIMS
(
A
)[
1
]
!=
CudaNdarray_HOST_DIMS
(
B
)[
0
])
||
(
CudaNdarray_HOST_DIMS
(
A
)[
0
]
!=
CudaNdarray_HOST_DIMS
(
C
)[
0
])
...
...
@@ -4012,8 +4028,14 @@ int CudaNdarray_gemm(float alpha, const CudaNdarray * A, const CudaNdarray * B,
if
(
CUBLAS_STATUS_SUCCESS
!=
err
)
{
PyErr_Format
(
PyExc_RuntimeError
,
"cublasSgemm failed (%i)"
,
err
);
"cublasSgemm failed (%i) %s
\n
"
" unit=%h N=%d, c.dims=[%d %d], a.dim=[%d %d], alpha=%f, beta=%f, a=%f, b=%f, c=%f"
" sa_0=%d, sa_1=%d, sb_0=%d, sb_1=%d, sc_0=%d, sc_1=%d"
,
err
,
cublasGetErrorString
(
err
),
unit
,
N
,
CudaNdarray_HOST_DIMS
(
C
)[
0
],
CudaNdarray_HOST_DIMS
(
C
)[
1
],
CudaNdarray_HOST_DIMS
(
A
)[
0
],
CudaNdarray_HOST_DIMS
(
A
)[
1
],
alpha
,
beta
,
a
,
b
,
c
,
sa_0
,
sa_1
,
sb_0
,
sb_1
,
sc_0
,
sc_1
);
return
-
1
;
}
return
0
;
...
...
theano/sandbox/cuda/cuda_ndarray.cuh
浏览文件 @
4d04a47e
...
...
@@ -530,6 +530,25 @@ DllExport int CudaNdarray_inplace_elemwise(PyObject* py_self, PyObject * py_othe
DllExport
int
CudaNdarray_prep_output
(
CudaNdarray
**
arr
,
int
nd
,
const
int
*
dims
);
DllExport
const
char
*
cublasGetErrorString
(
cublasStatus
err
){
if
(
CUBLAS_STATUS_SUCCESS
==
err
)
return
"success"
;
else
if
(
CUBLAS_STATUS_NOT_INITIALIZED
==
err
)
return
"the library was not initialized"
;
else
if
(
CUBLAS_STATUS_ALLOC_FAILED
==
err
)
return
"the resource allocation failed"
;
else
if
(
CUBLAS_STATUS_INVALID_VALUE
==
err
)
return
"the parameters n<0 or incx,incy=0"
;
else
if
(
CUBLAS_STATUS_MAPPING_ERROR
==
err
)
return
"an access to GPU memory space failed"
;
else
if
(
CUBLAS_STATUS_EXECUTION_FAILED
==
err
)
return
"the function failed to launch on the GPU"
;
else
if
(
CUBLAS_STATUS_INTERNAL_ERROR
==
err
)
return
"an internal operation failed"
;
else
return
"unknow code"
;
}
#endif
/*
Local Variables:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论