|
97 | 97 |
|
98 | 98 | ## Decompression |
99 | 99 |
|
100 | | -for R in (:ColumnColoringResult, :RowColoringResult, :StarSetColoringResult) |
| 100 | +for R in (:ColumnColoringResult, :RowColoringResult) |
101 | 101 | # loop to avoid method ambiguity |
102 | 102 | @eval function SMC.decompress!( |
103 | | - A::CuSparseMatrixCSC, |
104 | | - B::CuMatrix, |
105 | | - result::SMC.$R{<:CuSparseMatrixCSC}, |
106 | | - uplo::Symbol=:F, |
| 103 | + A::CuSparseMatrixCSC, B::CuMatrix, result::SMC.$R{<:CuSparseMatrixCSC} |
107 | 104 | ) |
108 | | - if uplo != :F |
109 | | - throw( |
110 | | - SMC.UnsupportedDecompressionError( |
111 | | - "Single-triangle decompression is not supported on GPU matrices" |
112 | | - ), |
113 | | - ) |
114 | | - end |
115 | 105 | compressed_indices = result.additional_info.compressed_indices_gpu_csc |
116 | 106 | copyto!(A.nzVal, view(B, compressed_indices)) |
117 | 107 | return A |
118 | 108 | end |
119 | 109 |
|
120 | 110 | @eval function SMC.decompress!( |
121 | | - A::CuSparseMatrixCSR, |
122 | | - B::CuMatrix, |
123 | | - result::SMC.$R{<:CuSparseMatrixCSR}, |
124 | | - uplo::Symbol=:F, |
| 111 | + A::CuSparseMatrixCSR, B::CuMatrix, result::SMC.$R{<:CuSparseMatrixCSR} |
125 | 112 | ) |
126 | | - if uplo != :F |
127 | | - throw( |
128 | | - SMC.UnsupportedDecompressionError( |
129 | | - "Single-triangle decompression is not supported on GPU matrices" |
130 | | - ), |
131 | | - ) |
132 | | - end |
133 | 113 | compressed_indices = result.additional_info.compressed_indices_gpu_csr |
134 | 114 | copyto!(A.nzVal, view(B, compressed_indices)) |
135 | 115 | return A |
136 | 116 | end |
137 | 117 | end |
138 | 118 |
|
| 119 | +function SMC.decompress!( |
| 120 | + A::CuSparseMatrixCSC, |
| 121 | + B::CuMatrix, |
| 122 | + result::SMC.StarSetColoringResult{<:CuSparseMatrixCSC}, |
| 123 | + uplo::Symbol=:F, |
| 124 | +) |
| 125 | + if uplo != :F |
| 126 | + throw( |
| 127 | + SMC.UnsupportedDecompressionError( |
| 128 | + "Single-triangle decompression is not supported on GPU matrices" |
| 129 | + ), |
| 130 | + ) |
| 131 | + end |
| 132 | + compressed_indices = result.additional_info.compressed_indices_gpu_csc |
| 133 | + copyto!(A.nzVal, view(B, compressed_indices)) |
| 134 | + return A |
| 135 | +end |
| 136 | + |
| 137 | +function SMC.decompress!( |
| 138 | + A::CuSparseMatrixCSR, |
| 139 | + B::CuMatrix, |
| 140 | + result::SMC.StarSetColoringResult{<:CuSparseMatrixCSR}, |
| 141 | + uplo::Symbol=:F, |
| 142 | +) |
| 143 | + if uplo != :F |
| 144 | + throw( |
| 145 | + SMC.UnsupportedDecompressionError( |
| 146 | + "Single-triangle decompression is not supported on GPU matrices" |
| 147 | + ), |
| 148 | + ) |
| 149 | + end |
| 150 | + compressed_indices = result.additional_info.compressed_indices_gpu_csr |
| 151 | + copyto!(A.nzVal, view(B, compressed_indices)) |
| 152 | + return A |
| 153 | +end |
| 154 | + |
139 | 155 | end |
0 commit comments