Skip to content

Conversation

@albertomercurio
Copy link
Owner

Adjusted c_result initialization.

Adjusted c_result initialization.
@github-actions
Copy link

🤖 Hi @albertomercurio, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

📋 Review Summary

This Pull Request addresses a syntax fix and a crucial initialization correction in the README.md example. The changes improve the correctness and idiomatic style of the code snippet.

🔍 General Feedback

  • The changes are well-targeted and directly resolve potential issues in the example code.
  • The correction for c_result initialization is important for the mul! function to execute without errors.


# Convert to DeviceSparseMatrixCSC (CPU by default)
A_device = DeviceSparseMatrixCSC(A_sparse);
A_device = DeviceSparseMatrixCSC(A_sparse)

Choose a reason for hiding this comment

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

🟢 It's good practice to omit the semicolon in Julia examples unless output suppression is explicitly desired for clarity or brevity in an interactive session. Removing it makes the example more idiomatic.

Suggested change
A_device = DeviceSparseMatrixCSC(A_sparse)
A_device = DeviceSparseMatrixCSC(A_sparse)


# You can also use the in-place mul! function
c_result = similar(b)
c_result = similar(b, 100)

Choose a reason for hiding this comment

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

🟠 The similar(b, 100) modification correctly addresses a dimension mismatch. The result of A_device * b will be a vector with 100 elements, so c_result must be initialized to that size for mul! to work correctly. Great catch and fix!

Suggested change
c_result = similar(b, 100)
c_result = similar(b, 100)

@albertomercurio albertomercurio merged commit a011ca4 into main Nov 13, 2025
21 checks passed
@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.34%. Comparing base (17d03ca) to head (388dd36).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #23   +/-   ##
=======================================
  Coverage   84.34%   84.34%           
=======================================
  Files          13       13           
  Lines         728      728           
=======================================
  Hits          614      614           
  Misses        114      114           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

2 participants