Core: variadic templates for backend.#559
Draft
GPMueller wants to merge 5 commits into
Draft
Conversation
The assign and reduce parallelisation functions can now handle arbitrary numbers of function arguments, which are forwarded to the lambda. Therefore, the lambda is now placed before the variadic arguments. Note that they can now also be called without arguments, allowing e.g. an assignment of zero to an entire `field`.
2830b1f to
0ad8c31
Compare
We cannot capture variadic parameters in the CUDA lambdas, which we would need in the variadic reduce. The API now includes an integer size argument again, since it otherwise would not work if the parameter pack was empty (and it is needed in the CUDA version of reduce).
Codecov Report
@@ Coverage Diff @@
## develop #559 +/- ##
===========================================
+ Coverage 50.06% 50.27% +0.21%
===========================================
Files 88 88
Lines 10136 10183 +47
===========================================
+ Hits 5075 5120 +45
- Misses 5061 5063 +2 |
- replaced all usage of `fill` - replaced all usage of `normalize_vectors` - tidied up the Solvers by using `Backend::par::apply`. With this change, particularly RK4 and Heun should become faster in OpenMP and CUDA
8cd8065 to
3228c39
Compare
3228c39 to
61da747
Compare
Member
Author
|
Unfortunately, the extended lambdas in CUDA are more restricted than I thought, see https://docs.nvidia.com/cuda/cuda-c-programming-guide/#extended-lambda-restrictions The main issue is this rule:
This means that, for example, most Note also
|
212372f to
f49c114
Compare
63fbd74 to
2edff73
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The assign and reduce parallelisation functions can now handle arbitrary numbers of function arguments, which are forwarded to the lambda.
Therefore, the lambda is now placed before the variadic arguments.
Note that they can now also be called without arguments, allowing e.g. an assignment of zero to an entire
field.This PR is related to issue #529.
TODO: