imate
C++/CUDA Reference
cusparse_symbols.cpp File Reference
#include "./cusparse_symbols.h"
#include <cusparse.h>
#include <cstdlib>
#include <sstream>
#include "./dynamic_loading.h"
Include dependency graph for cusparse_symbols.cpp:

Go to the source code of this file.

Functions

cusparseStatus_t cusparseCreate (cusparseHandle_t *handle)
 Definition of CUDA's cusparseCreate function using dynamically loaded cublas library. More...
 
cusparseStatus_t cusparseDestroy (cusparseHandle_t handle)
 Definition of CUDA's cusparseDestroy function using dynamically loaded cublas library. More...
 
cusparseStatus_t cusparseCreateCsr (cusparseSpMatDescr_t *spMatDescr, int64_t rows, int64_t cols, int64_t nnz, void *csrRowOffsets, void *csrColInd, void *csrValues, cusparseIndexType_t csrRowOffsetsType, cusparseIndexType_t csrColIndType, cusparseIndexBase_t idxBase, cudaDataType valueType)
 Definition of CUDA's cusparseCreateCsr function using dynamically loaded cublas library. More...
 
cusparseStatus_t cusparseCreateDnVec (cusparseDnVecDescr_t *dnVecDescr, int64_t size, void *values, cudaDataType valueType)
 Definition of CUDA's cusparseCreateDnVec function using dynamically loaded cublas library. More...
 
cusparseStatus_t cusparseDestroySpMat (cusparseConstSpMatDescr_t spMatDescr)
 Definition of CUDA's cusparseDestroySpMat function using dynamically loaded cublas library. More...
 
cusparseStatus_t cusparseDestroyDnVec (cusparseConstDnVecDescr_t dnVecDescr)
 Definition of CUDA's cusparseDestroyDnVec function using dynamically loaded cublas library. More...
 
cusparseStatus_t cusparseSpMV_bufferSize (cusparseHandle_t handle, cusparseOperation_t opA, const void *alpha, cusparseConstSpMatDescr_t matA, cusparseConstDnVecDescr_t vecX, const void *beta, cusparseDnVecDescr_t vecY, cudaDataType computeType, cusparseSpMVAlg_t alg, size_t *bufferSize)
 Definition of CUDA's cusparseSpMV_bufferSize function using dynamically loaded cublas library. More...
 
cusparseStatus_t cusparseSpMV (cusparseHandle_t handle, cusparseOperation_t opA, const void *alpha, cusparseConstSpMatDescr_t matA, cusparseConstDnVecDescr_t vecX, const void *beta, cusparseDnVecDescr_t vecY, cudaDataType computeType, cusparseSpMVAlg_t alg, void *externalBuffer)
 Definition of CUDA's cusparseSmMV function using dynamically loaded cublas library. More...
 

Function Documentation

◆ cusparseCreate()

cusparseStatus_t cusparseCreate ( cusparseHandle_t *  handle)

Definition of CUDA's cusparseCreate function using dynamically loaded cublas library.

Definition at line 92 of file cusparse_symbols.cpp.

93 {
95  {
96  std::string lib_name = cusparseSymbols::get_lib_name();
97  const char* symbol_name = "cusparseCreate";
98 
100  dynamic_loading::load_symbol<cusparseCreate_type>(
101  lib_name.c_str(),
102  symbol_name);
103  }
104 
105  return cusparseSymbols::cusparseCreate(handle);
106 }
static std::string get_lib_name()
Returns the name of cusparse shared library.
static cusparseCreate_type cusparseCreate

References cusparseSymbols::cusparseCreate, and cusparseSymbols::get_lib_name().

Referenced by cuLinearOperator< DataType >::initialize_cusparse_handle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cusparseCreateCsr()

cusparseStatus_t cusparseCreateCsr ( cusparseSpMatDescr_t *  spMatDescr,
int64_t  rows,
int64_t  cols,
int64_t  nnz,
void *  csrRowOffsets,
void *  csrColInd,
void *  csrValues,
cusparseIndexType_t  csrRowOffsetsType,
cusparseIndexType_t  csrColIndType,
cusparseIndexBase_t  idxBase,
cudaDataType  valueType 
)

Definition of CUDA's cusparseCreateCsr function using dynamically loaded cublas library.

Definition at line 140 of file cusparse_symbols.cpp.

152 {
154  {
155  std::string lib_name = cusparseSymbols::get_lib_name();
156  const char* symbol_name = "cusparseCreateCsr";
157 
159  dynamic_loading::load_symbol<cusparseCreateCsr_type>(
160  lib_name.c_str(),
161  symbol_name);
162  }
163 
165  spMatDescr, rows, cols, nnz, csrRowOffsets, csrColInd, csrValues,
166  csrRowOffsetsType, csrColIndType, idxBase, valueType);
167 }
static cusparseCreateCsr_type cusparseCreateCsr

References cusparseSymbols::cusparseCreateCsr, and cusparseSymbols::get_lib_name().

Referenced by cusparse_interface::create_cusparse_matrix< double >(), and cusparse_interface::create_cusparse_matrix< float >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cusparseCreateDnVec()

cusparseStatus_t cusparseCreateDnVec ( cusparseDnVecDescr_t *  dnVecDescr,
int64_t  size,
void *  values,
cudaDataType  valueType 
)

Definition of CUDA's cusparseCreateDnVec function using dynamically loaded cublas library.

Definition at line 177 of file cusparse_symbols.cpp.

182 {
184  {
185  std::string lib_name = cusparseSymbols::get_lib_name();
186  const char* symbol_name = "cusparseCreateDnVec";
187 
189  dynamic_loading::load_symbol<cusparseCreateDnVec_type>(
190  lib_name.c_str(),
191  symbol_name);
192  }
193 
195  dnVecDescr, size, values, valueType);
196 }
static cusparseCreateDnVec_type cusparseCreateDnVec

References cusparseSymbols::cusparseCreateDnVec, and cusparseSymbols::get_lib_name().

Referenced by cusparse_interface::create_cusparse_vector< double >(), and cusparse_interface::create_cusparse_vector< float >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cusparseDestroy()

cusparseStatus_t cusparseDestroy ( cusparseHandle_t  handle)

Definition of CUDA's cusparseDestroy function using dynamically loaded cublas library.

Definition at line 116 of file cusparse_symbols.cpp.

117 {
119  {
120  std::string lib_name = cusparseSymbols::get_lib_name();
121  const char* symbol_name = "cusparseDestroy";
122 
124  dynamic_loading::load_symbol<cusparseDestroy_type>(
125  lib_name.c_str(),
126  symbol_name);
127  }
128 
129  return cusparseSymbols::cusparseDestroy(handle);
130 }
static cusparseDestroy_type cusparseDestroy

References cusparseSymbols::cusparseDestroy, and cusparseSymbols::get_lib_name().

Referenced by cuLinearOperator< DataType >::~cuLinearOperator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cusparseDestroyDnVec()

cusparseStatus_t cusparseDestroyDnVec ( cusparseConstDnVecDescr_t  dnVecDescr)

Definition of CUDA's cusparseDestroyDnVec function using dynamically loaded cublas library.

Definition at line 231 of file cusparse_symbols.cpp.

233 {
235  {
236  std::string lib_name = cusparseSymbols::get_lib_name();
237  const char* symbol_name = "cusparseDestroyDnVec";
238 
240  dynamic_loading::load_symbol<cusparseDestroyDnVec_type>(
241  lib_name.c_str(),
242  symbol_name);
243  }
244 
245  return cusparseSymbols::cusparseDestroyDnVec(dnVecDescr);
246 }
static cusparseDestroyDnVec_type cusparseDestroyDnVec

References cusparseSymbols::cusparseDestroyDnVec, and cusparseSymbols::get_lib_name().

Referenced by cusparse_interface::destroy_cusparse_vector().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cusparseDestroySpMat()

cusparseStatus_t cusparseDestroySpMat ( cusparseConstSpMatDescr_t  spMatDescr)

Definition of CUDA's cusparseDestroySpMat function using dynamically loaded cublas library.

Definition at line 206 of file cusparse_symbols.cpp.

208 {
210  {
211  std::string lib_name = cusparseSymbols::get_lib_name();
212  const char* symbol_name = "cusparseDestroySpMat";
213 
215  dynamic_loading::load_symbol<cusparseDestroySpMat_type>(
216  lib_name.c_str(),
217  symbol_name);
218  }
219 
220  return cusparseSymbols::cusparseDestroySpMat(spMatDescr);
221 }
static cusparseDestroySpMat_type cusparseDestroySpMat

References cusparseSymbols::cusparseDestroySpMat, and cusparseSymbols::get_lib_name().

Referenced by cusparse_interface::destroy_cusparse_matrix().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cusparseSpMV()

cusparseStatus_t cusparseSpMV ( cusparseHandle_t  handle,
cusparseOperation_t  opA,
const void *  alpha,
cusparseConstSpMatDescr_t  matA,
cusparseConstDnVecDescr_t  vecX,
const void *  beta,
cusparseDnVecDescr_t  vecY,
cudaDataType  computeType,
cusparseSpMVAlg_t  alg,
void *  externalBuffer 
)

Definition of CUDA's cusparseSmMV function using dynamically loaded cublas library.

Definition at line 292 of file cusparse_symbols.cpp.

303 {
304  if (cusparseSymbols::cusparseSpMV == NULL)
305  {
306  std::string lib_name = cusparseSymbols::get_lib_name();
307  const char* symbol_name = "cusparseSpMV";
308 
310  dynamic_loading::load_symbol<cusparseSpMV_type>(
311  lib_name.c_str(),
312  symbol_name);
313  }
314 
316  handle, opA, alpha, matA, vecX, beta, vecY, computeType, alg,
317  externalBuffer);
318 }
static cusparseSpMV_type cusparseSpMV

References cusparseSymbols::cusparseSpMV, and cusparseSymbols::get_lib_name().

Referenced by cusparse_interface::cusparse_matvec< double >(), and cusparse_interface::cusparse_matvec< float >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cusparseSpMV_bufferSize()

cusparseStatus_t cusparseSpMV_bufferSize ( cusparseHandle_t  handle,
cusparseOperation_t  opA,
const void *  alpha,
cusparseConstSpMatDescr_t  matA,
cusparseConstDnVecDescr_t  vecX,
const void *  beta,
cusparseDnVecDescr_t  vecY,
cudaDataType  computeType,
cusparseSpMVAlg_t  alg,
size_t *  bufferSize 
)

Definition of CUDA's cusparseSpMV_bufferSize function using dynamically loaded cublas library.

Definition at line 256 of file cusparse_symbols.cpp.

267 {
269  {
270  std::string lib_name = cusparseSymbols::get_lib_name();
271  const char* symbol_name = "cusparseSpMV_bufferSize";
272 
274  dynamic_loading::load_symbol<cusparseSpMV_bufferSize_type>(
275  lib_name.c_str(),
276  symbol_name);
277  }
278 
280  handle, opA, alpha, matA, vecX, beta, vecY, computeType, alg,
281  bufferSize);
282 }
static cusparseSpMV_bufferSize_type cusparseSpMV_bufferSize

References cusparseSymbols::cusparseSpMV_bufferSize, and cusparseSymbols::get_lib_name().

Referenced by cusparse_interface::cusparse_matrix_buffer_size< double >(), and cusparse_interface::cusparse_matrix_buffer_size< float >().

Here is the call graph for this function:
Here is the caller graph for this function: