Skip to content

Fix HyKKT solver reuse and add export support - #464

Merged
shakedregev merged 22 commits into
developfrom
tamar/hykkt-integration-fixes
Aug 3, 2026
Merged

Fix HyKKT solver reuse and add export support#464
shakedregev merged 22 commits into
developfrom
tamar/hykkt-integration-fixes

Conversation

@tamar-dewilde

@tamar-dewilde tamar-dewilde commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR exports the HyKKT libraries and fixes issues found while reusing HyKKTSolver through the HiOp integration.

The existing HyKKT tests primarily covered a single solve. Repeated solves with the same sparsity pattern and updated numerical values exposed stale matrix data, cached solver state, repeated allocations, undersized GPU transpose workspaces, and zero-residual handling issues.

@shakedregev

Proposed changes

  • Export the HyKKT libraries through the installed ReSolve package so downstream packages can link them.
  • Refresh numerical data when HyKKTSolver is reused:
    • Copy updated matrix values into the existing CHOLMOD matrix before numerical factorization.
    • Reload the SpGEMM matrix inputs before each computation.
    • Refresh the external D_s values pointer before each solve.
    • Update the SpGEMM coefficient when gamma changes.
  • Fix CUDA SpGEMM output state. A local C_nnz_ variable shadowed the class member, so the stored output nonzero count was not updated.
  • Resize CUDA and HIP transpose workspaces when a later transpose requires a larger buffer. Reuse the existing allocation when it is large enough and grow it when necessary.
  • Reuse HyKKT allocations:
    • Allocate the SCCG solver and its work vectors once instead of replacing them on every solve.
    • Reuse the existing H_tilde_ allocation when solving without J_d.
    • Reset the SCCG work vectors and scalar state before each solve while reusing their allocations.
  • Remove redundant device synchronizations from the repeated solve path.
  • Preserve the initial J_d state and reject reuse when J_d changes between empty and nonempty. Reuse still requires unchanged sparsity patterns.
  • Handle zero residuals:
    • Return from SCCG when the initial residual is zero to avoid division by zero.
    • Only normalize the final residual when the RHS norm is nonzero.
    • Return an absolute residual when the RHS norm is zero.
  • Add regression coverage for:
    • Solver reuse after refreshing J and RHS data, replacing and updating D_s, and changing gamma.
    • Repeated solves that start without J_d.
    • Rejected reuse when J_d changes from nonempty to empty.
    • Exact zero SCCG residuals and zero RHS values.
    • Reusing one transpose workspace for a small transpose followed by a much larger transpose.

Checklist

  • All tests pass (make test and make test_install per testing instructions). Code tested on
    • CPU backend
    • CUDA backend
    • HIP backend
  • I have manually run the non-experimental examples and verified that residuals are close to machine precision. (In your build directory run: ./examples/<your_example>.exe -h to get instructions how to run examples). Code tested on:
    • CPU backend
    • CUDA backend
    • HIP backend
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows Re::Solve style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

Further comments

The transpose workspace change keeps the current workspace design and grows the CUDA and HIP transpose buffers when needed rather than implementing the broader redesign proposed in #345.

@tamar-dewilde tamar-dewilde self-assigned this Aug 1, 2026
@tamar-dewilde tamar-dewilde added bug Something isn't working enhancement New feature or request hip cuda labels Aug 1, 2026
@tamar-dewilde tamar-dewilde changed the title Tamar/hykkt integration fixes Fix HyKKT solver reuse and add export support Aug 1, 2026

@andrewxu319 andrewxu319 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I can't run it right now, but I left comments.

Comment thread resolve/hykkt/HyKKTSolver.cpp Outdated
<< ", allocated = " << allocated_
<< "\n";
std::cout << "ERROR: Changing J_d between empty and nonempty is not "
"supported when reusing HyKKT.\n";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not put this check directly inside setMatrixBlocks()?

Also, I'm pretty sure that if J_d is empty but J_d_flag_ is true, everything would still work. So if on the first solve J_d is nonempty, then on the second solve J_d is empty, you can keep J_d_flag_ = true and maybe throw a warning about algorithm inefficiency.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

setMatrixBlocks() already performs the compatibility check and records the result in status_. Since it returns void, solve() is where the error is returned.

I tried keeping J_d_flag_ = true after replacing a nonempty J_d with an empty one. The next solve segfaults in Sparse::copyValues(). Reading that path, J_d_scaled_ still has the original nonempty structure while the source is now empty.

I've left the empty/nonempty J_d transition unsupported here. The proposed setup() refactor would be the right place to rebuild the cached state that would make it work.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

solve() returns real_type, so it seems strange to return 1 as an error code. I was suggesting putting the error message directly inside setMatrixBlocks(), and if you want to return something, it makes more sense to return it as an int in setMatrixBlocks().

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I had kept the existing status_ flow because setMatrixBlocks() returned void, so the compatibility result was carried into solve(). I understand now that you were suggesting changing the setter API itself.

setMatrixBlocks() now returns an int and performs the check before updating the stored pointers, so a rejected call leaves the solver in its previous valid state. The error is reported through out::error() rather than std::cout. I removed status_ and the guard from solve(), and the test now checks the setter result directly.

Comment thread resolve/hykkt/HyKKTSolver.cpp Outdated
Comment on lines 395 to 396

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change

Remove these two lines because they're redundant with 413-414

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed them. I also moved loadResultMatrix() into computeSpGEMMHgamma(), since the HIP implementation needs the product and sum dimensions before it initializes the result descriptor.

Comment thread resolve/hykkt/HyKKTSolver.cpp Outdated
matrixHandler_->matvec(J_perm_, omega_perm_, schur_, &ONE, &MINUS_ONE, memspace_);

sccg_ = new SchurComplementConjugateGradient(J_->getNumRows(), J_->getNumColumns(), cholesky_, matrixHandler_, vectorHandler_, memspace_);
if (!allocated_)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Move if (!allocated_) to inside hykkt::HyKKTSolver::solve() (line 207) for consistency.

}

y_->setToZero(memspace_);
z_->setToZero(memspace_);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think you can move lines 106-115 to SchurComplementConjugateGradient::solve() and remove if (!y_). Nobody is going to call this multiple times on the same RHS. Probably doesn't matter that much, but I feel like that's more logical because otherwise the user needs to call setup() before every solve().

Comment thread resolve/hykkt/spgemm/SpGEMM.hpp Outdated

void setAlpha(real_type alpha)
{
impl_->setAlpha(alpha);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Move this to SpGEMM.cpp

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same for SpGEMMCpu.hpp, etc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, might as well rename it setCoefficients or setConstants and let it set both alpha and beta

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Renamed it to setCoefficients(alpha, beta) and updated all three backends to set both values. I added a test that changes beta and checks that the result changes on CPU, CUDA, and HIP. I also removed beta_ = beta from the CPU backend to make sure the test catches it, and it failed as expected.

status *= validateResult(error, tol);

// Replace D_s and restore data modified by the first solve.
std::ifstream D_s_reuse_file(D_s_file_name);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why make these reuse matrices/vectors instead of just modifying the data in J, r_x, r_s, etc?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

J, r_x, r_s, r_y, and r_yd now update in place instead of creating separate reuse copies. I kept D_s as a replacement because the fix refreshes its cached values pointer. Updating the same object would not test that path.

Comment thread tests/unit/hykkt/HykktSolverTests.hpp Outdated
real_type second_error = hykktSolver.solve();
status *= validateResult(second_error, tol);

// Verify an exact zero RHS is handled without producing NaNs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Verify an exact zero RHS is handled without producing NaNs.
// Check that a zero RHS doesn't result in NaNs.

Comment thread tests/unit/hykkt/HykktSolverTests.hpp Outdated
real_type zero_rhs_error = hykktSolver.solve();
status *= validateResult(zero_rhs_error, tol);

// Changing J_d between nonempty and empty invalidates cached solver data.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Changing J_d between nonempty and empty invalidates cached solver data.
// Check that the solver raises an error when trying to change J_d from nonempty to empty.

Comment thread resolve/hykkt/HyKKTSolver.cpp Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* @pre J_d_flag_ determines if variables used for Spgemm H_tilde

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Applied. I reworded it slightly for clarity.

Comment thread resolve/hykkt/HyKKTSolver.cpp Outdated
status_ = true; // when using API, we can't check if sparsity pattern changed
J_d_flag_ = J_d_flag;
// Arbitrary sparsity changes remain the caller's responsibility, but
// switching between empty and nonempty J_d invalidates cached HyKKT data.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Probably for another PR, but I think we should make a separate HyKKTSolver::setup() function and remove the allocated_ flag. This matches other parts of the codebase better. This also allows switching J_d_ from nonempty to empty as long as the user calls setup() first.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This also means you don't need to make a new solver at line 224 of HyKKTSolverTests.hpp, for example.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. I think that makes sense as a follow-up. For now, I kept the separate solver in the test so the empty J_d case still covers initialization and reuse.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Never mind, not possible. Some of the "setup" steps depend on the results of earlier "compute" steps.

@tamar-dewilde

Copy link
Copy Markdown
Collaborator Author

Thanks for the review @andrewxu319 I appreciate it! I made the SCCG lifecycle, SpGEMM, and reuse-test changes. All tests are passing on my end.

@shakedregev shakedregev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, testing.

@tamar-dewilde

Copy link
Copy Markdown
Collaborator Author

Looks good, testing.

The branch has been updated since this comment to move the matrix compatibility error handling into setMatrixBlocks(). Please use the latest version for testing.

@shakedregev shakedregev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good and works, but fix these warnings.

/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:21:12: warning: 'loadProductMatrices' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   21 |       void loadProductMatrices(matrix::Csr* A, matrix::Csr* B);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:28:20: note: overridden virtual function is here
   28 |       virtual void loadProductMatrices(matrix::Csr* A, matrix::Csr* B) = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.cpp:7:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:22:12: warning: 'loadSumMatrix' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   22 |       void loadSumMatrix(matrix::Csr* D);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:29:20: note: overridden virtual function is here
   29 |       virtual void loadSumMatrix(matrix::Csr* D)                       = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.cpp:7:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:23:12: warning: 'loadResultMatrix' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   23 |       void loadResultMatrix(matrix::Csr** E_ptr);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:30:20: note: overridden virtual function is here
   30 |       virtual void loadResultMatrix(matrix::Csr** E_ptr)               = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.cpp:7:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:25:12: warning: 'compute' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   25 |       void compute();
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:32:20: note: overridden virtual function is here
   32 |       virtual void compute() = 0;
      |                    ^
4 warnings generated when compiling for gfx90a.
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMM.cpp:8:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:21:12: warning: 'loadProductMatrices' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   21 |       void loadProductMatrices(matrix::Csr* A, matrix::Csr* B);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:28:20: note: overridden virtual function is here
   28 |       virtual void loadProductMatrices(matrix::Csr* A, matrix::Csr* B) = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMM.cpp:8:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:22:12: warning: 'loadSumMatrix' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   22 |       void loadSumMatrix(matrix::Csr* D);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:29:20: note: overridden virtual function is here
   29 |       virtual void loadSumMatrix(matrix::Csr* D)                       = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMM.cpp:8:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:23:12: warning: 'loadResultMatrix' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   23 |       void loadResultMatrix(matrix::Csr** E_ptr);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:30:20: note: overridden virtual function is here
   30 |       virtual void loadResultMatrix(matrix::Csr** E_ptr)               = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMM.cpp:8:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:25:12: warning: 'compute' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   25 |       void compute();
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:32:20: note: overridden virtual function is here
   32 |       virtual void compute() = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMM.cpp:12:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.hpp:27:12: warning: 'loadProductMatrices' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   27 |       void loadProductMatrices(matrix::Csr* A, matrix::Csr* B);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:28:20: note: overridden virtual function is here
   28 |       virtual void loadProductMatrices(matrix::Csr* A, matrix::Csr* B) = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMM.cpp:12:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.hpp:28:12: warning: 'loadSumMatrix' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   28 |       void loadSumMatrix(matrix::Csr* D);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:29:20: note: overridden virtual function is here
   29 |       virtual void loadSumMatrix(matrix::Csr* D)                       = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMM.cpp:12:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.hpp:29:12: warning: 'loadResultMatrix' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   29 |       void loadResultMatrix(matrix::Csr** E_ptr);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:30:20: note: overridden virtual function is here
   30 |       virtual void loadResultMatrix(matrix::Csr** E_ptr)               = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMM.cpp:12:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.hpp:31:12: warning: 'compute' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   31 |       void compute();
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:32:20: note: overridden virtual function is here
   32 |       virtual void compute() = 0;
      |                    ^
8 warnings generated when compiling for gfx90a.
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.cpp:7:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.hpp:27:12: warning: 'loadProductMatrices' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   27 |       void loadProductMatrices(matrix::Csr* A, matrix::Csr* B);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:28:20: note: overridden virtual function is here
   28 |       virtual void loadProductMatrices(matrix::Csr* A, matrix::Csr* B) = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.cpp:7:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.hpp:28:12: warning: 'loadSumMatrix' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   28 |       void loadSumMatrix(matrix::Csr* D);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:29:20: note: overridden virtual function is here
   29 |       virtual void loadSumMatrix(matrix::Csr* D)                       = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.cpp:7:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.hpp:29:12: warning: 'loadResultMatrix' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   29 |       void loadResultMatrix(matrix::Csr** E_ptr);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:30:20: note: overridden virtual function is here
   30 |       virtual void loadResultMatrix(matrix::Csr** E_ptr)               = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.cpp:7:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMHip.hpp:31:12: warning: 'compute' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   31 |       void compute();
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:32:20: note: overridden virtual function is here
   32 |       virtual void compute() = 0;
      |                    ^
4 warnings generated when compiling for gfx90a.
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.cpp:7:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:21:12: warning: 'loadProductMatrices' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   21 |       void loadProductMatrices(matrix::Csr* A, matrix::Csr* B);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:28:20: note: overridden virtual function is here
   28 |       virtual void loadProductMatrices(matrix::Csr* A, matrix::Csr* B) = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.cpp:7:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:22:12: warning: 'loadSumMatrix' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   22 |       void loadSumMatrix(matrix::Csr* D);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:29:20: note: overridden virtual function is here
   29 |       virtual void loadSumMatrix(matrix::Csr* D)                       = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.cpp:7:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:23:12: warning: 'loadResultMatrix' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   23 |       void loadResultMatrix(matrix::Csr** E_ptr);
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:30:20: note: overridden virtual function is here
   30 |       virtual void loadResultMatrix(matrix::Csr** E_ptr)               = 0;
      |                    ^
In file included from /ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.cpp:7:
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMCpu.hpp:25:12: warning: 'compute' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   25 |       void compute();
      |            ^
/ccs/home/regevs/ReSolve_dir/ReSolve/resolve/hykkt/spgemm/SpGEMMImpl.hpp:32:20: note: overridden virtual function is here
   32 |       virtual void compute() = 0;

@tamar-dewilde

Copy link
Copy Markdown
Collaborator Author

Looks good and works, but fix these warnings.

Fixed the missing override specifiers in the CPU and HIP SpGEMM declarations. I reran the CPU, CUDA, and HIP warning builds and tests, along with the HiOp HyKKT tests. Everything passed, and the warnings are gone.

@shakedregev shakedregev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great work

@shakedregev
shakedregev merged commit 6b14bd4 into develop Aug 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda enhancement New feature or request hip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants