nnlib
GPU-accelerated, C/C++ neural network library.
Macros | Functions
assert.cuh File Reference

Header file declaring the gpuAssert() method. More...

#include "verify.cuh"
#include <cstdio>

Macros

#define GPU_CHECK_ERROR(ans)   gpuAssert((ans), __FILE__, __LINE__)
 Macro used to call the gpuAssert() method with file and line information.
 

Functions

void gpuAssert (cudaError_t code, const char *file, int line, bool abort=true)
 Method used to assert that the last CUDA call was successful. More...
 

Detailed Description

Header file declaring the gpuAssert() method.

Author
Jan Warchocki
Date
10 March 2022

Function Documentation

◆ gpuAssert()

void gpuAssert ( cudaError_t  code,
const char *  file,
int  line,
bool  abort = true 
)
inline

Method used to assert that the last CUDA call was successful.

If the call was not successful, the method will display the error message.

Parameters
codeThe most recent code returned by CUDA.
fileThe file where the GPU_CHECK_ERROR was called.
lineThe line where the GPU_CHECK_ERROR was called.
abortIf true, the program will stop upon encountering the exception.