|
3 | 3 |
|
4 | 4 | from xrspatial import slope |
5 | 5 | from xrspatial.tests.general_checks import (assert_nan_edges_effect, assert_numpy_equals_cupy, |
| 6 | + assert_numpy_equals_dask_cupy, |
6 | 7 | assert_numpy_equals_dask_numpy, create_test_raster, |
7 | 8 | cuda_and_cupy_available, general_output_checks) |
8 | 9 |
|
@@ -63,3 +64,13 @@ def test_numpy_equals_cupy_qgis_data(elevation_raster): |
63 | 64 | numpy_agg = input_data(elevation_raster, 'numpy') |
64 | 65 | cupy_agg = input_data(elevation_raster, 'cupy') |
65 | 66 | assert_numpy_equals_cupy(numpy_agg, cupy_agg, slope) |
| 67 | + |
| 68 | + |
| 69 | +@cuda_and_cupy_available |
| 70 | +@pytest.mark.parametrize("size", [(2, 4), (10, 15)]) |
| 71 | +@pytest.mark.parametrize( |
| 72 | + "dtype", [np.int32, np.int64, np.uint32, np.uint64, np.float32, np.float64]) |
| 73 | +def test_numpy_equals_dask_cupy_random_data(random_data): |
| 74 | + numpy_agg = create_test_raster(random_data, backend='numpy') |
| 75 | + dask_cupy_agg = create_test_raster(random_data, backend='dask+cupy') |
| 76 | + assert_numpy_equals_dask_cupy(numpy_agg, dask_cupy_agg, slope, atol=1e-6, rtol=1e-6) |
0 commit comments