PARALUTION  1.0.0
PARALUTION
gpu_utils.hpp File Reference
#include "../backend_manager.hpp"
#include "../../utils/log.hpp"
#include "backend_gpu.hpp"
#include "cuda_kernels_general.hpp"
#include "gpu_allocate_free.hpp"
#include <stdlib.h>
#include <cuda.h>
#include <cublas_v2.h>
#include <cusparse_v2.h>

Go to the source code of this file.

Namespaces

 paralution
 

Macros

#define CUBLAS_HANDLE(handle)   *static_cast<cublasHandle_t*>(handle)
 
#define CUSPARSE_HANDLE(handle)   *static_cast<cusparseHandle_t*>(handle)
 
#define CHECK_CUDA_ERROR(file, line)
 
#define CHECK_CUBLAS_ERROR(stat_t, file, line)
 
#define CHECK_CUSPARSE_ERROR(stat_t, file, line)
 

Functions

template<typename IndexType , unsigned int BLOCK_SIZE>
bool paralution::cum_sum (IndexType *dst, const IndexType *src, const IndexType numElems)
 

Macro Definition Documentation

#define CHECK_CUBLAS_ERROR (   stat_t,
  file,
  line 
)
Value:
{ \
if (stat_t != CUBLAS_STATUS_SUCCESS) { \
LOG_INFO("Cublas error!"); \
if (stat_t == CUBLAS_STATUS_NOT_INITIALIZED) \
LOG_INFO("CUBLAS_STATUS_NOT_INITIALIZED"); \
if (stat_t == CUBLAS_STATUS_ALLOC_FAILED) \
LOG_INFO("CUBLAS_STATUS_ALLOC_FAILED"); \
if (stat_t == CUBLAS_STATUS_INVALID_VALUE) \
LOG_INFO("CUBLAS_STATUS_INVALID_VALUE"); \
if (stat_t == CUBLAS_STATUS_ARCH_MISMATCH) \
LOG_INFO("CUBLAS_STATUS_ARCH_MISMATCH"); \
if (stat_t == CUBLAS_STATUS_MAPPING_ERROR) \
LOG_INFO("CUBLAS_STATUS_MAPPING_ERROR"); \
if (stat_t == CUBLAS_STATUS_EXECUTION_FAILED) \
LOG_INFO("CUBLAS_STATUS_EXECUTION_FAILED"); \
if (stat_t == CUBLAS_STATUS_INTERNAL_ERROR) \
LOG_INFO("CUBLAS_STATUS_INTERNAL_ERROR"); \
LOG_INFO("File: " << file << "; line: " << line); \
exit(1); \
} \
}
if(interval_end2 > num_nonzeros) interval_end2
#define LOG_INFO(stream)
Definition: log.hpp:38
#define CHECK_CUDA_ERROR (   file,
  line 
)
Value:
{ \
cudaError_t err_t; \
if ((err_t = cudaGetLastError() ) != cudaSuccess) { \
LOG_INFO("Cuda error: " << cudaGetErrorString(err_t)); \
LOG_INFO("File: " << file << "; line: " << line); \
exit(1); \
} \
}
if(interval_end2 > num_nonzeros) interval_end2
#define LOG_INFO(stream)
Definition: log.hpp:38

Referenced by paralution::cum_sum().

#define CHECK_CUSPARSE_ERROR (   stat_t,
  file,
  line 
)
Value:
{ \
if (stat_t != CUSPARSE_STATUS_SUCCESS) { \
LOG_INFO("Cusparse error!"); \
if (stat_t == CUSPARSE_STATUS_NOT_INITIALIZED) \
LOG_INFO("CUSPARSE_STATUS_NOT_INITIALIZED"); \
if (stat_t == CUSPARSE_STATUS_ALLOC_FAILED) \
LOG_INFO("CUSPARSE_STATUS_ALLOC_FAILED"); \
if (stat_t == CUSPARSE_STATUS_INVALID_VALUE) \
LOG_INFO("CUSPARSE_STATUS_INVALID_VALUE"); \
if (stat_t == CUSPARSE_STATUS_ARCH_MISMATCH) \
LOG_INFO("CUSPARSE_STATUS_ARCH_MISMATCH"); \
if (stat_t == CUSPARSE_STATUS_MAPPING_ERROR) \
LOG_INFO("CUSPARSE_STATUS_MAPPING_ERROR"); \
if (stat_t == CUSPARSE_STATUS_EXECUTION_FAILED) \
LOG_INFO("CUSPARSE_STATUS_EXECUTION_FAILED"); \
if (stat_t == CUSPARSE_STATUS_INTERNAL_ERROR) \
LOG_INFO("CUSPARSE_STATUS_INTERNAL_ERROR"); \
if (stat_t == CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED) \
LOG_INFO("CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED"); \
LOG_INFO("File: " << file << "; line: " << line); \
exit(1); \
} \
}
if(interval_end2 > num_nonzeros) interval_end2
#define LOG_INFO(stream)
Definition: log.hpp:38
#define CUBLAS_HANDLE (   handle)    *static_cast<cublasHandle_t*>(handle)
#define CUSPARSE_HANDLE (   handle)    *static_cast<cusparseHandle_t*>(handle)