47 std::string lib_extension;
49 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || \
51 lib_extension =
"lib";
53 lib_extension =
"dylib";
57 #error "Unknown compiler"
61 #ifndef CUSPARSE_VER_MAJOR
62 #error "CUSPARSE_VER_MAJOR is not defined."
66 std::string lib_base_name =
"libcusparse";
69 std::ostringstream oss;
71 oss << lib_base_name <<
"." << lib_extension <<
"." \
72 << CUSPARSE_VER_MAJOR;
74 std::string lib_name = oss.str();
97 const char* symbol_name =
"cusparseCreate";
100 dynamic_loading::load_symbol<cusparseCreate_type>(
121 const char* symbol_name =
"cusparseDestroy";
124 dynamic_loading::load_symbol<cusparseDestroy_type>(
141 cusparseSpMatDescr_t* spMatDescr,
148 cusparseIndexType_t csrRowOffsetsType,
149 cusparseIndexType_t csrColIndType,
150 cusparseIndexBase_t idxBase,
151 cudaDataType valueType)
156 const char* symbol_name =
"cusparseCreateCsr";
159 dynamic_loading::load_symbol<cusparseCreateCsr_type>(
165 spMatDescr, rows, cols, nnz, csrRowOffsets, csrColInd, csrValues,
166 csrRowOffsetsType, csrColIndType, idxBase, valueType);
178 cusparseDnVecDescr_t* dnVecDescr,
181 cudaDataType valueType)
186 const char* symbol_name =
"cusparseCreateDnVec";
189 dynamic_loading::load_symbol<cusparseCreateDnVec_type>(
195 dnVecDescr, size, values, valueType);
212 const char* symbol_name =
"cusparseDestroySpMat";
215 dynamic_loading::load_symbol<cusparseDestroySpMat_type>(
237 const char* symbol_name =
"cusparseDestroyDnVec";
240 dynamic_loading::load_symbol<cusparseDestroyDnVec_type>(
257 cusparseHandle_t handle,
258 cusparseOperation_t opA,
263 cusparseDnVecDescr_t vecY,
264 cudaDataType computeType,
265 cusparseSpMVAlg_t alg,
271 const char* symbol_name =
"cusparseSpMV_bufferSize";
274 dynamic_loading::load_symbol<cusparseSpMV_bufferSize_type>(
280 handle, opA, alpha, matA, vecX, beta, vecY, computeType, alg,
293 cusparseHandle_t handle,
294 cusparseOperation_t opA,
299 cusparseDnVecDescr_t vecY,
300 cudaDataType computeType,
301 cusparseSpMVAlg_t alg,
302 void* externalBuffer)
307 const char* symbol_name =
"cusparseSpMV";
310 dynamic_loading::load_symbol<cusparseSpMV_type>(
316 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 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 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)
#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)