Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of spdiagm for CUSPARSE #2458

Merged
merged 6 commits into from
Aug 7, 2024
Merged

Conversation

walexaindre
Copy link
Contributor

@walexaindre walexaindre commented Aug 5, 2024

Here is the implementation of SparseArrays.spdiagm(vec)

The one(Int32) and Int32 conversions are used to reduce allocations and enhance the performance of this simple function.

Closes #1857

Copy link
Member

@amontoison amontoison left a comment

Choose a reason for hiding this comment

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

Can you add a test for your implementation of spdiagm?

lib/cusparse/array.jl Outdated Show resolved Hide resolved
Co-authored-by: Alexis Montoison <[email protected]>
@walexaindre
Copy link
Contributor Author

walexaindre commented Aug 6, 2024

Thank you @amontoison for looking at my PR. I can implement that test but I am confused about where I need to do that exactly.

Can you suggest me a possible file where I can write that test?

I was thinking about generic.jl or interfaces.jl. However, generic.jl looks like a place where some basic operations between matrix and vectors are tested and interfaces.jl looks like a file where linear algebra related functions are the main theme.

I belive that interfaces.jl could be the correct place. But if you can shed some light on the logic behind file organization and where it is expected to implement something like this, I would appreciate it.

@walexaindre
Copy link
Contributor Author

walexaindre commented Aug 6, 2024

For now, tests are implemented as a new test section in interfaces.jl

walexaindre

This comment was marked as resolved.

@amontoison
Copy link
Member

For now, tests are implemented as a new test section in interfaces.jl

The test files interfaces.jl and linalg.jl are fine.
LGTM!

@maleadt maleadt merged commit f689f04 into JuliaGPU:master Aug 7, 2024
1 check passed
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.

Creating a sparse diagonal matrix of CuArray(u)
3 participants