6.2. 错误处理

本节介绍底层CUDA驱动应用程序编程接口的错误处理功能。

Functions

CUresult cuGetErrorName ( CUresult error, const char** pStr )
Gets the string representation of an error code enum name.
CUresult cuGetErrorString ( CUresult error, const char** pStr )
Gets the string description of an error code.

Functions

CUresult cuGetErrorName ( CUresult error, const char** pStr )
获取错误代码枚举名称的字符串表示形式。
参数
error
- Error code to convert to string
pStr
- Address of the string pointer.
描述

*pStr设置为指向枚举错误码error名称的以NULL结尾的字符串地址。如果无法识别该错误码,将返回CUDA_ERROR_INVALID_VALUE并将*pStr设置为NULL地址。

另请参阅:

CUresult, cudaGetErrorName

CUresult cuGetErrorString ( CUresult error, const char** pStr )
获取错误代码的字符串描述。
参数
error
- Error code to convert to string
pStr
- Address of the string pointer.
描述

*pStr设置为以NULL结尾的错误代码error描述字符串的地址。如果无法识别该错误代码,将返回CUDA_ERROR_INVALID_VALUE并将*pStr设置为NULL地址。

另请参阅:

CUresult, cudaGetErrorString