Make SCCG test path CPU, CUDA, and HIP capable#422
Conversation
|
Set to draft as it is not ready to merge. |
|
Pushed the HIP update and Doxygen-style documentation. CPU/CUDA SCCG tests and pre-commit pass locally. I can’t test HIP locally, but the HIP SpMV cache reset logic now mirrors the CUDA path. |
|
Good work on this! Tests pass on Frontier, but there are some build warnings: and
Should be straightforward. Just remove what you don't need. |
| vector::Vector* b = new vector::Vector(n); | ||
| b->allocate(memspace_); | ||
| b->allocate(memory::HOST); | ||
| io::updateVectorFromFile(bFile, b); |
There was a problem hiding this comment.
_ for variable names convention
| MatrixHandler& matrixhandler_; ///< Backend-specific matrix handler. | ||
| VectorHandler& vectorhandler_; ///< Backend-specific vector handler. |
There was a problem hiding this comment.
follow naming conventions with _
| ReSolve::VectorHandler vectorHandler(&workspace); | ||
| ReSolve::tests::HykktSchurComplementConjugateGradientTests test(memspace, matrixHandler, vectorHandler); |
There was a problem hiding this comment.
follow naming conventions
Fixed stochastic failures due to a faulty random number generator and asynchronous operations. Co-authored-by: shakedregev <shakedregev@users.noreply.github.com>
Description
This PR addresses the SCCG work for HyKKT from #335 by making the test path work on CPU and CUDA builds. The main issue was that SCCG owned a compile-time-selected workspace internally that caused the CPU test path to construct CUDA workspace resources and segfault during cleanup. The SCCG test also needed to avoid loading file backed matrix and vector data directly into device memory. This change keeps backend ownership with the caller by using caller-provided MatrixHandler and VectorHandler instances and updates the SCCG test setup so file backed data is loaded on host before the CUDA backend is used. No additional dependencies are required for this change.
Related to #335.
Proposed changes
hykkt_sccg_testlocally in both CPU and CUDA builds.These changes should be accepted because they keep backend ownership outside of SCCG and allow the solver/test path to use the existing Re::Solve matrix and vector handler abstractions. This avoids duplicating backend logic inside SCCG and keeps the implementation consistent with the existing CPU/CUDA handler pattern. The data-loading change also keeps file I/O host-side, while still allowing the test to exercise CUDA execution after setup.
Checklist
make testandmake test_installper testing instructions). Code tested on./examples/<your_example>.exe -hto get instructions how to run examples). Code tested on:-Wall -Wpedantic -Wconversion -Wextra.Further comments
I tested the HyKKT SCCG test locally in both CPU and CUDA builds. I did not test the HIP backend locally.
ctest -R hykkt_sccg_test --output-on-failurepassed inbuild-cpuctest -R hykkt_sccg_test --output-on-failurepassed inbuild-cuda