Working example of CUDA-fied settler_cover()
#747
Merged
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.
See changes.
I've changed the benchmark approach to simulate 75 time steps to better reflect use case (and align with the mock example shown previously).
Timings:
~10.9x faster compared to CPU but orders of magnitude slower than the mock example in #739.
Note the number of allocations explode when using the GPU approach. There's some memory allocations that could be avoided by either making a GPU-specific
recruitment_rate()
or pre-allocating arrays as necessary.Note: In the code I comment that "
recruitment_rate()
takes < 1ms" but I'm not sure about that any more. Suspect there are additional memory allocations occurring.Incidentally, in
recruitment_rate()
this line (growth.jl:658
):ADRIA.jl/src/ecosystem/corals/growth.jl
Line 658 in aeeb749
I suspect the use of
replace()
is no longer necessary as we should always be passing in values for locations that are > 0.0PS: Please follow style guide - space indentation instead of tab indentation for one.