| 127 | |
| 128 | @pytest.mark.parametrize("func", functions) |
| 129 | def test_basic(func): |
| 130 | c = cupy.random.default_rng().random((2, 3, 4)) |
| 131 | n = c.get() |
| 132 | dc = da.from_array(c, chunks=(1, 2, 2), asarray=False) |
| 133 | dn = da.from_array(n, chunks=(1, 2, 2)) |
| 134 | |
| 135 | ddc = func(dc) |
| 136 | ddn = func(dn) |
| 137 | |
| 138 | assert type(ddc._meta) is cupy.ndarray |
| 139 | |
| 140 | if next(iter(ddc.dask.keys()))[0].startswith("empty"): |
| 141 | # We can't verify for data correctness when testing empty_like |
| 142 | assert type(ddc._meta) is type(ddc.compute()) |
| 143 | else: |
| 144 | assert_eq(ddc, ddc) # Check that _meta and computed arrays match types |
| 145 | assert_eq(ddc, ddn, check_type=False) |
| 146 | |
| 147 | |
| 148 | @pytest.mark.parametrize("dtype", ["f4", "f8"]) |