Fh kokkos b spline - #3
Conversation
…simLandIceMeshGen into fh_Kokkos_BSpline
|
@hsiehhRPI Was clang-format ran on this? I saw some long lines (>80 chars) that I would have expected it to break into multiple lines. |
cwsmith
left a comment
There was a problem hiding this comment.
Please carefully review the comments on the rank 1 implementation/tests/etc and ensure that they are addressed in the rank 2 version if the same code exists there.
…sieh <hsiehh@checkers.scorec.rpi.edu>
…: Hsieh <hsiehh@checkers.scorec.rpi.edu>
…tter: Hsieh <hsiehh@checkers.scorec.rpi.edu>
…hh@checkers.scorec.rpi.edu>
…itter: Hsieh <hsiehh@checkers.scorec.rpi.edu>
…eh <hsiehh@checkers.scorec.rpi.edu>
…r: Hsieh <hsiehh@checkers.scorec.rpi.edu>
… test for GPU# Committer: Hsieh <hsiehh@checkers.scorec.rpi.edu>
…ieh <hsiehh@checkers.scorec.rpi.edu>
… Hsieh <hsiehh@checkers.scorec.rpi.edu>
…itter: Hsieh <hsiehh@checkers.scorec.rpi.edu>
…h cpu and gpu# Committer: Hsieh <hsiehh@checkers.scorec.rpi.edu>
…mespace# Committer: Hsieh <hsiehh@checkers.scorec.rpi.edu>
…views in derivative call functions Committer: Hsieh <hsiehh@checkers.scorec.rpi.edu>
…tion to simplify the input to the device functions # Committer: Hsieh <hsiehh@checkers.scorec.rpi.edu>
…ckers.scorec.rpi.edu>
…s # Committer: Hsieh <hsiehh@checkers.scorec.rpi.edu>
…s.scorec.rpi.edu>
|
Hello Dr. Smith, I have ran clang-format and have a commit with only clang formatting and no logical changes. The line lengths should now be at most 80 characters. |
| const int order, const Kokkos::View<double *, MemSpace> knots, | ||
| const Kokkos::View<double *[2], MemSpace> ctrlPts_1stD) const { | ||
| // DeBoor's algorithm for BSpline 1st deriv calculation | ||
| const int MAX_DEGREE = 3; |
There was a problem hiding this comment.
this could be useful outside this function - where else is this hardcoded?
There was a problem hiding this comment.
This was in both Kokkos De Boor's Device functions. I will move them outside.
There was a problem hiding this comment.
When I move it outside of the function, should it be declared as a static constexpr inside the class or as a member variable?
| const int MAX_DEGREE = 3; | ||
| int lKnot = order; | ||
| lKnot--; | ||
| int resultOrder = lKnot; |
There was a problem hiding this comment.
int resultOrder = order -1; would be much easier to read
| int leftPt = 0; | ||
|
|
||
| while (knots(lKnot+1) < x) { | ||
| // double x = xVals(offset); |
There was a problem hiding this comment.
please remove code that is commented out
| } | ||
|
|
||
| int order_t = lKnot-1; | ||
| const int MAX_DEGREE = 3; |
There was a problem hiding this comment.
move this definition to a place both functions can access it - defining constants in multiple locations is likely to cause problems later (i.e., someone changes one but forgets/doesn't know to change the other)
| #include <numeric> | ||
| #include <string> | ||
|
|
||
| double EPSILON = 1e-12; |
There was a problem hiding this comment.
Please make this const and move it to where it is used within the function.
There was a problem hiding this comment.
This has been resolved.
| #include <numeric> | ||
| #include <string> | ||
|
|
||
| double EPSILON = 1e-12; |
There was a problem hiding this comment.
This has been resolved.
| // For checking if the content of the splines are correct | ||
| // | ||
|
|
||
| double EPSILON = 1e-12; |
There was a problem hiding this comment.
same comment as other tests
There was a problem hiding this comment.
This has been resolved.
| auto intView = Kokkos::create_mirror_view(kokkosBSP.getOrder()); | ||
| Kokkos::deep_copy(intView, kokkosBSP.getOrder()); |
There was a problem hiding this comment.
use the kokkos function create_mirror_view_and_copy if you just want a host copy of the 'order' device array
There was a problem hiding this comment.
This has been resolved.
| auto double2DView = Kokkos::create_mirror_view(kokkosBSP.getCtrlPts()); | ||
| Kokkos::deep_copy(double2DView, kokkosBSP.getCtrlPts()); |
There was a problem hiding this comment.
This has been resolved.
| auto doubleView = Kokkos::create_mirror_view(kokkosBSP.getKnots()); | ||
| Kokkos::deep_copy(doubleView, kokkosBSP.getKnots()); |
There was a problem hiding this comment.
This has been resolved.
There was a problem hiding this comment.
This has been resolved.
This branch included Kokkos version of the BSpline inplementation. The main file is BSplineKokkos2D.h which contains Kokkos version of the BSpline that utilize 2D view for control points. 1st and 2nd derivative evaluation are implemented.