Skip to content

Conversation

@nkoukpaizan
Copy link
Collaborator

@nkoukpaizan nkoukpaizan commented Sep 10, 2025

Description

There were some integer conversion warnings on r_KLU_rocsolverrf_asym6x6 due to the use of std::vector, which is indexed differently from Re::Solve storage.

ReSolve/examples/experimental/r_KLU_rocsolverrf_asym6x6.cpp:52:37: warning: implicit conversion changes signedness: 'int' to 'size_type' (aka 'unsigned long') [-Wsign-conversion]
   52 |   std::vector<int>    csr_row_ptr(n + 1, 0);

Proposed changes

Use static_cast to ensure the proper integer types are used to index std::vector and to instantiate Re::Solve matrices and vectors.

Checklist

  • All tests pass. Code tested on
    • CPU backend
    • CUDA backend
    • HIP backend
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • [N/A] The new code follows Re::Solve style guidelines.
  • [N/A] There are unit tests for the new code.
  • [N/A] The new code is documented.
  • The feature branch is rebased with respect to the target branch.

Further comments

We could consider avoiding the use of std::vector here altogether. I'm for keeping it, as this is an example, and users should be free to use whatever storage they wish.

Copy link
Collaborator

@shakedregev shakedregev left a comment

Choose a reason for hiding this comment

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

Approving and updating documentation.

@shakedregev shakedregev merged commit c2eba23 into develop Sep 10, 2025
6 checks passed
@shakedregev shakedregev deleted the nicholson/fix-warnings-asym6x6 branch September 10, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants