mirror of
https://github.com/MartinOpat/cuda-based-raytrace.git
synced 2025-06-07 02:13:10 +02:00
14 lines
348 B
C++
14 lines
348 B
C++
#include "cuda_error.h"
|
|
|
|
#include "cuda_runtime.h"
|
|
#include <iostream>
|
|
|
|
|
|
void check_cuda(cudaError_t res, char const* const func, const char* const file, int const line) {
|
|
if (res) {
|
|
std::cout << "CUDA encountered an error: " << cudaGetErrorString(res) << " in " << file << ":" << line << std::endl;
|
|
cudaDeviceReset();
|
|
exit(1);
|
|
}
|
|
}
|