CliMA / OrthogonalSphericalShellGrids.jl

🌐 Recipes and tools for generating spherical shell grids for ocean simulations with Oceananigans
https://clima.github.io/OrthogonalSphericalShellGrids.jl/stable/
MIT License
3 stars 0 forks source link

`@allowscalar` should be imported from `GPUArrays` #26

Closed glwagner closed 1 month ago

glwagner commented 1 month ago

Pretty sure:

https://github.com/CliMA/OrthogonalSphericalShellGrids.jl/blob/a9dad47bfb8f2e88597a35827318e236fcb76a01/src/grid_extensions.jl#L21

For example: https://github.com/JuliaGPU/GPUArrays.jl/blob/d0492a29bdf18b9346cba7da16d7bcaf007d7fda/lib/GPUArraysCore/src/GPUArraysCore.jl#L45

What's more, it doesn't even look like @allowscalar is used in this package. So the CUDA dependency can probably be eliminated?

simone-silvestri commented 1 month ago

Oh, nice, we can just use GPUArrays then. Allowscalar is only used here https://github.com/CliMA/OrthogonalSphericalShellGrids.jl/blob/a9dad47bfb8f2e88597a35827318e236fcb76a01/src/grid_extensions.jl#L25

glwagner commented 1 month ago

It's not needed there, you only need

minimum(parent(grid.φᶠᶠᵃ))
glwagner commented 1 month ago

And you don't want to use it, it will slow down grid generation vs the fast minimum computed on the underlyihng array