Skip to content

Fix type usage in opnorm for AbstractGPUSparseMatrixCSC - #747

Merged
kshyatt merged 3 commits into
mainfrom
ChrisRackauckas-patch-1
Aug 14, 2026
Merged

Fix type usage in opnorm for AbstractGPUSparseMatrixCSC#747
kshyatt merged 3 commits into
mainfrom
ChrisRackauckas-patch-1

Conversation

@ChrisRackauckas

Copy link
Copy Markdown
Member

@ChrisRackauckas

Copy link
Copy Markdown
Member Author

The other possible fix is to add a dispatch to csr_type(A::cuSPARSE.CuSparseMatrixCSC) = csr_type((typeof(A)), not sure which is preferred.

@kshyatt
kshyatt force-pushed the ChrisRackauckas-patch-1 branch from d7d6af3 to 151d85c Compare August 13, 2026 07:20
@kshyatt

kshyatt commented Aug 13, 2026

Copy link
Copy Markdown
Member

Fails look related now

@christiangnrd

christiangnrd commented Aug 13, 2026

Copy link
Copy Markdown
Member

@kshyatt This function is defined according to the definition in the GPUArrays readme in CUDA.jl (takes in the array type), but not JLArrays (takes in the array), but it's used as defined in JLArrays in mapreduce

if A isa AbstractGPUSparseMatrixCSR && dims == 1
A = csc_type(A)(A)
elseif A isa AbstractGPUSparseMatrixCSC && dims == 2
A = csr_type(A)(A)

I suggest we fix this in JLArrays and define csr_type(A<:AbstractGPUSparseMatrix) = csr_type(typeof(A)) (and the csc_type equivalent

@kshyatt

kshyatt commented Aug 13, 2026

Copy link
Copy Markdown
Member

Sounds good, should we do this in this PR?

@christiangnrd

Copy link
Copy Markdown
Member

Sounds good, should we do this in this PR?

Yeah I'll push

@christiangnrd
christiangnrd force-pushed the ChrisRackauckas-patch-1 branch from bbc4e20 to 639b5bd Compare August 13, 2026 12:13
@kshyatt
kshyatt merged commit 45e0ab7 into main Aug 14, 2026
18 checks passed
@kshyatt
kshyatt deleted the ChrisRackauckas-patch-1 branch August 14, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants