Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
lm_cuda.h File Reference
#include <string>
#include <cuda.h>
#include <cuda_runtime.h>
#include "core/Exceptions.h"
Include dependency graph for lm_cuda.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  lm::CUDAException
class  lm::CUDADriverException
class  lm::CUDA

Namespaces

namespace  lm

Macros

#define CUDA_EXCEPTION_CHECK(cuda_call)
#define CUDA_EXCEPTION_DRIVER_CHECK(cuda_call)
#define CUDA_EXCEPTION_EXECUTE(cuda_exec)
#define CUDA_EXCEPTION_CHECK_NOTHROW(cuda_call)

Macro Definition Documentation

◆ CUDA_EXCEPTION_CHECK

#define CUDA_EXCEPTION_CHECK ( cuda_call)
Value:
{if ((cuda_call) != cudaSuccess) throw lm::CUDAException(cudaGetLastError(),__FILE__,__LINE__);}
Definition lm_cuda.h:55

◆ CUDA_EXCEPTION_CHECK_NOTHROW

#define CUDA_EXCEPTION_CHECK_NOTHROW ( cuda_call)
Value:
do { \
if ((cuda_call) != cudaSuccess) { \
fprintf(stderr, "Cuda error in destructor: %s @ %s:%d\n", cudaGetErrorString(cudaGetLastError()), __FILE__, __LINE__); \
std::terminate(); \
} \
} while (0)

◆ CUDA_EXCEPTION_DRIVER_CHECK

#define CUDA_EXCEPTION_DRIVER_CHECK ( cuda_call)
Value:
{if ((::lm::CUDA::_cuda_dret_=cuda_call) != CUDA_SUCCESS) throw lm::CUDADriverException(::lm::CUDA::_cuda_dret_,__FILE__,__LINE__);}
Definition lm_cuda.h:64
static CUresult _cuda_dret_
Definition lm_cuda.h:75

◆ CUDA_EXCEPTION_EXECUTE

#define CUDA_EXCEPTION_EXECUTE ( cuda_exec)
Value:
{cuda_exec; if (cudaPeekAtLastError() != cudaSuccess) throw lm::CUDAException(cudaGetLastError(),__FILE__,__LINE__);}