acts-project / algebra-plugins

Mozilla Public License 2.0
3 stars 10 forks source link

Added Fastor as a full backend and frontend. #78

Closed wermos closed 1 year ago

wermos commented 1 year ago

The full thing is still a WIP, but I am opening a PR with the vector functions to get some feedback.

wermos commented 1 year ago

Inside math/eigen/include/algebra/math/impl/eigen_vector.hpp, there are functions defined like

/** Dot product between two input vectors
 *
 * @tparam derived_type_lhs is the first matrix (expression) template
 * @tparam derived_type_rhs is the second matrix (expression) template
 *
 * @param a the first input vector
 * @param b the second input vector
 *
 * @return the scalar dot product value
 **/
template <typename derived_type_lhs, typename derived_type_rhs>
ALGEBRA_HOST_DEVICE inline auto dot(
    const Eigen::MatrixBase<derived_type_lhs> &a,
    const Eigen::MatrixBase<derived_type_rhs> &b) {
  return a.dot(b);
}

i.e., the functions are defined in terms of Eigen::MatrixBase because the library utilizes expression templates.

Fastor also utilizes expression templates, and hence has similar Expression classes. However, they are not officially documented. Are we fine with using non-documented parts of the library? Or should the definitions of stay as they are?

niermann999 commented 1 year ago

For the formatting, you can use clang format 10.0.0 or look in the github actions tab for a downloadable artifact that contains the correctly formatted changes

wermos commented 1 year ago

For the formatting, you can use clang format 10.0.0 or look in the github actions tab for a downloadable artifact that contains the correctly formatted changes.

Sure thing. I'm not too worried about the formatting right now, because most of the changes it wants me to make are in currently empty files (which, of course, won't be empty anymore by the time I'm done with them).

wermos commented 1 year ago

However, if you want to merge this PR to the main line of work, I can fix the formatting issues. Otherwise, we can just wait until I have it all done.

wermos commented 1 year ago

I'm marking this PR as a draft until I am done so that the CI doesn't keep running for every commit I make.

wermos commented 1 year ago

I think I'm done with writing the backend and frontend now; it's ready for review.

stephenswat commented 1 year ago

Please remove the swap file from the pull request. You may want to add .swp files to your global git ignore list if this is a recurring issue for you. :slightly_smiling_face:

wermos commented 1 year ago

Oops! I've removed the file and added *.swp to my .git/info/exclude 😅

niermann999 commented 1 year ago

However, if you want to merge this PR to the main line of work, I can fix the formatting issues. Otherwise, we can just wait until I have it all done.

We usually merge into main, yes.

niermann999 commented 1 year ago

Oops! I've removed the file and added *.swp to my .git/info/exclude sweat_smile

I still see a file storage/fastor/include/algebra/storage/.eigen.hpp.swp in the change set?

wermos commented 1 year ago

I finally managed to pass the CI 🥳 @niermann999 It's ready for review now.