MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / cublasSafeCall

Method cublasSafeCall

extensions/include/cuMat/src/CublasApi.h:51–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 }
50 }
51 static void cublasSafeCall(cublasStatus_t status, const char *file, const int line)
52 {
53 if (CUBLAS_STATUS_SUCCESS != status) {
54 std::string msg = ErrorHelpers::format("cublasSafeCall() failed at %s:%i : %s\n",
55 file, line, getErrorName(status));
56 CUMAT_LOG_SEVERE(msg);
57 throw cuda_error(msg);
58 }
59#if CUMAT_VERBOSE_ERROR_CHECKING==1
60 //insert a device-sync
61 cudaError err = cudaDeviceSynchronize();
62 if (cudaSuccess != err) {
63 std::string msg = ErrorHelpers::format("cublasSafeCall() failed at %s:%i : %s\n",
64 file, line, cudaGetErrorString(err));
65 CUMAT_LOG_SEVERE(msg);
66 throw cuda_error(msg);
67 }
68#endif
69 }
70#define CUBLAS_SAFE_CALL( err ) cublasSafeCall( err, __FILE__, __LINE__ )
71
72 //-------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected