Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
404c1676
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
404c1676
编写于
1月 07, 2021
作者:
W
WeiXin
提交者:
GitHub
1月 07, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add detailed error message for curandStatus_t, cublasStatus_t, cusolverStatus_t (#30161)
上级
91a8a257
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
64 addition
and
29 deletion
+64
-29
paddle/fluid/platform/enforce.h
paddle/fluid/platform/enforce.h
+64
-29
未找到文件。
paddle/fluid/platform/enforce.h
浏览文件 @
404c1676
...
@@ -755,31 +755,37 @@ inline bool is_error(curandStatus_t stat) {
...
@@ -755,31 +755,37 @@ inline bool is_error(curandStatus_t stat) {
inline
const
char
*
curandGetErrorString
(
curandStatus_t
stat
)
{
inline
const
char
*
curandGetErrorString
(
curandStatus_t
stat
)
{
switch
(
stat
)
{
switch
(
stat
)
{
case
CURAND_STATUS_SUCCESS
:
case
CURAND_STATUS_SUCCESS
:
return
"
CURAND_STATUS_SUCCESS
"
;
return
"
`CURAND_STATUS_SUCCESS`. No errors.
"
;
case
CURAND_STATUS_VERSION_MISMATCH
:
case
CURAND_STATUS_VERSION_MISMATCH
:
return
"CURAND_STATUS_VERSION_MISMATCH"
;
return
"`CURAND_STATUS_VERSION_MISMATCH`. Header file and linked library "
"version do not match."
;
case
CURAND_STATUS_NOT_INITIALIZED
:
case
CURAND_STATUS_NOT_INITIALIZED
:
return
"
CURAND_STATUS_NOT_INITIALIZED
"
;
return
"
`CURAND_STATUS_NOT_INITIALIZED`. Generator not initialized.
"
;
case
CURAND_STATUS_ALLOCATION_FAILED
:
case
CURAND_STATUS_ALLOCATION_FAILED
:
return
"
CURAND_STATUS_ALLOCATION_FAILED
"
;
return
"
`CURAND_STATUS_ALLOCATION_FAILED`. Memory allocation failed.
"
;
case
CURAND_STATUS_TYPE_ERROR
:
case
CURAND_STATUS_TYPE_ERROR
:
return
"
CURAND_STATUS_TYPE_ERROR
"
;
return
"
`CURAND_STATUS_TYPE_ERROR`. Generator is wrong type.
"
;
case
CURAND_STATUS_OUT_OF_RANGE
:
case
CURAND_STATUS_OUT_OF_RANGE
:
return
"
CURAND_STATUS_OUT_OF_RANGE
"
;
return
"
`CURAND_STATUS_OUT_OF_RANGE`. Argument out of range.
"
;
case
CURAND_STATUS_LENGTH_NOT_MULTIPLE
:
case
CURAND_STATUS_LENGTH_NOT_MULTIPLE
:
return
"CURAND_STATUS_LENGTH_NOT_MULTIPLE"
;
return
"`CURAND_STATUS_LENGTH_NOT_MULTIPLE`. Length requested is not a "
"multple of dimension."
;
case
CURAND_STATUS_DOUBLE_PRECISION_REQUIRED
:
case
CURAND_STATUS_DOUBLE_PRECISION_REQUIRED
:
return
"CURAND_STATUS_DOUBLE_PRECISION_REQUIRED"
;
return
"`CURAND_STATUS_DOUBLE_PRECISION_REQUIRED`. GPU does not have "
"double precision required by MRG32k3a."
;
case
CURAND_STATUS_LAUNCH_FAILURE
:
case
CURAND_STATUS_LAUNCH_FAILURE
:
return
"
CURAND_STATUS_LAUNCH_FAILURE
"
;
return
"
`CURAND_STATUS_LAUNCH_FAILURE`. Kernel launch failure.
"
;
case
CURAND_STATUS_PREEXISTING_FAILURE
:
case
CURAND_STATUS_PREEXISTING_FAILURE
:
return
"CURAND_STATUS_PREEXISTING_FAILURE"
;
return
"`CURAND_STATUS_PREEXISTING_FAILURE`. Preexisting failure on "
"library entry."
;
case
CURAND_STATUS_INITIALIZATION_FAILED
:
case
CURAND_STATUS_INITIALIZATION_FAILED
:
return
"CURAND_STATUS_INITIALIZATION_FAILED"
;
return
"`CURAND_STATUS_INITIALIZATION_FAILED`. Initialization of CUDA "
"failed."
;
case
CURAND_STATUS_ARCH_MISMATCH
:
case
CURAND_STATUS_ARCH_MISMATCH
:
return
"CURAND_STATUS_ARCH_MISMATCH"
;
return
"`CURAND_STATUS_ARCH_MISMATCH`. Architecture mismatch, GPU does "
"not support requested feature."
;
case
CURAND_STATUS_INTERNAL_ERROR
:
case
CURAND_STATUS_INTERNAL_ERROR
:
return
"
CURAND_STATUS_INTERNAL_ERROR
"
;
return
"
`CURAND_STATUS_INTERNAL_ERROR`. Internal library error.
"
;
default:
default:
return
"Unknown curand status"
;
return
"Unknown curand status"
;
}
}
...
@@ -808,23 +814,37 @@ inline bool is_error(cublasStatus_t stat) {
...
@@ -808,23 +814,37 @@ inline bool is_error(cublasStatus_t stat) {
inline
const
char
*
cublasGetErrorString
(
cublasStatus_t
stat
)
{
inline
const
char
*
cublasGetErrorString
(
cublasStatus_t
stat
)
{
switch
(
stat
)
{
switch
(
stat
)
{
case
CUBLAS_STATUS_NOT_INITIALIZED
:
case
CUBLAS_STATUS_NOT_INITIALIZED
:
return
"CUBLAS_STATUS_NOT_INITIALIZED"
;
return
"`CUBLAS_STATUS_NOT_INITIALIZED`. The cuBLAS library was not "
"initialized."
;
case
CUBLAS_STATUS_ALLOC_FAILED
:
case
CUBLAS_STATUS_ALLOC_FAILED
:
return
"CUBLAS_STATUS_ALLOC_FAILED"
;
return
"`CUBLAS_STATUS_ALLOC_FAILED`. Resource allocation failed inside "
"the cuBLAS library."
;
case
CUBLAS_STATUS_INVALID_VALUE
:
case
CUBLAS_STATUS_INVALID_VALUE
:
return
"CUBLAS_STATUS_INVALID_VALUE"
;
return
"`CUBLAS_STATUS_INVALID_VALUE`. An unsupported value or parameter "
"was passed to the function (a negative vector size, for "
"example)."
;
case
CUBLAS_STATUS_ARCH_MISMATCH
:
case
CUBLAS_STATUS_ARCH_MISMATCH
:
return
"CUBLAS_STATUS_ARCH_MISMATCH"
;
return
"`CUBLAS_STATUS_ARCH_MISMATCH`. The function requires a feature "
"absent from the device architecture; usually caused by the lack "
"of support for double precision."
;
case
CUBLAS_STATUS_MAPPING_ERROR
:
case
CUBLAS_STATUS_MAPPING_ERROR
:
return
"CUBLAS_STATUS_MAPPING_ERROR"
;
return
"`CUBLAS_STATUS_MAPPING_ERROR`. An access to GPU memory space "
"failed, which is usually caused by a failure to bind a texture."
;
case
CUBLAS_STATUS_EXECUTION_FAILED
:
case
CUBLAS_STATUS_EXECUTION_FAILED
:
return
"CUBLAS_STATUS_EXECUTION_FAILED"
;
return
"`CUBLAS_STATUS_EXECUTION_FAILED`. The GPU program failed to "
"execute. This is often caused by a launch failure of the kernel "
"on the GPU, which can be caused by multiple reasons."
;
case
CUBLAS_STATUS_INTERNAL_ERROR
:
case
CUBLAS_STATUS_INTERNAL_ERROR
:
return
"CUBLAS_STATUS_INTERNAL_ERROR"
;
return
"`CUBLAS_STATUS_INTERNAL_ERROR`. An internal cuBLAS operation "
"failed. This error is usually caused by a cudaMemcpyAsync() "
"failure."
;
case
CUBLAS_STATUS_NOT_SUPPORTED
:
case
CUBLAS_STATUS_NOT_SUPPORTED
:
return
"CUBLAS_STATUS_NOT_SUPPORTED"
;
return
"`CUBLAS_STATUS_NOT_SUPPORTED`. The functionality requested is "
"not supported."
;
case
CUBLAS_STATUS_LICENSE_ERROR
:
case
CUBLAS_STATUS_LICENSE_ERROR
:
return
"CUBLAS_STATUS_LICENSE_ERROR"
;
return
"`CUBLAS_STATUS_LICENSE_ERROR`. The functionality requested "
"requires some license and an error was detected when trying to "
"check the current licensing."
;
default:
default:
return
"Unknown cublas status"
;
return
"Unknown cublas status"
;
}
}
...
@@ -843,19 +863,34 @@ inline bool is_error(cusolverStatus_t stat) {
...
@@ -843,19 +863,34 @@ inline bool is_error(cusolverStatus_t stat) {
inline
const
char
*
cusolverGetErrorString
(
cusolverStatus_t
stat
)
{
inline
const
char
*
cusolverGetErrorString
(
cusolverStatus_t
stat
)
{
switch
(
stat
)
{
switch
(
stat
)
{
case
CUSOLVER_STATUS_NOT_INITIALIZED
:
case
CUSOLVER_STATUS_NOT_INITIALIZED
:
return
"CUSOLVER_STATUS_NOT_INITIALIZED"
;
return
"`CUSOLVER_STATUS_NOT_INITIALIZED`. The cuSolver library was not "
"initialized. This is usually caused by the lack of a prior call, "
"an error in the CUDA Runtime API called by the cuSolver routine, "
"or an error in the hardware setup."
;
case
CUSOLVER_STATUS_ALLOC_FAILED
:
case
CUSOLVER_STATUS_ALLOC_FAILED
:
return
"CUSOLVER_STATUS_ALLOC_FAILED"
;
return
"`CUSOLVER_STATUS_ALLOC_FAILED`. Resource allocation failed "
"inside the cuSolver library. This is usually caused by a "
"cudaMalloc() failure."
;
case
CUSOLVER_STATUS_INVALID_VALUE
:
case
CUSOLVER_STATUS_INVALID_VALUE
:
return
"CUSOLVER_STATUS_INVALID_VALUE"
;
return
"`CUSOLVER_STATUS_INVALID_VALUE`. An unsupported value or "
"parameter was passed to the function (a negative vector size, "
"for example)."
;
case
CUSOLVER_STATUS_ARCH_MISMATCH
:
case
CUSOLVER_STATUS_ARCH_MISMATCH
:
return
"CUSOLVER_STATUS_ARCH_MISMATCH"
;
return
"`CUSOLVER_STATUS_ARCH_MISMATCH`. The function requires a feature "
"absent from the device architecture; usually caused by the lack "
"of support for atomic operations or double precision."
;
case
CUSOLVER_STATUS_EXECUTION_FAILED
:
case
CUSOLVER_STATUS_EXECUTION_FAILED
:
return
"CUSOLVER_STATUS_EXECUTION_FAILED"
;
return
"`CUSOLVER_STATUS_EXECUTION_FAILED`. The GPU program failed to "
"execute. This is often caused by a launch failure of the kernel "
"on the GPU, which can be caused by multiple reasons."
;
case
CUSOLVER_STATUS_INTERNAL_ERROR
:
case
CUSOLVER_STATUS_INTERNAL_ERROR
:
return
"CUSOLVER_STATUS_INTERNAL_ERROR"
;
return
"`CUSOLVER_STATUS_INTERNAL_ERROR`. An internal cuSolver operation "
"failed. This error is usually caused by a cudaMemcpyAsync() "
"failure."
;
case
CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED
:
case
CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED
:
return
"CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED"
;
return
"`CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED`. The matrix type is "
"not supported by this function. This is usually caused by "
"passing an invalid matrix descriptor to the function."
;
default:
default:
return
"Unknown cusolver status"
;
return
"Unknown cusolver status"
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录