Preparations to run inertial river routing on GPU - #650
Draft
BSchilperoort wants to merge 4 commits into
Draft
BSchilperoort wants to merge 4 commits into
BSchilperoort wants to merge 4 commits into
Conversation
BSchilperoort
commented
Jul 2, 2025
| width::Array{Float64, 2} # Flood width [m] | ||
| a::Array{Float64, 2} # Flow area (cumulative) [m²] | ||
| p::Array{Float64, 2} # Wetted perimeter (cumulative) [m] | ||
| @with_kw struct FloodPlainProfile{ |
Author
There was a problem hiding this comment.
Not sure what the {N} parameter was supposed to do here. Adding parametric types here broke that feature.
It also did not seem to be used anywhere, except for in the profile = FloodPlainProfile{n_depths}(; ... definition below. Removing this did not break any tests.
BSchilperoort
commented
Jul 2, 2025
| ]) | ||
| res_params = Wflow.ReservoirParameters(; | ||
| area = [200_000_000], | ||
| area = [2.0e8], |
Author
There was a problem hiding this comment.
Tests were passing a Vector{Int}, which did not fail before despite the type of area being defined as Vector{Float64}. I guess some magical type casting was performed automatically?
Defining the type of area as <:AbstractArray{<:AbstractFloat} broke this however, so the arrays in this test had to be modified to have float elements.
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.
Issue addressed
Related to #646 - allows for parametric types of vectors in structs. The parametric types are also
<:AbstractArrayto allow for moving the data to GPU arrays instead of Julia native arrays.To do;
<:AbstractFloatinstead ofFloat64Nothing(see Skipping modules with!isnothing(...)incompatible with GPU kernels #647)Explanation
Adapt has been added as a dependency, to allow for moving arrays to GPU (e.g.
CuArrayorROCArray)Checklist
master