Skip to content

Fill remaining dask+cupy gaps: terrain, perlin, and zonal.crosstab #906

@brendancol

Description

@brendancol

Problem

Three functions each support 3 backends but are missing dask+cupy (and crosstab also missing cupy):

Function NumPy Dask CuPy Dask+CuPy
generate_terrain()
perlin()
crosstab()

References:

  • xrspatial/terrain.py line 265: dask_cupy_func=not_implemented_func
  • xrspatial/perlin.py line 247: dask_cupy_func=not_implemented_func
  • xrspatial/zonal.py lines 1176–1180: both cupy_func and dask_cupy_func are not_implemented_func

Proposed Fix

  • terrain dask+cupy: Wrap existing _terrain_cupy() in map_blocks (terrain generation is per-chunk independent).
  • perlin dask+cupy: Wrap existing _perlin_gpu() in map_blocks.
  • crosstab cupy: Adapt the numpy sort-and-stride counting logic using cupy sorting (similar to _stats_cupy pattern).
  • crosstab dask+cupy: Combine cupy chunk function with dask delayed aggregation.

Impact

These gap-fillings complete the 4-backend matrix for more functions. While individually lower-priority than core analytics, they matter for users building end-to-end GPU pipelines — a pipeline that works on cupy but fails when wrapped in dask is frustrating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend-coverageAdding missing dask/cupy/dask+cupy backend supportenhancementNew feature or requestgpuCuPy / CUDA GPU supportzonal tools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions