-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPU issue indexing flat fields #4044
Comments
The problem here is actually this line
that gets called here
It is not a problem on CPUs because on CPUs we have a grid associated to a field. On GPUs we throw away the grid so this function errors. I can open a PR to fix this |
PS this does not happen if you index with 3 indices since |
Before you fix this @simone-silvestri, the issue is that the indexing should be |
I see a lot of users try to access 2D fields with |
Hmm interesting. I think that support was an accident? |
I guess we have to decide whether its important for people to explicitly declare the dead indices or not. Another consideration is whether this permits more general code (eg reduced code independent of direction). I haven't seen the latter though. |
Somehow internally in Oceananigans we have never used a 1- or 2-index form, but @simone-silvestri you're saying this appears in user code? If you have examples that will help shape this discussion. |
When I try to index into a field which has nothing topology in a kernel, e.g.:
then it works on CPU, but hits a dynamic function invocation on line 82 here:
Oceananigans.jl/src/Grids/grid_utils.jl
Lines 81 to 89 in 2b601f1
could we rewrite this like:
instead?
The text was updated successfully, but these errors were encountered: