error.cpp 427 Bytes
Newer Older
Nianchen Deng's avatar
sync    
Nianchen Deng committed
1
2
3
4
5
6
7
8
9
10
11
12
#include "error.h"
#include "../common/logger.h"

namespace utils::cuda {
    bool checkErr(cudaError_t err, const char *file, int line) {
        if (err == cudaSuccess)
            return true;
        common::Logger::instance.error("Cuda error %s at %s (Line %d): %s", cudaGetErrorName(err),
                                       file, line, cudaGetErrorString(err));
        return false;
    }
} // namespace utils::cuda