Open ali-ramadhan opened 1 month ago
Technically we cannot fix this problem here as long as the nodes view
into a CuArray
, since we don't own any of those types. We might have to submit a PR to CUDA for this? I believe CUDA supports one-level-nested CuArray but not twice.
Another solution is to re-form the nodes so that they are a plain view. This should work, it's merely laziness / convenience that we make a view
into an OffsetArray
, rather than extracting a view
directly from the parent (which would require computing interior indices.
Another solution would be to use Field
for the nodes, or even an abstract operation that computes them on the fly. This would allow the nodes to participate in abstract operations. Now that we have a Makie recipe too, one argument for not doing this (inconvenient plotting) may be eliminated. There might be other inconveniences though.
I feel like this impacts usability, especially interactive use, but it's not a bug in the sense that your simulation scripts are fine. Is it worth trying to fix this?
Maybe not. After all, executing
model.velocities.u.data
in the REPL with a GPU model produces a similar error to the one below.One nuclear option is to allow scalar operations in
show
methods, but in this particular example it's for aSubArray{OffsetVector{CuArray}}
so not a type we have control over without piracy.MWE:
produces this error when trying to show the result
This doesn't happen for regularly spaces dimensions:
because there is no data on the GPU to show