48 std::string lib_extension;
50 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || \
52 lib_extension =
"lib";
53 #elif defined(__APPLE__)
54 lib_extension =
"dylib";
55 #elif defined(__linux__)
58 #error "Unknown compiler"
62 #ifndef CUSPARSE_VER_MAJOR
63 #error "CUSPARSE_VER_MAJOR is not defined."
67 std::string lib_base_name =
"libcusparse";
70 std::ostringstream oss;
72 oss << lib_base_name <<
"." << lib_extension <<
"." \
73 << CUSPARSE_VER_MAJOR;
75 std::string lib_name = oss.str();
98 const char* symbol_name =
"cusparseCreate";
101 dynamic_loading::load_symbol<cusparseCreate_type>(
122 const char* symbol_name =
"cusparseDestroy";
125 dynamic_loading::load_symbol<cusparseDestroy_type>(
142 cusparseSpMatDescr_t* spMatDescr,
149 cusparseIndexType_t csrRowOffsetsType,
150 cusparseIndexType_t csrColIndType,
151 cusparseIndexBase_t idxBase,
152 cudaDataType valueType)
157 const char* symbol_name =
"cusparseCreateCsr";
160 dynamic_loading::load_symbol<cusparseCreateCsr_type>(
166 spMatDescr, rows, cols, nnz, csrRowOffsets, csrColInd, csrValues,
167 csrRowOffsetsType, csrColIndType, idxBase, valueType);
179 cusparseSpMatDescr_t* spMatDescr,
186 cusparseIndexType_t csrRowOffsetsType,
187 cusparseIndexType_t csrColIndType,
188 cusparseIndexBase_t idxBase,
189 cudaDataType valueType)
194 const char* symbol_name =
"cusparseCreateCsc";
197 dynamic_loading::load_symbol<cusparseCreateCsc_type>(
203 spMatDescr, rows, cols, nnz, csrRowOffsets, csrColInd, csrValues,
204 csrRowOffsetsType, csrColIndType, idxBase, valueType);
216 cusparseDnVecDescr_t* dnVecDescr,
219 cudaDataType valueType)
224 const char* symbol_name =
"cusparseCreateDnVec";
227 dynamic_loading::load_symbol<cusparseCreateDnVec_type>(
233 dnVecDescr, size, values, valueType);
250 const char* symbol_name =
"cusparseDestroySpMat";
253 dynamic_loading::load_symbol<cusparseDestroySpMat_type>(
275 const char* symbol_name =
"cusparseDestroyDnVec";
278 dynamic_loading::load_symbol<cusparseDestroyDnVec_type>(
295 cusparseHandle_t handle,
296 cusparseOperation_t opA,
301 cusparseDnVecDescr_t vecY,
302 cudaDataType computeType,
303 cusparseSpMVAlg_t alg,
309 const char* symbol_name =
"cusparseSpMV_bufferSize";
312 dynamic_loading::load_symbol<cusparseSpMV_bufferSize_type>(
318 handle, opA, alpha, matA, vecX, beta, vecY, computeType, alg,
331 cusparseHandle_t handle,
332 cusparseOperation_t opA,
337 cusparseDnVecDescr_t vecY,
338 cudaDataType computeType,
339 cusparseSpMVAlg_t alg,
340 void* externalBuffer)
345 const char* symbol_name =
"cusparseSpMV";
348 dynamic_loading::load_symbol<cusparseSpMV_type>(
354 handle, opA, alpha, matA, vecX, beta, vecY, computeType, alg,
static cusparseCreateDnVec_type cusparseCreateDnVec
static cusparseCreateCsr_type cusparseCreateCsr
static cusparseDestroyDnVec_type cusparseDestroyDnVec
static cusparseSpMV_type cusparseSpMV
static cusparseDestroy_type cusparseDestroy
static std::string get_lib_name()
Returns the name of cusparse shared library.
static cusparseSpMV_bufferSize_type cusparseSpMV_bufferSize
static cusparseCreateCsc_type cusparseCreateCsc
static cusparseDestroySpMat_type cusparseDestroySpMat
static cusparseCreate_type cusparseCreate
cusparseStatus_t cusparseDestroy(cusparseHandle_t handle)
Definition of CUDA's cusparseDestroy 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.
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 cusparseDestroySpMat(cusparseConstSpMatDescr_t spMatDescr)
Definition of CUDA's cusparseDestroySpMat function using dynamically loaded cublas library.
cusparseStatus_t cusparseCreate(cusparseHandle_t *handle)
Definition of CUDA's cusparseCreate 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 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 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 cusparseDestroyDnVec(cusparseConstDnVecDescr_t dnVecDescr)
Definition of CUDA's cusparseDestroyDnVec function using dynamically loaded cublas library.
cusparseStatus_t(* cusparseSpMV_type)(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)
cusparseStatus_t(* cusparseCreate_type)(cusparseHandle_t *handle)
cusparseStatus_t(* cusparseDestroy_type)(cusparseHandle_t handle)
cusparseStatus_t(* cusparseCreateDnVec_type)(cusparseDnVecDescr_t *dnVecDescr, int64_t size, void *values, cudaDataType valueType)
cusparseStatus_t(* cusparseCreateCsc_type)(cusparseSpMatDescr_t *spMatDescr, int64_t rows, int64_t cols, int64_t nnz, void *cscRowOffsets, void *cscColInd, void *cscValues, cusparseIndexType_t cscRowOffsetsType, cusparseIndexType_t cscColIndType, cusparseIndexBase_t idxBase, cudaDataType valueType)
#define cusparseConstDnVecDescr_t
cusparseStatus_t(* cusparseDestroyDnVec_type)(cusparseConstDnVecDescr_t dnVecDescr)
#define cusparseConstSpMatDescr_t
cusparseStatus_t(* cusparseSpMV_bufferSize_type)(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)
cusparseStatus_t(* cusparseDestroySpMat_type)(cusparseConstSpMatDescr_t spMatDescr)
cusparseStatus_t(* cusparseCreateCsr_type)(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)