Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions xrspatial/geotiff/_gpu_decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -3151,7 +3151,7 @@ def _block_reduce_2d_gpu(arr2d, method, nodata=None):
Odd inputs are NaN-padded along the trailing edge (float-promoted for
integer dtypes) so the 2x2 block reshape works and the residual block
is reduced via the same nan-aware aggregations (issue #2105). Mirrors
the CPU helper :func:`xrspatial.geotiff._writer._block_reduce_2d` so
the CPU helper :func:`xrspatial.geotiff._overview._block_reduce_2d` so
the two backends produce identical overviews.

When ``nodata`` is supplied and ``arr2d`` is a float dtype, cells that
Expand All @@ -3178,7 +3178,7 @@ def _block_reduce_2d_gpu(arr2d, method, nodata=None):
# Mode is expensive on GPU; fall back to CPU. The CPU helper
# now handles odd-sized inputs natively.
cpu_arr = arr2d.get()
from ._writer import _block_reduce_2d
from ._overview import _block_reduce_2d
cpu_result = _block_reduce_2d(cpu_arr, 'mode', nodata=nodata)
return cupy.asarray(cpu_result)

Expand All @@ -3190,7 +3190,7 @@ def _block_reduce_2d_gpu(arr2d, method, nodata=None):
# CPU writer and so the sentinel handling matches. The CPU
# helper handles odd-sized inputs via edge-replicate padding.
cpu_arr = arr2d.get()
from ._writer import _block_reduce_2d
from ._overview import _block_reduce_2d
cpu_result = _block_reduce_2d(cpu_arr, 'cubic', nodata=nodata)
return cupy.asarray(cpu_result)

Expand Down
Loading
Loading