Skip to content

Commit 4a2e3a1

Browse files
committed
Implement "scattered Gustavson's," add testing, ensure works in ArmPL.
1 parent b13e998 commit 4a2e3a1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#pragma once
2+
3+
#include <armpl_sparse.h>
4+
#include <spblas/detail/view_inspectors.hpp>
5+
6+
namespace spblas {
7+
8+
namespace __armpl {
9+
10+
template <matrix M, typename O>
11+
requires __detail::is_csr_view_v<M>
12+
void export_matrix_handle(operation_info_t& info, M&& m, armpl_spmat_t m_handle) {
13+
auto nnz = info.result_nnz();
14+
armpl_int_t m, n;
15+
armpl_int_t *rowptr, *colind;
16+
tensor_scalar_t<M>* values;
17+
__armpl::export_spmat_csr<tensor_scalar_t<M>>(m_handle, 0, &m, &n, &rowptr,
18+
&colind, &values);
19+
20+
std::copy(values, values + nnz, m.values().begin());
21+
std::copy(colind, colind + nnz, m.colind().begin());
22+
std::copy(rowptr, rowptr + m + 1, m.rowptr().begin());
23+
24+
free(values);
25+
free(rowptr);
26+
free(colind);
27+
}
28+
29+
}
30+
31+
}

0 commit comments

Comments
 (0)