MUDA
Loading...
Searching...
No Matches
convert.inl
1namespace muda
2{
3// Triplet -> BCOO
4template <typename T, int N>
5void LinearSystemContext::convert(const DeviceTripletMatrix<T, N>& from,
6 DeviceBCOOMatrix<T, N>& to)
7{
8 m_converter.convert(from, to);
9}
10
11// BCOO -> Dense Matrix
12template <typename T, int N>
13void LinearSystemContext::convert(const DeviceBCOOMatrix<T, N>& from,
14 DeviceDenseMatrix<T>& to,
15 bool clear_dense_matrix)
16{
17 m_converter.convert(from, to, clear_dense_matrix);
18}
19
20// BCOO -> COO
21template <typename T, int N>
22void LinearSystemContext::convert(const DeviceBCOOMatrix<T, N>& from,
23 DeviceCOOMatrix<T>& to)
24{
25 m_converter.convert(from, to);
26}
27
28// BCOO -> BSR
29template <typename T, int N>
30void LinearSystemContext::convert(const DeviceBCOOMatrix<T, N>& from,
31 DeviceBSRMatrix<T, N>& to)
32{
33 m_converter.convert(from, to);
34}
35
36// Doublet -> BCOO
37template <typename T, int N>
38void LinearSystemContext::convert(const DeviceDoubletVector<T, N>& from,
39 DeviceBCOOVector<T, N>& to)
40{
41 m_converter.convert(from, to);
42}
43
44// BCOO -> Dense Vector
45template <typename T, int N>
46void LinearSystemContext::convert(const DeviceBCOOVector<T, N>& from,
47 DeviceDenseVector<T>& to,
48 bool clear_dense_vector)
49{
50 m_converter.convert(from, to, clear_dense_vector);
51}
52
53// Doublet -> Dense Vector
54template <typename T, int N>
55void LinearSystemContext::convert(const DeviceDoubletVector<T, N>& from,
56 DeviceDenseVector<T>& to,
57 bool clear_dense_vector)
58{
59 m_converter.convert(from, to, clear_dense_vector);
60}
61
62// BSR -> CSR
63template <typename T, int N>
64void LinearSystemContext::convert(const DeviceBSRMatrix<T, N>& from, DeviceCSRMatrix<T>& to)
65{
66 m_converter.convert(from, to);
67}
68
69// Triplet -> COO
70template <typename T>
71void LinearSystemContext::convert(const DeviceTripletMatrix<T, 1>& from,
72 DeviceCOOMatrix<T>& to)
73{
74 m_converter.convert(from, to);
75}
76
77// COO -> Dense Matrix
78template <typename T>
79void LinearSystemContext::convert(const DeviceCOOMatrix<T>& from,
80 DeviceDenseMatrix<T>& to,
81 bool clear_dense_matrix)
82{
83 m_converter.convert(from, to, clear_dense_matrix);
84}
85
86// COO -> CSR
87template <typename T>
88void LinearSystemContext::convert(const DeviceCOOMatrix<T>& from, DeviceCSRMatrix<T>& to)
89{
90 m_converter.convert(from, to);
91}
92template <typename T>
93void LinearSystemContext::convert(DeviceCOOMatrix<T>&& from, DeviceCSRMatrix<T>& to)
94{
95 m_converter.convert(std::move(from), to);
96}
97
98// Doublet -> COO
99template <typename T>
100void LinearSystemContext::convert(const DeviceDoubletVector<T, 1>& from,
101 DeviceCOOVector<T>& to)
102{
103 m_converter.convert(from, to);
104}
105
106// COO -> Dense Vector
107template <typename T>
108void LinearSystemContext::convert(const DeviceCOOVector<T>& from,
109 DeviceDenseVector<T>& to,
110 bool clear_dense_vector)
111{
112 m_converter.convert(from, to, clear_dense_vector);
113}
114template <typename T>
115void LinearSystemContext::convert(const DeviceDoubletVector<T, 1>& from,
116 DeviceDenseVector<T>& to,
117 bool clear_dense_vector)
118{
119 m_converter.convert(from, to, clear_dense_vector);
120}
121} // namespace muda