HiRep 0.1
Loading...
Searching...
No Matches
error_gpu.h
Go to the documentation of this file.
1/***************************************************************************\
2* Copyright (c) 2022, Claudio Pica *
3* All rights reserved. *
4\***************************************************************************/
10#ifndef ERROR_GPU_H
11#define ERROR_GPU_H
12
13#ifdef WITH_GPU
14
15#include "gpu.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
27void __cudaCheckError(const char *func, const char *file, int line);
28
36#define CudaSafeCall(err) __cudaSafeCall(err, __func__, __FILE__, __LINE__)
37
41#define CudaCheckError() __cudaCheckError((const char *)__func__, (const char *)__FILE__, (int)__LINE__)
42
50void __cudaSafeCall(cudaError_t err, const char *func, const char *file, const int line);
51
57#define CHECK_CUDA(call) CudaSafeCall(call)
58
59#ifdef __cplusplus
60}
61#endif
62#endif
63#endif
void __cudaSafeCall(cudaError_t err, const char *func, const char *file, const int line)
Check CUDA call and log error message on failure.
Definition error_gpu.c:11
void __cudaCheckError(const char *func, const char *file, int line)
Check last error.
Definition error_gpu.c:23
Basic gpu imports and structs. Include this in files that define GPU logic.