Skip to content

Make rotate function compatible with cupy #414

@GenevieveBuckley

Description

@GenevieveBuckley

The dask_image.ndinterp.rotate function currently supports numpy backed dask arrays, but not cupy GPU arrays. It would be nice to extend the functionality to add GPU support.

Suggested approach:
One way to approach this could be to:

  1. Try and split out the sub-section of the rotate function that makes the rotation matrix, and put this into a separate helper function (i.e. group all the numpy specific lines of code together, while keeping the function as small as possible to reduce code duplication later).
  2. Make a second version of the helper function using cupy/cupyx functions replacing all the lines that call numpy directly.
  3. Then we could use the same dispatch mechanism as we do with the other modules (see the dask_image/dispatch folder) to register our new numpy and cupy versions.
  4. Add a test for the new functionality
  5. Update the coverage.rst table, adding a tick mark to indicate this function now has GPU support

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions