MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / SpMV_get_buffersize_cusparse

Function SpMV_get_buffersize_cusparse

XM/include/Sparse/spmatmul.h:10–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <cusparse.h>
9template <typename T>
10inline size_t SpMV_get_buffersize_cusparse(
11 DeviceSparseHandle& cusparse_H,
12 const DeviceSpMatCSR<T>& A, const DeviceDnTen<T>& x, DeviceDnTen<T>& y,
13 const double alpha, const double beta
14) {
15 size_t buffer_size = 0;
16 // Provides deterministic (bit-wise) results for each run only for CUSPARSE_SPMV_COO_ALG2 and
17 // CUSPARSE_SPMV_CSR_ALG2 algorithms, and opA == CUSPARSE_OPERATION_NON_TRANSPOSE
18 // so here default is non-transpose
19 CHECK_CUSPARSE(cusparseSpMV_bufferSize(
20 cusparse_H.cusparse_handle, CUSPARSE_OPERATION_NON_TRANSPOSE,
21 &alpha, A.cusparse_descr, x.cusparse_descr,
22 &beta, y.cusparse_descr,
23 CudaTypeMapper<T>::value, CUSPARSE_SPMV_ALG_DEFAULT, &buffer_size
24 ) );
25 // in doc it said both CSC/CSR can choose CUSPARSE_SPMV_CSR_ALG1
26 return buffer_size;
27}
28
29
30// CSC and CSR is the same code

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected