mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2025-12-17 02:57:48 +08:00
Merge 384a9612fe81154f35569ceece343af259e754e4 into 9c688d7ff78455ed42e345124d1495aad6bf66de
This commit is contained in:
commit
6fa079a620
@ -579,6 +579,8 @@ static const char *_cudaGetErrorEnum(NppStatus error) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
namespace helper_cuda {
|
||||||
|
namespace detail {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void check(T result, char const *const func, const char *const file,
|
void check(T result, char const *const func, const char *const file,
|
||||||
int const line) {
|
int const line) {
|
||||||
@ -588,11 +590,13 @@ void check(T result, char const *const func, const char *const file,
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} // namespace detail
|
||||||
|
} // namespace helper_cuda
|
||||||
|
|
||||||
#ifdef __DRIVER_TYPES_H__
|
#ifdef __DRIVER_TYPES_H__
|
||||||
// This will output the proper CUDA error strings in the event
|
// This will output the proper CUDA error strings in the event
|
||||||
// that a CUDA host call returns an error
|
// that a CUDA host call returns an error
|
||||||
#define checkCudaErrors(val) check((val), #val, __FILE__, __LINE__)
|
#define checkCudaErrors(val) ::helper_cuda::detail::check((val), #val, __FILE__, __LINE__)
|
||||||
|
|
||||||
// This will output the proper error string when calling cudaGetLastError
|
// This will output the proper error string when calling cudaGetLastError
|
||||||
#define getLastCudaError(msg) __getLastCudaError(msg, __FILE__, __LINE__)
|
#define getLastCudaError(msg) __getLastCudaError(msg, __FILE__, __LINE__)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user