52 CUDA_SAFE_CALL(cudaEventElapsedTime(&elapsed_time_, start_, stop_));
54 elapsed_time_ / 1000.0f)
58 void CudaSafeCall(
const cudaError_t error,
const std::string& file,
60 if (error != cudaSuccess) {
61 std::cerr <<
StringPrintf(
"CUDA error at %s:%i - %s", file.c_str(), line,
62 cudaGetErrorString(error))
69 const cudaError error = cudaGetLastError();
70 while (error != cudaSuccess) {
71 std::cerr <<
StringPrintf(
"CUDA error at %s:%i - %s", file, line,
72 cudaGetErrorString(error))
80 const cudaError error = cudaStreamSynchronize(
nullptr);
81 if (cudaSuccess != error) {
82 std::cerr <<
StringPrintf(
"CUDA error at %s:%i - %s", file, line,
83 cudaGetErrorString(error))
86 <<
"This error is likely caused by the graphics card timeout "
87 "detection mechanism of your operating system. Please refer to "
88 "the FAQ in the documentation on how to solve this problem."
void Print(const std::string &message)
#define CUDA_SAFE_CALL(error)
QTextStream & endl(QTextStream &stream)
void CudaSyncAndCheck(const char *file, const int line)
void CudaCheck(const char *file, const int line)
void CudaSafeCall(const cudaError_t error, const std::string &file, const int line)
std::string StringPrintf(const char *format,...)