You need to sign in or sign up before continuing.
Draft: Do dot product using lambda functions
What is the new feature
Reduce dot product code using lambda functions. After the new commit. I think this solution is cleaner than the Kokkos subview method.
How is it implemented
This solution uses three lambda functions so that within c++20 standard (required for lambda template), we can wrap any dot product to single line execution.
The advantage is
- For all dot products, we just have to redefine the lambda function and register it.
- Without using
mdspan
, we don't have to use c++23.
The disadvantage is
- The code is really complicated and I don't know if anyone understands.
- To use this feature, one at least has to know how to write an lambda function.
Another solution is to just reduce code using an inner for-loop. (This would have a slight overhead of computing the incrementing id.)
Mandatory steps before review
-
Gitlab CI passes (Hint: use make format
for linting) -
New feature is covered by additional unit tests -
Mark the merge request as ready by removing Draft:
Mandatory steps before merge
-
Reviewed by a maintainer -
Incorporate review suggestions -
Remember to edit the commit message and select the proper changelog category (feature/bugfix/other) -
Prior to merging, please remove any boilerplate from the MR description, retaining only the Please describe your feature in a couple of words and describe important implementation details of the feature section to maintain
You are not supposed to merge this request by yourself, the maintainers of libiconmath take care of this action!
Edited by Yen-Chen Chen
Merge request reports
Activity
assigned to @b382190
added 61 commits
-
8672aff2...23e92b71 - 60 commits from branch
lib-divrot-add-cpp-codes
- 8e77be3f - Inner product using lambda functions
-
8672aff2...23e92b71 - 60 commits from branch
added C++ improvement label
added 1 commit
- 76ad26d3 - Reorganize lambda functions so that it is easier to understand
added 13 commits
-
76ad26d3...bad07242 - 11 commits from branch
lib-divrot-add-cpp-codes
- e753df9f - Inner product using lambda functions
- 0a3bf2d9 - Reorganize lambda functions so that it is easier to understand
-
76ad26d3...bad07242 - 11 commits from branch
added 6 commits
-
0a3bf2d9...45037019 - 4 commits from branch
lib-divrot-add-cpp-codes
- 168761fb - Inner product using lambda functions
- 0bc1e6a9 - Reorganize lambda functions so that it is easier to understand
-
0a3bf2d9...45037019 - 4 commits from branch
added 36 commits
-
0c5f7d1d - 1 commit from branch
feature-add-cpp-codes
- 0c5f7d1d...d899d983 - 25 earlier commits
- 8f1b3259 - added rest of the unit tests for div3d, div4d and divavg
- 5d2d3262 - added unit tests for rest of the functions
- 89015a6e - applied clang-format to the test file
- f52f3c1f - reverted back some changes
- 864898e3 - Remove redundant code
- 29340c9e - Rename lib_divrot to mo_lib_divrot
- 691f8ade - Combine Div tests
- 937abe5f - Split tests into three files
- adfed9ce - Inner product using lambda functions
- f32633f5 - Reorganize lambda functions so that it is easier to understand
Toggle commit list-
0c5f7d1d - 1 commit from branch
added 77 commits
-
f32633f5...af882064 - 42 commits from branch
feature-add-cpp-codes
- af882064...9545b26f - 25 earlier commits
- 1243b0de - added rest of the unit tests for div3d, div4d and divavg
- 2129f292 - added unit tests for rest of the functions
- e44305a5 - applied clang-format to the test file
- 57c31f75 - reverted back some changes
- ad904ee0 - Remove redundant code
- 4a2770c0 - Rename lib_divrot to mo_lib_divrot
- 1e701457 - Combine Div tests
- d986342e - Split tests into three files
- 1ac90f84 - Inner product using lambda functions
- 3eee5642 - Reorganize lambda functions so that it is easier to understand
Toggle commit list-
f32633f5...af882064 - 42 commits from branch
Please register or sign in to reply