-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrorcheck.cuh
19 lines (17 loc) · 915 Bytes
/
errorcheck.cuh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once
#include <iostream>
#ifndef NDEBUG
#define cudaCheck(expr) \
do \
{ \
const cudaError_t err = (expr); \
if (err != cudaSuccess) \
{ \
std::cerr << cudaGetErrorString(err) << " at " << __FILE__ << ":" \
<< __LINE__ << std::endl; \
std::exit(1); \
} \
} while (false);
#else
#define cudaCheck(expr) (expr)
#endif