ug4
cuda_manager.h File Reference
#include <cuda_runtime.h>
#include <cusparse_v2.h>
#include <cublas_v2.h>
#include <vector>
#include "common/error.h"
#include "common/log.h"
#include <string>

Go to the source code of this file.

Classes

class  ug::CUDAManager
 

Namespaces

 ug
 the ug namespace
 

Macros

#define CUDA_CHECK_STATUS(status)   CudaCheckStatus(status, __FILE__, __LINE__)
 
#define CUDA_CHECK_SUCCESS(err, desc)
 
#define USE_CUSPARSE
 

Functions

template<typename T >
ug::CUDA_GetElementFromDevice (T *p, size_t i=0)
 
template<typename T >
void ug::CudaCheckStatus (T status, const char *file, int line)
 
template<typename T >
void ug::CudaCpyToDevice (typename T::value_type *dest, T &vec)
 
template<typename T >
void ug::CudaCpyToHost (T &dest, typename T::value_type *src)
 
template<typename T >
T::value_typeug::CudaCreateAndCopyToDevice (T &vec)
 
const char * ug::CUDAError (int err)
 
template<typename T >
T * ug::MyCudaAlloc (size_t N)
 

Macro Definition Documentation

◆ CUDA_CHECK_STATUS

#define CUDA_CHECK_STATUS (   status)    CudaCheckStatus(status, __FILE__, __LINE__)

◆ CUDA_CHECK_SUCCESS

#define CUDA_CHECK_SUCCESS (   err,
  desc 
)
Value:
if(err != cudaSuccess)\
{\
UG_THROW("Error in " << __FUNCTION__ << ": CUDA ERROR " << err <<":\n" <<\
ug::CUDAError(err) << "\n----------------------------\n" << desc << "\n");\
}
const char * CUDAError(int err)
Definition: cuda_error.cpp:35

◆ USE_CUSPARSE

#define USE_CUSPARSE