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

Function CSR2CSC

XM/include/Sparse/sparseformat.h:88–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86// suppose buffer already been allocated
87template <typename T>
88inline void CSR2CSC(
89 DeviceSparseHandle& cusparse_H,
90 const DeviceSpMatCSR<T>& mat_csr, DeviceSpMatCSC<T>& mat_csc
91) {
92 size_t buffer_size = CSR2CSC_get_buffersize(cusparse_H, mat_csr, mat_csc);
93 void* buffer;
94 CHECK_CUDA( cudaMalloc(&buffer, buffer_size) );
95 CHECK_CUSPARSE( cusparseCsr2cscEx2(
96 cusparse_H.cusparse_handle,
97 mat_csr.row_size, mat_csr.col_size, mat_csr.nnz,
98 mat_csr.vals, mat_csr.row_ptrs, mat_csr.col_ids,
99 mat_csc.vals, mat_csc.col_ptrs, mat_csc.row_ids,
100 CudaTypeMapper<T>::value, CUSPARSE_ACTION_NUMERIC, CUSPARSE_INDEX_BASE_ZERO, CUSPARSE_CSR2CSC_ALG_DEFAULT,
101 buffer
102 ) );
103 return;
104}
105
106
107

Callers

nothing calls this directly

Calls 1

CSR2CSC_get_buffersizeFunction · 0.85

Tested by

no test coverage detected