| 15 | // COOsort |
| 16 | template <typename T> |
| 17 | inline void COOsort( |
| 18 | int* row_ids, int* col_ids, T* vals, const size_l nnz |
| 19 | ) { |
| 20 | // Use zip_iterator to create tuples (row, col, val) for sorting |
| 21 | auto begin = thrust::make_zip_iterator(thrust::make_tuple(thrust::device_pointer_cast(row_ids), thrust::device_pointer_cast(col_ids), thrust::device_pointer_cast(vals))); |
| 22 | auto end = thrust::make_zip_iterator(thrust::make_tuple(thrust::device_pointer_cast(row_ids + nnz), thrust::device_pointer_cast(col_ids + nnz), thrust::device_pointer_cast(vals + nnz))); |
| 23 | |
| 24 | // Sort by row first, then by column for identical rows |
| 25 | thrust::sort(begin, end, thrust::less<thrust::tuple<int, int, T>>()); |
| 26 | return; |
| 27 | } |
| 28 | |
| 29 | // convert CSC format in cusparse to CSR format in cusparse |
| 30 | // this routine needs additional memories on device |
nothing calls this directly
no outgoing calls
no test coverage detected