Skip to content

Conversation

@kshyatt
Copy link
Member

@kshyatt kshyatt commented Nov 17, 2025

Base.require_one_based_indexing returns a Bool on some versions, not n (integer).

Converting to the full CuMatrix/ROCMatrix is inefficient/ugly but dispatching on a SubArray of a Diagonal of a CuVector (or ROCVector) is also really ugly. Not sure what the best approach is here, but this works for now (we can revisit if it's really problematic).

@kshyatt kshyatt requested a review from lkdvos November 17, 2025 18:31
Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it only the Diagonal giving issues?
We could also just add a specialization for Diagonal in general, which we should be able to handle in a GPU friendly way:

function project_hermitian_native!(A::Diagonal, B::Diagonal, ::Val{anti}) where {anti}
   if anti
       diagview(A) .= imag.(diagview(B)) .* im
   else
       diagview(A) .= real.(diagview(B))
   end
end

[edit] I think we have a utility function somewhere for the imaginary part, I can't remember the name though

@kshyatt
Copy link
Member Author

kshyatt commented Nov 17, 2025

That's also fine, I wrote this in the post lunch carb coma there's probably a better way

@lkdvos
Copy link
Member

lkdvos commented Nov 17, 2025

I guess the diagonal specialization is something we want anyways so that might make sense?

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ixAlgebraKitAMDGPUExt/MatrixAlgebraKitAMDGPUExt.jl 0.00% 1 Missing ⚠️
...MatrixAlgebraKitCUDAExt/MatrixAlgebraKitCUDAExt.jl 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/implementations/projections.jl 96.20% <100.00%> (+0.09%) ⬆️
...ixAlgebraKitAMDGPUExt/MatrixAlgebraKitAMDGPUExt.jl 80.88% <0.00%> (-1.21%) ⬇️
...MatrixAlgebraKitCUDAExt/MatrixAlgebraKitCUDAExt.jl 56.66% <0.00%> (-0.97%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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