41 cusparseSpMatDescr_t& cusparse_matrix,
50 &cusparse_matrix, num_rows, num_columns, nnz,
51 device_A_index_pointer, device_A_indices, device_A_data,
52 CUSPARSE_INDEX_32I, CUSPARSE_INDEX_32I,
53 CUSPARSE_INDEX_BASE_ZERO, CUDA_R_32F);
55 assert(status == CUSPARSE_STATUS_SUCCESS);
68 cusparseSpMatDescr_t& cusparse_matrix,
72 double* device_A_data,
77 &cusparse_matrix, num_rows, num_columns, nnz,
78 device_A_index_pointer, device_A_indices, device_A_data,
79 CUSPARSE_INDEX_32I, CUSPARSE_INDEX_32I,
80 CUSPARSE_INDEX_BASE_ZERO, CUDA_R_64F);
82 assert(status == CUSPARSE_STATUS_SUCCESS);
99 cusparseDnVecDescr_t& cusparse_vector,
101 float* device_vector)
104 &cusparse_vector, vector_size, device_vector, CUDA_R_32F);
106 assert(status == CUSPARSE_STATUS_SUCCESS);
123 cusparseDnVecDescr_t& cusparse_vector,
125 double* device_vector)
128 &cusparse_vector, vector_size, device_vector, CUDA_R_64F);
130 assert(status == CUSPARSE_STATUS_SUCCESS);
142 cusparseSpMatDescr_t& cusparse_matrix)
145 assert(status == CUSPARSE_STATUS_SUCCESS);
157 cusparseDnVecDescr_t& cusparse_vector)
160 assert(status == CUSPARSE_STATUS_SUCCESS);
175 cusparseHandle_t cusparse_handle,
176 cusparseOperation_t cusparse_operation,
178 cusparseSpMatDescr_t cusparse_matrix,
179 cusparseDnVecDescr_t cusparse_input_vector,
181 cusparseDnVecDescr_t cusparse_output_vector,
182 cusparseSpMVAlg_t algorithm,
186 cusparse_handle, cusparse_operation, &alpha, cusparse_matrix,
187 cusparse_input_vector, &beta, cusparse_output_vector,
188 CUDA_R_32F, algorithm, buffer_size);
190 assert(status == CUSPARSE_STATUS_SUCCESS);
205 cusparseHandle_t cusparse_handle,
206 cusparseOperation_t cusparse_operation,
208 cusparseSpMatDescr_t cusparse_matrix,
209 cusparseDnVecDescr_t cusparse_input_vector,
211 cusparseDnVecDescr_t cusparse_output_vector,
212 cusparseSpMVAlg_t algorithm,
216 cusparse_handle, cusparse_operation, &alpha, cusparse_matrix,
217 cusparse_input_vector, &beta, cusparse_output_vector,
218 CUDA_R_64F, algorithm, buffer_size);
220 assert(status == CUSPARSE_STATUS_SUCCESS);
233 cusparseHandle_t cusparse_handle,
234 cusparseOperation_t cusparse_operation,
236 cusparseSpMatDescr_t cusparse_matrix,
237 cusparseDnVecDescr_t cusparse_input_vector,
239 cusparseDnVecDescr_t cusparse_output_vector,
240 cusparseSpMVAlg_t algorithm,
241 void* external_buffer)
244 cusparse_operation, &alpha,
246 cusparse_input_vector, &beta,
247 cusparse_output_vector,
248 CUDA_R_32F, algorithm,
251 assert(status == CUSPARSE_STATUS_SUCCESS);
264 cusparseHandle_t cusparse_handle,
265 cusparseOperation_t cusparse_operation,
267 cusparseSpMatDescr_t cusparse_matrix,
268 cusparseDnVecDescr_t cusparse_input_vector,
270 cusparseDnVecDescr_t cusparse_output_vector,
271 cusparseSpMVAlg_t algorithm,
272 void* external_buffer)
275 cusparse_operation, &alpha,
277 cusparse_input_vector, &beta,
278 cusparse_output_vector,
279 CUDA_R_64F, algorithm,
282 assert(status == CUSPARSE_STATUS_SUCCESS);
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 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.
A collection of templates to wrapper cusparse functions.
void cusparse_matvec< double >(cusparseHandle_t cusparse_handle, cusparseOperation_t cusparse_operation, const double alpha, cusparseSpMatDescr_t cusparse_matrix, cusparseDnVecDescr_t cusparse_input_vector, const double beta, cusparseDnVecDescr_t cusparse_output_vector, cusparseSpMVAlg_t algorithm, void *external_buffer)
A wrapper for cusparseSpMV to perform sparse matrix-vector multiplication uasing double precision dat...
void cusparse_matrix_buffer_size< float >(cusparseHandle_t cusparse_handle, cusparseOperation_t cusparse_operation, const float alpha, cusparseSpMatDescr_t cusparse_matrix, cusparseDnVecDescr_t cusparse_input_vector, const float beta, cusparseDnVecDescr_t cusparse_output_vector, cusparseSpMVAlg_t algorithm, size_t *buffer_size)
A template wrapper for cusparseSpMat_buffersize for float precision data. This function determines th...
void create_cusparse_matrix< double >(cusparseSpMatDescr_t &cusparse_matrix, const LongIndexType num_rows, const LongIndexType num_columns, const LongIndexType nnz, double *device_A_data, LongIndexType *device_A_indices, LongIndexType *device_A_index_pointer)
A template wrapper for cusparseSpMatDescr_t for the double precision data.
void create_cusparse_vector< double >(cusparseDnVecDescr_t &cusparse_vector, const LongIndexType vector_size, double *device_vector)
A template wrapper for cusparseDnVecDescr_t for the double precision data.
void destroy_cusparse_matrix(cusparseSpMatDescr_t &cusparse_matrix)
Destroys cusparse matrix.
void destroy_cusparse_vector(cusparseDnVecDescr_t &cusparse_vector)
Destroys cusparse vector.
void cusparse_matvec< float >(cusparseHandle_t cusparse_handle, cusparseOperation_t cusparse_operation, const float alpha, cusparseSpMatDescr_t cusparse_matrix, cusparseDnVecDescr_t cusparse_input_vector, const float beta, cusparseDnVecDescr_t cusparse_output_vector, cusparseSpMVAlg_t algorithm, void *external_buffer)
A wrapper for cusparseSpMV to perform sparse matrix-vector multiplication uasing float precision data...
void create_cusparse_vector< float >(cusparseDnVecDescr_t &cusparse_vector, const LongIndexType vector_size, float *device_vector)
A template wrapper for cusparseDnVecDescr_t for the float precision data.
void create_cusparse_matrix< float >(cusparseSpMatDescr_t &cusparse_matrix, const LongIndexType num_rows, const LongIndexType num_columns, const LongIndexType nnz, float *device_A_data, LongIndexType *device_A_indices, LongIndexType *device_A_index_pointer)
A template wrapper for cusparseSpMatDescr_t for the float precision data.
void cusparse_matrix_buffer_size< double >(cusparseHandle_t cusparse_handle, cusparseOperation_t cusparse_operation, const double alpha, cusparseSpMatDescr_t cusparse_matrix, cusparseDnVecDescr_t cusparse_input_vector, const double beta, cusparseDnVecDescr_t cusparse_output_vector, cusparseSpMVAlg_t algorithm, size_t *buffer_size)
A template wrapper for cusparseSpMat_buffersize for double precision data. This function determines t...