Use Kokkos::Parallel in Solver Utils#270
Conversation
|
@EmilyBourne Can you make "ExactSolution" callable on GPU? Then all Kokkos Loops should be finished. |
Ah, I had hoped to avoid this 😅 I will open a PR to remove the inheritance from |
I have put this in draft temporarily until this is fixed |
Actually we can avoid removing the inheritance. We just need to put either a void calculate_error(Vector<double> error, ConstVector<T> r, ConstVector<T> theta, ConstVector<T> exact_solution) const;method in void exact_solution(ConstVector<T> r, ConstVector<T> theta, Vector<T> exact) const;@AbdelhadiKara will take care of this |
Added a host vector for exact solution values in solver.h.
|
@AbdelhadiKara I tried fixing my previous version based on your suggestions. In my version I just used a single host vector which is then transfered to the error vector (device memory in the future). Then I just used the provided subract() function of the LinearAlgebra class. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #270 +/- ##
==========================================
+ Coverage 95.73% 95.75% +0.02%
==========================================
Files 79 79
Lines 8492 8535 +43
==========================================
+ Hits 8130 8173 +43
Misses 362 362 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| if (i_r & 1 || i_theta & 1) { | ||
| fine_values[fineGrid.index(i_r, i_theta)] *= 4.0 / 3.0; | ||
| } | ||
| else { |
There was a problem hiding this comment.
is there a possibility to avoid if condition inside the kernel ?
There was a problem hiding this comment.
I don't think so.
When everything is ported to the GPU we can evaluate how the kernels can be optimized.
There was a problem hiding this comment.
I thought the issue isn't not necessarily the branches but the amount a time a thread idles to wait for expensive computations in another thread execution path to finish. (Which is minimal here)
The waiting time for =* 3.0/4.0 to finish is almost none.
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):