Skip to content

Commit 5d9e198

Browse files
committed
No uplo for row or column
1 parent dd94814 commit 5d9e198

1 file changed

Lines changed: 39 additions & 23 deletions

File tree

ext/SparseMatrixColoringsCUDAExt.jl

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -97,43 +97,59 @@ end
9797

9898
## Decompression
9999

100-
for R in (:ColumnColoringResult, :RowColoringResult, :StarSetColoringResult)
100+
for R in (:ColumnColoringResult, :RowColoringResult)
101101
# loop to avoid method ambiguity
102102
@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}
107104
)
108-
if uplo != :F
109-
throw(
110-
SMC.UnsupportedDecompressionError(
111-
"Single-triangle decompression is not supported on GPU matrices"
112-
),
113-
)
114-
end
115105
compressed_indices = result.additional_info.compressed_indices_gpu_csc
116106
copyto!(A.nzVal, view(B, compressed_indices))
117107
return A
118108
end
119109

120110
@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}
125112
)
126-
if uplo != :F
127-
throw(
128-
SMC.UnsupportedDecompressionError(
129-
"Single-triangle decompression is not supported on GPU matrices"
130-
),
131-
)
132-
end
133113
compressed_indices = result.additional_info.compressed_indices_gpu_csr
134114
copyto!(A.nzVal, view(B, compressed_indices))
135115
return A
136116
end
137117
end
138118

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+
139155
end

0 commit comments

Comments
 (0)