HiRep 0.1
Loading...
Searching...
No Matches
error_gpu.h File Reference

Error checking for GPU. More...

#include "gpu.h"
Include dependency graph for error_gpu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CudaSafeCall(err)
 Check CUDA call and log error message on failure This may be more performant than CHECK_CUDA -> TODO: replace (the other function) in the future (SAM)
 
#define CudaCheckError()
 Check last error after CUDA calls.
 
#define CHECK_CUDA(call)
 Check CUDA call and log error message on failure.
 

Functions

void __cudaCheckError (const char *func, const char *file, int line)
 Check last error.
 
void __cudaSafeCall (cudaError_t err, const char *func, const char *file, const int line)
 Check CUDA call and log error message on failure.
 

Detailed Description

Error checking for GPU.

Macro Definition Documentation

◆ CHECK_CUDA

#define CHECK_CUDA ( call)
Value:
#define CudaSafeCall(err)
Check CUDA call and log error message on failure This may be more performant than CHECK_CUDA -> TODO:...
Definition error_gpu.h:36

Check CUDA call and log error message on failure.

Parameters
callFunction call that should be checked.

◆ CudaCheckError

#define CudaCheckError ( )
Value:
__cudaCheckError((const char *)__func__, (const char *)__FILE__, (int)__LINE__)
void __cudaCheckError(const char *func, const char *file, int line)
Check last error.
Definition error_gpu.c:23

Check last error after CUDA calls.

◆ CudaSafeCall

#define CudaSafeCall ( err)
Value:
__cudaSafeCall(err, __func__, __FILE__, __LINE__)
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

Check CUDA call and log error message on failure This may be more performant than CHECK_CUDA -> TODO: replace (the other function) in the future (SAM)

Parameters
errFunction call that should be checked

Function Documentation

◆ __cudaCheckError()

void __cudaCheckError ( const char * func,
const char * file,
int line )

Check last error.

Parameters
fileFile where the last error was raised
lineLine where the last error was raised

◆ __cudaSafeCall()

void __cudaSafeCall ( cudaError_t err,
const char * func,
const char * file,
const int line )

Check CUDA call and log error message on failure.

Parameters
cudaError_tError return type from CUDA call
fileFile where the exception was raised
lineLine where the exception was raised