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

Function CSC2CSR

XM/include/Sparse/sparseformat.h:51–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49// suppose buffer already been allocated
50template <typename T>
51inline void CSC2CSR(
52 DeviceSparseHandle& cusparse_H,
53 const DeviceSpMatCSC<T>& mat_csc, DeviceSpMatCSR<T>& mat_csr
54) {
55 size_t buffer_size = CSC2CSR_get_buffersize(cusparse_H, mat_csc, mat_csr);
56 void* buffer;
57 CHECK_CUDA( cudaMalloc(&buffer, buffer_size) );
58 CHECK_CUSPARSE( cusparseCsr2cscEx2(
59 cusparse_H.cusparse_handle,
60 mat_csc.col_size, mat_csc.row_size, mat_csc.nnz,
61 mat_csc.vals, mat_csc.col_ptrs, mat_csc.row_ids,
62 mat_csr.vals, mat_csr.row_ptrs, mat_csr.col_ids,
63 CudaTypeMapper<T>::value, CUSPARSE_ACTION_NUMERIC, CUSPARSE_INDEX_BASE_ZERO, CUSPARSE_CSR2CSC_ALG_DEFAULT,
64 buffer
65 ) );
66 return;
67}
68
69template <typename T>
70inline size_t CSR2CSC_get_buffersize(

Callers 1

checkeigFunction · 0.85

Calls 1

CSC2CSR_get_buffersizeFunction · 0.85

Tested by

no test coverage detected