imate
C++/CUDA Reference
|
A collection of templates to wrapper cusparse functions. More...
Functions | |
template<> | |
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. More... | |
template<> | |
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. More... | |
template<> | |
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. More... | |
template<> | |
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. More... | |
void | destroy_cusparse_matrix (cusparseSpMatDescr_t &cusparse_matrix) |
Destroys cusparse matrix. More... | |
void | destroy_cusparse_vector (cusparseDnVecDescr_t &cusparse_vector) |
Destroys cusparse vector. More... | |
template<> | |
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 the buffer size needed for matrix-vector multiplication using cusparseSpMV . The output is buffer_size variable. More... | |
template<> | |
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 the buffer size needed for matrix-vector multiplication using cusparseSpMV . The output is buffer_size variable. More... | |
template<> | |
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. More... | |
template<> | |
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 data. More... | |
template<typename DataType > | |
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) |
template<typename DataType > | |
void | create_cusparse_vector (cusparseDnVecDescr_t &cusparse_vector, const LongIndexType vector_size, DataType *device_vector) |
template<typename DataType > | |
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) |
template<typename DataType > | |
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) |
A collection of templates to wrapper cusparse functions.
cu
file is wrapped inside the namepsace clause. This is not necessary in general, however, it is needed to avoid the old gcc compiler error (this is a gcc bug) which complains "no instance of function template matches
the argument list const float". void cusparse_interface::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 | ||
) |
Referenced by cuCSCMatrix< DataType >::copy_host_to_device(), and cuCSRMatrix< DataType >::copy_host_to_device().
void cusparse_interface::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.
Definition at line 67 of file cusparse_interface.cu.
References cusparseCreateCsr().
void cusparse_interface::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.
Definition at line 40 of file cusparse_interface.cu.
References cusparseCreateCsr().
void cusparse_interface::create_cusparse_vector | ( | cusparseDnVecDescr_t & | cusparse_vector, |
const LongIndexType | vector_size, | ||
DataType * | device_vector | ||
) |
Referenced by cuCSCMatrix< DataType >::dot(), cuCSRMatrix< DataType >::dot(), cuCSCMatrix< DataType >::dot_plus(), cuCSRMatrix< DataType >::dot_plus(), cuCSCMatrix< DataType >::transpose_dot(), cuCSRMatrix< DataType >::transpose_dot(), cuCSCMatrix< DataType >::transpose_dot_plus(), and cuCSRMatrix< DataType >::transpose_dot_plus().
void cusparse_interface::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.
Note that according to the cusparse documentation for the function cusparseCreateDnVec
, it is safe to use const_cast
to cast the input vector.
Definition at line 122 of file cusparse_interface.cu.
References cusparseCreateDnVec().
void cusparse_interface::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.
Note that according to the cusparse documentation for the function cusparseCreateDnVec
, it is safe to use const_cast
to cast the input vector.
Definition at line 98 of file cusparse_interface.cu.
References cusparseCreateDnVec().
void cusparse_interface::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 | ||
) |
Referenced by cuCSCMatrix< DataType >::allocate_buffer(), and cuCSRMatrix< DataType >::allocate_buffer().
void cusparse_interface::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 the buffer size needed for matrix-vector multiplication using cusparseSpMV
. The output is buffer_size
variable.
Definition at line 204 of file cusparse_interface.cu.
References cusparseSpMV_bufferSize().
void cusparse_interface::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 the buffer size needed for matrix-vector multiplication using cusparseSpMV
. The output is buffer_size
variable.
Definition at line 174 of file cusparse_interface.cu.
References cusparseSpMV_bufferSize().
void cusparse_interface::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 | ||
) |
Referenced by cuCSCMatrix< DataType >::dot(), cuCSRMatrix< DataType >::dot(), cuCSCMatrix< DataType >::dot_plus(), cuCSRMatrix< DataType >::dot_plus(), cuCSCMatrix< DataType >::transpose_dot(), cuCSRMatrix< DataType >::transpose_dot(), cuCSCMatrix< DataType >::transpose_dot_plus(), and cuCSRMatrix< DataType >::transpose_dot_plus().
void cusparse_interface::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 data.
Definition at line 263 of file cusparse_interface.cu.
References cusparseSpMV().
void cusparse_interface::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.
Definition at line 232 of file cusparse_interface.cu.
References cusparseSpMV().
void cusparse_interface::destroy_cusparse_matrix | ( | cusparseSpMatDescr_t & | cusparse_matrix | ) |
Destroys cusparse matrix.
Definition at line 141 of file cusparse_interface.cu.
References cusparseDestroySpMat().
Referenced by cuCSCMatrix< DataType >::~cuCSCMatrix(), and cuCSRMatrix< DataType >::~cuCSRMatrix().
void cusparse_interface::destroy_cusparse_vector | ( | cusparseDnVecDescr_t & | cusparse_vector | ) |
Destroys cusparse vector.
Definition at line 156 of file cusparse_interface.cu.
References cusparseDestroyDnVec().
Referenced by cuCSCMatrix< DataType >::dot(), cuCSRMatrix< DataType >::dot(), cuCSCMatrix< DataType >::dot_plus(), cuCSRMatrix< DataType >::dot_plus(), cuCSCMatrix< DataType >::transpose_dot(), cuCSRMatrix< DataType >::transpose_dot(), cuCSCMatrix< DataType >::transpose_dot_plus(), and cuCSRMatrix< DataType >::transpose_dot_plus().