11 #ifndef _CU_BASIC_ALGEBRA_CUSPARSE_INTERFACE_H_
12 #define _CU_BASIC_ALGEBRA_CUSPARSE_INTERFACE_H_
26 #include "../_definitions/types.h"
40 template <
typename DataType>
42 cusparseSpMatDescr_t& cusparse_matrix,
46 DataType* device_A_data,
51 template <
typename DataType>
53 cusparseDnVecDescr_t& cusparse_vector,
55 DataType* device_vector);
59 cusparseSpMatDescr_t& cusparse_matrix);
63 cusparseDnVecDescr_t& cusparse_vector);
66 template <
typename DataType>
68 cusparseHandle_t cusparse_handle,
69 cusparseOperation_t cusparse_operation,
71 cusparseSpMatDescr_t cusparse_matrix,
72 cusparseDnVecDescr_t cusparse_input_vector,
74 cusparseDnVecDescr_t cusparse_output_vector,
75 cusparseSpMVAlg_t algorithm,
79 template <
typename DataType>
81 cusparseHandle_t cusparse_handle,
82 cusparseOperation_t cusparse_operation,
84 cusparseSpMatDescr_t cusparse_matrix,
85 cusparseDnVecDescr_t cusparse_input_vector,
87 cusparseDnVecDescr_t cusparse_output_vector,
88 cusparseSpMVAlg_t algorithm,
89 void* external_buffer);
A collection of templates to wrapper cusparse functions.
void create_cusparse_matrix(cusparseSpMatDescr_t &cusparse_matrix, const LongIndexType num_rows, const LongIndexType num_columns, const LongIndexType nnz, DataType *device_A_data, LongIndexType *device_A_indices, LongIndexType *device_A_index_pointer)
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(cusparseHandle_t cusparse_handle, cusparseOperation_t cusparse_operation, const DataType alpha, cusparseSpMatDescr_t cusparse_matrix, cusparseDnVecDescr_t cusparse_input_vector, const DataType beta, cusparseDnVecDescr_t cusparse_output_vector, cusparseSpMVAlg_t algorithm, void *external_buffer)
void create_cusparse_vector(cusparseDnVecDescr_t &cusparse_vector, const LongIndexType vector_size, DataType *device_vector)
void cusparse_matrix_buffer_size(cusparseHandle_t cusparse_handle, cusparseOperation_t cusparse_operation, const DataType alpha, cusparseSpMatDescr_t cusparse_matrix, cusparseDnVecDescr_t cusparse_input_vector, const DataType beta, cusparseDnVecDescr_t cusparse_output_vector, cusparseSpMVAlg_t algorithm, size_t *buffer_size)