-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror_check.cu
33 lines (26 loc) · 1.17 KB
/
error_check.cu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "imp_includes.hcu"
//#define HANDLE_ERROR( err ) (HandleError( err, __FILE__, __LINE__ ))
void HandleError( cudaError_t err,const char *file,int line )
{
confirm(err == cudaSuccess,cudaGetErrorString( err )<<" in "<<file<<" at "<<line<<".");
}
void HandleError( cublasStatus_t err,const char *file,int line )
{
confirm(err == CUBLAS_STATUS_SUCCESS,cublasGetErrorString( err )<<" in "<<file<<" at "<<line<<".");
}
void HandleError( cusolverStatus_t err,const char *file,int line )
{
confirm(err == CUSOLVER_STATUS_SUCCESS,cusolverGetErrorString( err )<<" in "<<file<<" at "<<line<<".");
}
void HandleError( curandStatus_t err,const char *file,int line )
{
confirm(err == CURAND_STATUS_SUCCESS,curandGetErrorString( err )<<" in "<<file<<" at "<<line<<".");
}
// static void HandleError( cufftResult err,const char *file,int line )
// {
// confirm(err == CUFFT_SUCCESS,cufftGetErrorString( err )<<" in "<<file<<" at "<<line<<".");
// }
// static void HandleError( cusparseStatus_t err,const char *file,int line )
// {
// confirm(err == CUSPARSE_STATUS_SUCCESS,cusparseGetErrorString( err )<<" in "<<file<<" at "<<line<<".");
// }