40#ifndef LM_CUDAHELPER_H_ 
   41#define LM_CUDAHELPER_H_ 
   45#include <cuda_runtime.h> 
   57    CUDAException(cudaError_t error, 
const char * file, 
const int line) : 
Exception(
"CUDA error",cudaGetErrorString(error),file,line) {}
 
 
   89#define CUDA_EXCEPTION_CHECK(cuda_call) {if ((cuda_call) != cudaSuccess) throw lm::CUDAException(cudaGetLastError(),__FILE__,__LINE__);} 
   90#define CUDA_EXCEPTION_DRIVER_CHECK(cuda_call) {if ((::lm::CUDA::_cuda_dret_=cuda_call) != CUDA_SUCCESS) throw lm::CUDADriverException(::lm::CUDA::_cuda_dret_,__FILE__,__LINE__);} 
   91#define CUDA_EXCEPTION_EXECUTE(cuda_exec) {cuda_exec; if (cudaPeekAtLastError() != cudaSuccess) throw lm::CUDAException(cudaGetLastError(),__FILE__,__LINE__);} 
   92#define CUDA_EXCEPTION_CHECK_NOTHROW(cuda_call) do { \ 
   93    if ((cuda_call) != cudaSuccess) { \ 
   94        fprintf(stderr, "Cuda error in destructor: %s @ %s:%d\n", cudaGetErrorString(cudaGetLastError()), __FILE__, __LINE__); \ 
 
CUDADriverException(CUresult error, const char *file, const int line)
Definition lm_cuda.h:66
CUDAException(cudaError_t error, const char *file, const int line)
Definition lm_cuda.h:57
static int getCurrentDevice()
static void setCurrentDevice(int device)
static int getNumberDevices()
static void getComputeCapabilities(int device, int *major, int *minor)
static void printCapabilities(int device)
static size_t getFreeMemory(int device)
static CUresult _cuda_dret_
Definition lm_cuda.h:75
static std::string getCapabilitiesString(int device)
Exception(const char *message="")
Create an Exception.
Definition Exceptions.h:62
Definition Capsule.cpp:46