| 68 | |
| 69 | template <typename T> |
| 70 | inline size_t CSR2CSC_get_buffersize( |
| 71 | DeviceSparseHandle& cusparse_H, |
| 72 | const DeviceSpMatCSR<T>& mat_csr, DeviceSpMatCSC<T>& mat_csc |
| 73 | ) { |
| 74 | size_t buffer_size; |
| 75 | CHECK_CUSPARSE( cusparseCsr2cscEx2_bufferSize( |
| 76 | cusparse_H.cusparse_handle, |
| 77 | mat_csr.row_size, mat_csr.col_size, mat_csr.nnz, |
| 78 | mat_csr.vals, mat_csr.row_ptrs, mat_csr.col_ids, |
| 79 | mat_csc.vals, mat_csc.col_ptrs, mat_csc.row_ids, |
| 80 | CudaTypeMapper<T>::value, CUSPARSE_ACTION_NUMERIC, CUSPARSE_INDEX_BASE_ZERO, CUSPARSE_CSR2CSC_ALG_DEFAULT, |
| 81 | &buffer_size |
| 82 | ) ); |
| 83 | return buffer_size; |
| 84 | } |
| 85 | |
| 86 | // suppose buffer already been allocated |
| 87 | template <typename T> |