imate
C++/CUDA Reference
Loading...
Searching...
No Matches
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.
 
cusparseStatus_t cusparseDestroy (cusparseHandle_t handle)
 Definition of CUDA's cusparseDestroy function using dynamically loaded cublas library.
 
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.
 
cusparseStatus_t cusparseCreateCsc (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 cusparseCreateCsc function using dynamically loaded cublas library.
 
cusparseStatus_t cusparseCreateDnVec (cusparseDnVecDescr_t *dnVecDescr, int64_t size, void *values, cudaDataType valueType)
 Definition of CUDA's cusparseCreateDnVec function using dynamically loaded cublas library.
 
cusparseStatus_t cusparseDestroySpMat (cusparseConstSpMatDescr_t spMatDescr)
 Definition of CUDA's cusparseDestroySpMat function using dynamically loaded cublas library.
 
cusparseStatus_t cusparseDestroyDnVec (cusparseConstDnVecDescr_t dnVecDescr)
 Definition of CUDA's cusparseDestroyDnVec function using dynamically loaded cublas library.
 
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.
 
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.
 

Function Documentation

◆ cusparseCreate()

cusparseStatus_t cusparseCreate ( cusparseHandle_t *  handle)

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

Definition at line 93 of file cusparse_symbols.cpp.

94{
96 {
97 std::string lib_name = cusparseSymbols::get_lib_name();
98 const char* symbol_name = "cusparseCreate";
99
101 dynamic_loading::load_symbol<cusparseCreate_type>(
102 lib_name.c_str(),
103 symbol_name);
104 }
105
106 return cusparseSymbols::cusparseCreate(handle);
107}
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:

◆ cusparseCreateCsc()

cusparseStatus_t cusparseCreateCsc ( 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 cusparseCreateCsc function using dynamically loaded cublas library.

Definition at line 178 of file cusparse_symbols.cpp.

190{
192 {
193 std::string lib_name = cusparseSymbols::get_lib_name();
194 const char* symbol_name = "cusparseCreateCsc";
195
197 dynamic_loading::load_symbol<cusparseCreateCsc_type>(
198 lib_name.c_str(),
199 symbol_name);
200 }
201
203 spMatDescr, rows, cols, nnz, csrRowOffsets, csrColInd, csrValues,
204 csrRowOffsetsType, csrColIndType, idxBase, valueType);
205}
static cusparseCreateCsc_type cusparseCreateCsc

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

Referenced by cusparse_api::create_cusparse_csc_matrix< double, int32_t >(), cusparse_api::create_cusparse_csc_matrix< double, int64_t >(), cusparse_api::create_cusparse_csc_matrix< float, int32_t >(), and cusparse_api::create_cusparse_csc_matrix< float, int64_t >().

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 141 of file cusparse_symbols.cpp.

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

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

Referenced by cusparse_api::create_cusparse_csr_matrix< double, int32_t >(), cusparse_api::create_cusparse_csr_matrix< double, int64_t >(), cusparse_api::create_cusparse_csr_matrix< float, int32_t >(), and cusparse_api::create_cusparse_csr_matrix< float, int64_t >().

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 215 of file cusparse_symbols.cpp.

220{
222 {
223 std::string lib_name = cusparseSymbols::get_lib_name();
224 const char* symbol_name = "cusparseCreateDnVec";
225
227 dynamic_loading::load_symbol<cusparseCreateDnVec_type>(
228 lib_name.c_str(),
229 symbol_name);
230 }
231
233 dnVecDescr, size, values, valueType);
234}
static cusparseCreateDnVec_type cusparseCreateDnVec

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

Referenced by cusparse_api::create_cusparse_vector< double >(), and cusparse_api::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 117 of file cusparse_symbols.cpp.

118{
120 {
121 std::string lib_name = cusparseSymbols::get_lib_name();
122 const char* symbol_name = "cusparseDestroy";
123
125 dynamic_loading::load_symbol<cusparseDestroy_type>(
126 lib_name.c_str(),
127 symbol_name);
128 }
129
131}
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 269 of file cusparse_symbols.cpp.

271{
273 {
274 std::string lib_name = cusparseSymbols::get_lib_name();
275 const char* symbol_name = "cusparseDestroyDnVec";
276
278 dynamic_loading::load_symbol<cusparseDestroyDnVec_type>(
279 lib_name.c_str(),
280 symbol_name);
281 }
282
283 return cusparseSymbols::cusparseDestroyDnVec(dnVecDescr);
284}
static cusparseDestroyDnVec_type cusparseDestroyDnVec

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

Referenced by cusparse_api::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 244 of file cusparse_symbols.cpp.

246{
248 {
249 std::string lib_name = cusparseSymbols::get_lib_name();
250 const char* symbol_name = "cusparseDestroySpMat";
251
253 dynamic_loading::load_symbol<cusparseDestroySpMat_type>(
254 lib_name.c_str(),
255 symbol_name);
256 }
257
258 return cusparseSymbols::cusparseDestroySpMat(spMatDescr);
259}
static cusparseDestroySpMat_type cusparseDestroySpMat

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

Referenced by cusparse_api::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 330 of file cusparse_symbols.cpp.

341{
343 {
344 std::string lib_name = cusparseSymbols::get_lib_name();
345 const char* symbol_name = "cusparseSpMV";
346
348 dynamic_loading::load_symbol<cusparseSpMV_type>(
349 lib_name.c_str(),
350 symbol_name);
351 }
352
354 handle, opA, alpha, matA, vecX, beta, vecY, computeType, alg,
355 externalBuffer);
356}
static cusparseSpMV_type cusparseSpMV

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

Referenced by cusparse_api::cusparse_matvec< double >(), and cusparse_api::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 294 of file cusparse_symbols.cpp.

305{
307 {
308 std::string lib_name = cusparseSymbols::get_lib_name();
309 const char* symbol_name = "cusparseSpMV_bufferSize";
310
312 dynamic_loading::load_symbol<cusparseSpMV_bufferSize_type>(
313 lib_name.c_str(),
314 symbol_name);
315 }
316
318 handle, opA, alpha, matA, vecX, beta, vecY, computeType, alg,
319 bufferSize);
320}
static cusparseSpMV_bufferSize_type cusparseSpMV_bufferSize

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

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

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