7 #include "StringTools.h"
14 /*----------------------------------------------------------------------*\
16 \*---------------------------------------------------------------------*/
18 /*--------------------------------------*\
20 \*-------------------------------------*/
22 /*----------------------------------------------------------------------*\
24 \*---------------------------------------------------------------------*/
26 /*--------------------------------------*\
28 \*-------------------------------------*/
33 void cudaHandleError(cudaError_t error
, const char *file
, int line
)
35 if (error
!= cudaSuccess
)
37 cerr
<< endl
<< "[CUDA ERROR] : " << cudaGetErrorString(error
) << " in " << file
<< " at ligne " << line
<< endl
;
45 void cudaHandleError(curandStatus_t statut
, const char *file
, int line
)
47 if (statut
!= CURAND_STATUS_SUCCESS
)
49 cerr
<< endl
<< "[CURAND ERROR] : " << statut
<< " in " << file
<< " at ligne " << line
<< endl
;
57 void cudaHandleError(cublasStatus_t cublasStatus
, const char *file
, int line
)
60 if (cublasStatus
!= CUBLAS_STATUS_SUCCESS
)
64 case CUBLAS_STATUS_INVALID_VALUE
:
65 cerr
<< endl
<< "[CUBLAS ERROR] : CUBLAS_STATUS_INVALID_VALUE " << " in " << file
<< " at line " << line
<< endl
;
67 case CUBLAS_STATUS_NOT_INITIALIZED
:
68 cerr
<< endl
<< "[CUBLAS ERROR] : CUBLAS_STATUS_NOT_INITIALIZED " << " in " << file
<< " at line " << line
<< endl
;
70 case CUBLAS_STATUS_INTERNAL_ERROR
:
71 cerr
<< endl
<< "[CUBLAS ERROR] : CUBLAS_STATUS_INTERNAL_ERROR " << " in " << file
<< " at line " << line
<< endl
;
73 case CUBLAS_STATUS_MAPPING_ERROR
:
74 cerr
<< endl
<< "[CUBLAS ERROR] : CUBLAS_STATUS_MAPPING_ERROR " << " in " << file
<< " at line " << line
<< endl
;
77 case CUBLAS_STATUS_ALLOC_FAILED
:
78 cerr
<< endl
<< "[CUBLAS ERROR] : CUBLAS_STATUS_ALLOC_FAILED " << " in " << file
<< " at line " << line
<< endl
;
80 case CUBLAS_STATUS_ARCH_MISMATCH
:
81 cerr
<< endl
<< "[CUBLAS ERROR] : CUBLAS_STATUS_ARCH_MISMATCH" << " in " << file
<< " at line " << line
<< endl
;
83 case CUBLAS_STATUS_EXECUTION_FAILED
:
84 cerr
<< endl
<< "[CUBLAS ERROR] : CUBLAS_STATUS_EXECUTION_FAILED" << " in " << file
<< " at line " << line
<< endl
;
87 cerr
<< endl
<< "[CUBLAS ERROR] : Unknown error !" << " in " << file
<< " at line " << line
<< endl
;
94 /*--------------------------------------*\
96 \*-------------------------------------*/
98 /*----------------------------------------------------------------------*\
100 \*---------------------------------------------------------------------*/