Make CSRMatrix GPU compatible#244
Conversation
2132ce1 to
96fb608
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #244 +/- ##
==========================================
+ Coverage 90.72% 90.74% +0.02%
==========================================
Files 86 86
Lines 9473 9499 +26
==========================================
+ Hits 8594 8620 +26
Misses 879 879 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
We can also just define the COO/CSR similar to the batched tridiagonal solver. There using AllocatableVector is enough to make it Kokkos compliant. |
That's just because we haven't started calling it from kokkos loops yet. Once we do we will see that functions such as: GMGPolar/include/LinearAlgebra/Solvers/tridiagonal_solver.h Lines 75 to 79 in 96be62d will become uncallable (as objects are captured by const copy). At that point the only way to distinguish between a getter and a setter is by changing the internal type as I have done here |
|
In #239 I already capture the tridiagonal batched matrices by copy in the kokkos lambda and it works |
|
It is probably not necessary to do the const pointer tricks as far as I can tell. Dont supply a supply custom copy or move semantics and using AllocatableVector in the members and using const setters and getter seems to work fine. The const pointer things are not needed right? |
Ah yes this should work too. If you have an explicitly const getter and setter then there is no ambiguity. The design that I propose here is intended to minimise the number of changes in the rest of the code and keep readability there. So we keep The decision between the 2 options comes down to:
|
The custom move semantics are fine. They are not used by Kokkos |
|
Small comments improvements: |
I agree with nearly all these changes, but why do you suggest removing an assertion: assert(static_cast<size_t>(this->nnz_) <= static_cast<size_t>(this->rows_) * static_cast<size_t>(this->columns_));? |
Lots of annoying static cast just to prevent overflows. |
|
@julianlitz I have created #250 to compare the amount of code required between the 2 methods. I am leaning towards #250 in the end. It changes ~100 lines less code. It is a shame that |
|
@EmilyBourne Sure go for 250 then |





Merge Request - GuideLine Checklist
Guideline to check code before resolve WIP and approval, respectively.
As many checkboxes as possible should be ticked.
Checks by code author:
Always to be checked:
If functions were changed or functionality was added:
If new functionality was added:
If new third party software is used:
If new mathematical methods or epidemiological terms are used:
Checks by code reviewer(s):